Inside Automation Engine > Executing Objects > Object and PromptSet Variables

Object and PromptSet Variables

Almost every executable objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task 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 variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. &HOST#.

This variable can immediately be used in the scriptA particular Automation Engine object type.. The following example uses the object variable to terminate the agentA program that enables the de-centralized execution of processes (such as deployments) on target systems (computers or business solutions) or a service that provides connectivity to a target system (such as for databases or middleware). An agent is also an object type in the Automation Engine. [Formerly called "Executor."] See also: host.

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

The values of object variablesPlaceholder for values that are stored in an object's "Variables & Prompts" tab/section. 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 parentThere are different ways of activating objects. The originator of an activation is referred to as the superordinate task (parent). See also: Child; Children

 

All values (default)

The object obtains all the superordinate taskThere are various ways of activating objects. The originator of the activation is referred to as the superordinate task (parent).'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 taskAn executable object that is running. Tasks are also referred to as activities. 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 workflowAn object of the Automation Engine that can include several executable objects and which runs them in a specified order. [Formerly called "ProcessFlow" and "JobPlan."] 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 elementFields/control elements that are used to query User values. They are the content of a PromptSet input mask.. 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 notificationAn Automation Engine object type used to send messages to users and user groups. [Formerly called "CallOperator."] that starts automatically (warning) before a calendarAn Automation Engine object type that defines a set of days based on calendar keywords.'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 restartA restart refers to the repetition of an object's execution. This action differs from a new start in some parts. 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 functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… CONVERTin order to assign a particular data type to the variables. 

Examples

Example 1

A file transferTransfers files from one computer to another. A particular Automation Engine object type (FileTransfer object). 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

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH