Teneo Developers

Variables

Introduction

The entries of an Entity can have zero, one or more variables attached and need to be of type string or script; when a variable is added all entries need to have a variable value.
String type variables are implicitly quoted and an variable value can be left empty when needed.
A script type variable can contain scripted values or manually quoted values, and when changing the type from string to script, quotes are added to the variable values; while changing from script to string any leading or trailing quotes are removed from variable values and the implicit ones remain.

Variable naming conventions

The name of a variable cannot contain spaces or other special characters nor be named lob or _USED_WORDS since it conflicts with special variables which hold those names.

Reserved characters in entries

Reserved characters used as entry values will automatically be escaped with quotes; a closing curly bracketed used as script variable value will automatically be escaped with a backslash.

Add and edit variables

Add or edit a variable

  • In the top ribbon of the Entity, click Add Variable Clicking the lower part of the button allows to select between String variable or Script variable; a string variable is added when clicking the upper part of the Add Variable button
  • Change the variable from string to script or vice versa by selecting the variable column and clicking String/Script in the top ribbon When changing the type from string to script quotes are added to the variables values while any leading or trailing quotes are removed from variable values when changing from script to string (only the implicit coral-colored quotes remain).

String type variables are implicitly quoted and a variable value can be left empty if needed
Script type variables can contain scripted values or manually quoted values

  • Add the name of the variable by clicking the cell New_Variable

Adding variable values

When entering variable values, the auto-complete function looks up other values already in the variable column and suggest the value text to the user; pressing Enter copies the suggestion into the cell.

Propagation of variables from the referenced Language Object or Entity is made by using the lob. prefix before the variable name.

Automatic propagation of variable values

Variables of referencing entries (an entry where the entry value is an Entity / Language Object - as opposed to a bare word) will be automatically set to propagate the variable value when a matching variable is present.

  • A new referencing entry is added to the parent - any matching variables will be propagated
  • A new variable is added to the parent - any referencing entry with matching variables will be propagated.

New Entry

  • CITIES Entity contains a city_code variable
  • A new SPECIAL_CITIES Entity / Language Object is added - which has a city_code NLU variable
  • In the Entity CITIES a reference to the SPECIAL_CITIES Entity / Language Object is added
  • The editor now detects the city_code variable on the SPECIAL_CITIES Entity / Language Object and adds the lob.city_code propagation script to the variable cell

Entity Variable Propagation

See also the Entries editor

Change Variable type

To change the type of an already existing Variable, follow the below steps:

  • Select the header of the variable or any field below
  • In the top ribbon, click String or Script depending on the wanted type
  • Remember to Save the Entity to preserve the changes.

Delete Variable

To delete a Variable, simply follow the below steps:

  • Select the header of the variable or any field below
  • In the top ribbon, click Delete in the Variables section
  • Remember to Save the Entity to preserve the changes.