Variables Page
As a developer and object designer, when you create an executable object, you can define variables that are specific to that object and store them with the object. To distinguish them from other types of variables, they are referred to as object variables. You define them on the Variables page of executable objects. The object variables that you have defined on this page can be used throughout the object, including its Process Pages. The object variables that you define in parent objects can be inherited by their children.
When you restart an object, the variables are taken from the object definition and not from the original execution. This way, if an error occurs because of an object variable, you can correct the value in the object and restart again.
Object Variables in Scripts
To use object variables in scripts you need the :PSET script statement. It dynamically creates an object variable, which is valid for that particular execution. If an object variable of the same name already exists, its value is replaced by the new value.
If the object variable is modified by using the script elements :SET, :RSET or :READ, the value that has last been assigned is available in the object (Process, Post Process, Child Post Process pages). It is not necessary to explicitly assign this value using the script element :RSET (for example, to the Post Process page).
Order of the Variables
The order in which you define the variable matters. If you define several variables and one of the variables is referenced by others, make sure that you define the referenced variable first. Otherwise, the variables will not resolve properly.
Example:
You define four variables on the Variables page of a Job object. The first variable is referenced by the other three variables:
Order | Variable Name | Variable Value |
---|---|---|
1 |
&VARIABLE_0# |
ABCD |
2 |
&VARIABLE_1# |
&VARIABLE_0#_EFGH |
3 |
&VARIABLE_2# |
&VARIABLE_0#_IJKL |
4 |
&VARIABLE_3# |
&VARIABLE_0#_MNOP |
When you execute the object, all the variables are properly resolved because the referenced variable is defined (and therefore resolved) first:
ABCD
ABCD_EFGH
ABCD_IJKL
ABCD_MNOP
To Access the Object Variables
You define and edit object variables on the Variables page of the object.
- Open the executable object.
- On the navigation pane, expand Variables & Prompts.
- Select Variables.
To Add Object Variables
- Open the executable object.
- On the navigation pane, expand Variables & Prompts and select Variables.
- Put your cursor in the Name cell and type the name of the object variable. For more information, see Variable Names.
-
In the Value column you have two options:
- For simple vales, type it in the cell.
- For more complex values, click the editor icon and enter the value in the Cell Editor.
You can specify the values of object variables with or without quotation marks. Both single and double quotation marks are allowed.
This list explains how the values are resolved depending on how you use the quotation marks:
- string1234 resolves as string1234
- 'string1234' resolves as string1234
- "string1234" resolves as "string1234"
- string'1234 resolves as string'1234
- 'string'1234' resolves as string
- 'string''1234' resolves as string'1234
Note: You can populate this field using variables. For more information, see Inserting Variables/VARA Objects in Objects and Scripts.
-
Object variables can be used as external factors for calculating the Estimated Runtime of the object with the adaptive method. For this method to calculate and process the value of the variable correctly, you have to select the correct data type from the Use for adaptive ERT drop-down list.
-
To define whether this object can inherit the object values of its parent object (for example, a Workflow or a Schedule), on the lower half of the page, expand the Settings section. In Inherit from Parent choose one option:
-
All Variables
The object inherits all variables and VARA objects defined for its parent.
-
Only defined Variables
The object inherits only the object variables defined for its parent. Prompt Set variables are only inherited if the Prompt Set object complies with these values and the value to be overwritten has not been changed in the Variables page.
-
No Variables
The object does not inherit any variables from its parent object.
-
- Save your changes. You can start using this object variable in any of the attributes of this object that support variables.
Tip: To use variables or VARA objects to populate the Value entries, instead of typing them, click the variables icon to open the Insert Variables dialog. This dialog is also available in the cell editor.
See also: