Examples: Inheriting Object Variables

The examples in this topic describe how variables are inherited from parents to children:

Example: Activating a File Transfer By a Schedule

A File Transfer is activated by a Schedule. The following object variables are involved:

Schedule:

File transfer:

The script of the File Transfer accesses the variables defined in the Schedule (&FILE#, &HOST# and &PATH#). Their values depend on what is selected in the Settings section on the Variables Page of the Schedule.

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: Inheriting Values in Children and Grand Children

This example shows how values are inherited in a child workflow and beyond.

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

Parent Children Grandchildren

PARENTWF01

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

FILETRANSFER01

Object variable:
&HOST# = win01

N/A

WORKFLOW01

Object variable:
&HOST# = unix02

JOB02

JOB03

Object variable:
&HOST# = unix03

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

Example: A Combination of Inheritance Features

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#.

Variables page

See also: