Passing variables set by using jobprop in one task to another in the same workflow instance

You can use the jobprop utility installed on HCL Workload Automation dynamic agent to set one or more variables and their value in a task and pass it to the successive task in the same workflow instance. This utility is supported only on executable tasks.

To set variable and its value in the first task use the following syntax:
jobprop <VAR-NAME> <value>
where
<VAR-NAME>
is the variable that you can export into another task.
<value>
is the value assigned to the <VAR-NAME>.
For more information about jobprop utility, see Defining variables with the jobprop utility.
To define the variables in another task, use the following syntax:
${jobs.<job_name>.wa.<variable_name>}
where
<job_name>
is the name or the alias of the task from which you are exporting the <variable_name> value.
In this example, the PAYROLLMAS#WF_PROP workflow contains the NC125133#TASKA and NC125133#TASKB executable tasks. The NC125133#TASKB task references the following NC125133#TASKA variable values set by using the jobprop utility:
  • VAR1 variable set to value1 value.
  • VAR2 variable set to value2 value.
  • VAR3 variable set to value3 value.
  • VAR4 variable set to value4 value.
SCHEDULE PAYROLLMAS#WF_PROP 
:
NC125133#TASKA
 TASK
 <?xml version="1.0" encoding="UTF-8"?>
 <jsdl:jobDefinition xmlns:jsdl="http://www.ibm.com/xmlns/
prod/scheduling/1.0/jsdl" xmlns:
jsdle="http://www.ibm.com/xmlns/prod/scheduling/1.0/jsdle">
<jsdl:application name="executable">
<jsdle:executable interactive="false">
<jsdle:script>#!/bin/sh
. /home/ITAuser/TWA/TWS/tws_env.sh
jobprop VAR1 value1
jobprop VAR2 value2
jobprop VAR3 value3
jobprop VAR4 value4
</jsdle:script>
</jsdle:executable>
</jsdl:application>
</jsdl:jobDefinition>
 DESCRIPTION "Sample Task Definition"
 RCCONDSUCC "RC>=0"
 RECOVERY STOP

NC125133#TASKB
 TASK
 <?xml version="1.0" encoding="UTF-8"?>
 <jsdl:jobDefinition xmlns:jsdl=
"http://www.ibm.com/xmlns/prod/scheduling/1.0/jsdl" xmlns:
jsdle="http://www.ibm.com/xmlns/prod/
scheduling/1.0/jsdle">
<jsdl:application name="executable">
<jsdle:executable interactive="false">
<jsdle:script>
echo VAR1=${jobs.TASKA.VAR1}
echo VAR2=${jobs.TASKA.VAR2}
echo VAR3=${jobs.TASKA.VAR3}
echo VAR4=${jobs.TASKA.VAR4}
</jsdle:script>
</jsdle:executable>
</jsdl:application>
</jsdl:jobDefinition>
 DESCRIPTION "Sample Task Definition"
 RCCONDSUCC "RC>=0"
 RECOVERY STOP
 FOLLOWS TASKA
END