Inside Automation Engine > Executing Objects > Object and PromptSet Variables

Object and PromptSet Variables

Almost every executable object includes a Variables & Prompts tab. This tab includes two sections: Variables and PromptSets. You can use the variables section in order to enter variables that should be used in the Process tabs and the attributes. In the PromptSet section, you can assign PromptSet objects whose variables are also available for the object. Variables do not have to be read but can be used directly as script variables.

Object and PromptSet variables are available in all Process tabs and the object attributes.

The following illustration shows the object variable &HOST#.

This variable can immediately be used in the script. The following example uses the object variable to terminate the agent.

:IF SYS_HOST_ALIVE(&HOST#) = "N"
:   
SEND_MSG "ADMIN","AE","Agent &HOST# is not active!"
:
ENDIF

The values of object variables can be specified with or without quotation marks. If you use single quotation marks, an individual quote within the string must appear twice, as otherwise one or more characters may be removed. You can also use double quotation marks. They are always handled as normal characters and are not removed.

Examples: 

Variables & Prompts Tab Entry

Actual Value

string1234

string1234

'string1234'

string1234

"string1234"

"string1234"

string'1234

string'1234

'string'1234' string
'string''1234' string'1234

There is another special feature that applies to object and PromptSet variables. They can be inherited from superordinate objects. A schedule's tasks can use the Schedule's object and PromptSet variables. This simplifies the maintenance process because it is not necessary to store the values in the individual objects.

Use the Variables & Prompts tab to specify whether object variables should be inherited, and if so, which ones.  

Field/Control

Description

Inherit from parent

 

All values (default)

The object obtains all the superordinate task's object and PromptSet variables.

Only defined values

The object only obtains the superordinate task's object and PromptSet variables that are defined in its Variables & Prompts tab.

No values

The object does not obtain object and PromptSet variables of the superordinate task.

The values of objects that are activated using ACTIVATE_UC_OBJECT and the parameter PASS_VALUES are inherited regardless of the setting "Inherit from parent".

PromptSet and object variables are not inherited if the subordinate task includes a PromptSet variable of the same name regardless of the setting "Inherit from parent".

Note that inherited object and PromptSet variables overwrite existing object variables if they have the same name. PromptSet variables are never overridden.

The following procedure can be used if you want to overwrite PromptSet variables with the value of a parent variable:

Open the task's workflow or schedule properties and switch to the Variables & Prompts tab. Select the PromptSet area and use the parent's variable name as the value of the relevant PromptSet element. If the particular PromptSet element is not a text field, click its labeling.

The setting "Inherit from parent" significantly affects all the object's subordinate tasks. Values are directly passed on from a task to its subordinate task. If it has been specified in an object that no values or only defined ones should be inherited, a task's subordinate tasks cannot access all object variables of "grand parent objects". The effects are shown in the examples below.

Object and PromptSet variables are passed on to:

The last bullet point could be an object that has been defined in the Result tab in the properties of a workflow task.

Variables are not passed to:

The last bullet point could be a notification that starts automatically (warning) before a calendar's validity date expires.

Object and PromptSet variables can also be used in order to set particular object attributes without using :PUT_ATT.

The script statement :PSETcreates a new entry in the Variables & Prompts tab which is valid for the particular execution if the object variable does not yet exist. 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, PostProcess, Child PostProcess tabs). It is not necessary to explicitly assign this value using the script element :RSET (for example, to the PostProcess tab). 

If you create an object variable by using the script statement :PSET, it is automatically passed on to the superordinate object. If the superordinate object already includes an object or PromptSet variable of the same name, this variable's value will be overwritten. Subsequent parent tasks can then access this variable.

When you restart an object, the values of the "Variables & Prompts" tab will be used for object variables provided object variables have been defined through this tab. The values of certain object executions are therefore irrelevant in restarts. The reason for this behavior is that when an error occurs because of the object variable, the system can correct the value in the object and this value will then also be used for the restart.

As opposed to script variables, object and PromptSet variables do not have a particular data type. You can use the script function CONVERTin order to assign a particular data type to the variables. 

Examples

Example 1

A file transfer is activated by a schedule. The following object variables are involved:

Schedule:

File transfer:

The file transfer's script accesses the variables &FILE#, &HOST# and &PATH#. Depending on the setting that has been made in the FileTransfer object's Variables & Prompts tab, the value assigned to the above variables changes:

Inherit from parent

Variable content

Explanation

All values (default)

&FILE# = Close_of_week.txt

The schedule's value overwrites the file transfer's value.

&HOST#  = win01

All the schedule's values are inherited. Therefore, the file transfer can also access &HOST#.

&PATH# = C:\Temp

This object variable is already part of the file transfer.

 

Only defined values

&FILE# = Close_of_week.txt

The schedule's value overwrites the file transfer's value because it also contains the object variable &FILE#.

&HOST#  = ""

The value of &HOST# is not inherited because the file transfer does not contain an object variable of the same name.

Task activation is canceled if an attempt is made to access a non-existing or non-inherited object variable via script.

&PATH# = C:\Temp

This object variable is already part of the file transfer.

 

No values

&FILE# = Close_of_day.txt

No values are inherited. Therefore, the file transfer's object variable is used.

&HOST#  = ""

The value of &HOST# is not inherited. Therefore, it cannot be used.

Task activation is canceled if an attempt is made to access a non-existing or non-inherited object variable via script.

&PATH# = C:\Temp

This object variable is already part of the file transfer.

Example 2

This example shows how values are inherited in a chain of task.

A workflow includes the objects FILETRANSFER01 and PROCESSFLOW01. PROCESSFLOW01 includes two jobs. Value inheritance between the main workflow and the file transfer is as explained in example 1.

Workflow

Object variable:
&HOST# = unix01
&FOLDER# = temp

FILETRANSFER01

Object variable:
&HOST# = win01

PROCESSFLOW01

Object variable:
&HOST# = unix02

JOB02

Object variable:
none

JOB03

Object variable:
&HOST# = unix03

Different situations are shown below and describe how PROCESSFLOW01 and its settings affect the two jobs:

Example 3

The following example includes the various combinations and special features of the inheritance of object and PromptSet variables. 

Five tasks run in a workflow (tasks 1, 2, 3, 4 and 6) and are executed one after the other. Task 5 is activated by using the script of task 4.

The workflow includes the object variables &VAR1#, &VAR2# and the PromptSet variables &TEXT1#, &COMBO1#.

 

 

See also:

Data Types of Script Variables