Passing parameters to a child job
In this recipe, we will show how parameters can be passed to a common child job.
Getting ready
Open the job jo_cook_ch11_0070_childParameters
. This job simply executes a child job. If you examine the child job, you will see that it prints the value of the context parameter inputParameter
.
How to do it…
- Run the parent job.
- You will see that the value for
inputParameter
isfromChild
. - Open the
tRun
component tab, and click on + to add a Context Param option. - Untick Transmit whole context.
- Select
inputParameter
in the Parameters column, and set the Valueto
fromParent
, as shown in the next screenshot: - Run the job, and you will see that the value for
inputParameter
has changed tofromParent
.
How it works…
All context variables defined for a child process are made available to a calling parent job via the tRunJob
component, as we saw previously.
There's more
In this exercise, we chose to send selected context variables to the child. This is generally a...