Working with the Variable Read Write Node

Overview of the Variable Read Write Node

You can add a Variable Read Write node to a Flow tab in an orchestration job to set the value of a job level variable and to retrieve the value. The node's type is JOBVARIABLE. This node is typically used in a nested job to publish variables coming from inside of the nested job out to the outputs of the nested job. It can also be user to read variables coming into the nested job and make them available. Similar functions can be performed with the Expression node.

Inputs and Outputs to the Variable Read Write Node

Name
Description
Inputs:
NAME
Should be set to the name of the variable that you want to affect. The variable must be defined in the job before running the node.
OPERATION
You can perform 3 operations: NOOP - the value of the variable is not changed; ADD - a specific numeric value is added to the variable; SUB - a specific numeric value is subtracted from the variable; ASSIGN - a specific value is assigned to the variable
PARAMETER
In the case of ADD and SUB, this is a numeric value. In the case of ASSIGN, this is the value assigned to the variable. In the case of NOOP, this is ignored.
Unique Outputs:
VALUE
The current value of the variable after execution of the node

Using the Variable Read Write Node

You can add a Variable Read Write node to a Flow tab in an orchestration job to update variables and pass values between nested jobs. For example, you can create an orchestration job that consists of an inner job nested within an outer job. Then, you can use a Variable Read Write node to publish the variable from the inner job to the outer job.
The inner job is shown in the following display:
Inner Job
Inner Job
You can create job variables and set the description, external use of input or output, and the default value for each variable. The inner job variables are shown in the following display:
Inner Job Variables
Inner Job Variables
Note that the input variable InnerVar1 has a default value of 5. The output variable InnerVar2 has a null default value.
Use the Read or Write tab in the Variable Read Write node to select the Write to a job variable (InnerVar2) and the Operation( Assign), as shown in the following display:
Read or Write Tab Settings
Read or Write Tab Settings
The Parameter input is located on the Inputs tab, as shown in the following display:
Inputs Settings
Inputs Settings
Select Parameter and bind it to InnerVar1. Because Parameter is the argument to the operation on Inner Var2, this step binds InnerVar1 to InnerVar2.
The following display shows the outer job.
Outer Job
Outer Job
The Orchestration Job tab is shown in the following display:
Orchestration Job Tab
Orchestration Job Tab
This tab contains a reference to the inner job in the Orchestration job field. This reference embeds the inner job into the outer job. For information about Orchestration Job nodes, see Working with the Orchestration Job Node.
You need to create an input in the Echo node to capture the output from the inner job. To do this, open the Inputs tab in properties for the Echo node and click New Input.
An Echo node is shown in the following display:
Echo Input Settings
Echo Input Settings
Note that the input is named EchoInputVar.
Next, you need to import and bind the job output parameter from the inner job to the outer job. Click OK to close the New Input window and save the echo input. Then, click Import and Save from the Echo node properties toolbar. Note that the Variable Read Write node in the inner job published the variable InnerVar2 as output from the inner job. Therefore, InnerVar2 can be accessed from any node connected to the Orchestration Job node that references the inner job.
The Import and Bind window is shown in the following display:
Import and Bind Window
Import and Bind Window
Note that the EchoInput input is bound to InnerVar2, which is the Orchestration Job node output from the inner job. If the value of InnerVar2 changes, the value of EchoInput also changes. You can verify the output from the inner job was passed to the input of the Echo node in the outer job after you run the outer job. Select the Run History tab of the outer job after the job is submitted. Then, double click on the entry for the run. Finally, drill into the Echo node and select the Inputs tab.
The following display shows that the run-time value of 5 is passed to EchoInput in the Echo node after the outer job is successfully run.
Run Time Value of EchoInput
Run Time Value of EchoInput