Adding Predefined Variables to Objects and Scripts
In Automation Engine, you can use specific variables in attributes or in the scripts of executable objects. While these objects are being executed, the variables are replaced by the corresponding values. You can use the Insert Variables dialog to select predefined variables and insert them in the text fields of attributes or the scripts of executable objects.
Predefined variables is an umbrella term that refers to all:
- System properties variables: System properties variables are not objects. They are the same throughout the system.
- Object properties variables: Object properties variables reference objects or their runtime instance (task).
- Automation variables: Automation variables are a predefined subset of static Variable objects used for system properties.
- Variable objects: Variable objects can be static or dynamic. Static variables store values in their object definition, while dynamic variables retrieve values from a specified data source.
Predefined variables are placeholders for values of the object in which they are used, a Variable object or the Automation Engine system. You can also retrieve and use System properties variables and Object properties variables values with script functions (such as SYS_ACT_ME_NAME). Using variables simplifies this procedure and reduces the length of scripts in objects.
Using Predefined Variables in Objects are not supported in Automation Engine Script and are therefore not replaced. Use the script elements GET_VAR/:PUT_VAR to access Variable objects.
Script or Object variables can also be used in attributes. More details are provided in the topic Attributes Page.
You can type in predefined variables manually or use the Insert Variables to validate the name.
Picking Predefined Variables from the Insert Variables Dialog
To pick a predefined variable with the Insert Variables dialog:
- Open the Insert Variables dialog shown below by clicking in an allowable field.
- Select a category from the drop-down list. The following options are available:
- System properties: The values refer to the System Properties and are the same throughout the system. For example, &$SYSTEM# for the name of the Automation Engine system.
- Object properties: Object-related values are either:
- Object script values, which return codes of script elements. For example, &$RUNID# for the Run number (RunID) of the task.
- Object attributes. For example, &$AGENT# for the name of the agent the task should be processed on.
- Automation variables: A predefined subset of static Varable objects used for system properties. For example, {UC_CLIENT_SETTINGS} will be inserted for the UC_CLIENT_SETTINGS Variable object used for Automation Engine system settings per client. When resolving the values, the system first searches the Variable object in the current client and then in the system client.
- Variable objects: The current client's Variable objects. For example, {VARA.DB.1} will be inserted for the Variable object VARA.DB.1.
- Optionally specify a search in the Search field to limit the display results.
- Select a variable from the list.
- If the variable you select has date or time format, select a format from the Format field.
- p = point
- s = slash
- d = dash
- If the variable you select is a Static Variable object, optionally enter the key name and column number for the cell you want to select.
- Click Select.
The Insert Variables dialog does not list all System Properties values. For a complete list, see System Properties.
Several System Properties variables are described in the table of Variable objects in client 0, see Settings in Variables.
System Properties and Object Properties variables start with &$ and end with #. In between is a string that is constant except for the format of date and time values.
The Insert Variables dialog does not list all object attributes. For a complete list, see Object - Attributes and Object - Script Values.
System Properties and Object Properties variables start with &$ and end with #. In between is a string that is constant except for the format of date and time values.
This category is not available when you open the Insert Variables dialog in the script editor or in Form tabs.
To reference a particular value of a Static or XML Variable object in an object field, you use the format { Variable object [, Key [, Column number ]] }. For example, in {UC_CLIENT_SETTINGS, AUTO_FORECAST_DAYS, 1}, UC_CLIENT_SETTINGS is a VARA object, AUTO_FORECAST_DAYS is a key name, and 1 is a column number. If neither the Key nor the column is defined, the system uses the value of the first entry or the result column/first Value column. You cannot select the key and column for a Variable object with the Insert Variables dialog. You need to add the variable, and edit it to add them.
To reference a particular value of a Static or XML Variable object in an object field, you use the format { Variable object [, Key [, Column number ]] }. For example, in {UC_CLIENT_SETTINGS, AUTO_FORECAST_DAYS, 1}, UC_CLIENT_SETTINGS is a VARA object, AUTO_FORECAST_DAYS is a key name, and 1 is a column number. If neither the Key nor the column is defined, the system uses the value of the first entry or the result column/first Value column. You cannot select the key and column for a Variable object with the Insert Variables dialog. You need to add the variable, and edit it to add them.
The search is case-insensitive.
If the categories "System Properties" or "Object" are selected, the entries represent a short form of the relevant value.
If the categories "Automation variables" or "Variable objects" are selected, the list displays the names of the Variable objects.
When available, the variable's description is displayed below the "Variable name" field.
Some date and time formats include special characters which must not be used for variable names. The '_' character is always used as a separator in the variable name (instead of usual separators). At the end, another '_' plus an additional letter which identifies the original separator are appended to this format.
Examples of separators are shown below.
Dialog entry | Date format | Placeholder | Value |
---|---|---|---|
&$DATE_format# | DD/MM/YYYY | &$DATE_DD_MM_YYYY_s# | 23/04/2017 |
&$DATE_format# | DD.MM.YYYY | &$DATE_DD_MM_YYYY_p# | 23.04.2017 |
&$DATE_format# | DD-MM-YYYY | &$DATE_DD_MM_YYYY_d# | 23-04-2017 |
A list of all supported formats is included in Date and Time Formats for Automation Engine and Object Properties Variables.
The variable is added to the field. If you specified a format or key and column, the variable name will be displayed accordingly. For example:
The variable: | With: | Is written as: |
---|---|---|
Current time | The time format HH:MM:SS | &$TIME_HH_MM_SS# |
Current date | Thedate format DD_MM_YYYY | &$PHYS_DATE_DD_MM_YYYY_d# |
VARA.RENTALS | Key 1 and column 2 | {VARA.RENTALS, 1, 2} |
Topics: