Returning a value from a child Job to the parent Job
You may need to return a value or rows from a child Job to the parent Job for
further use. This article shows the best practice of how to pass a value with a
tBufferOutput component from a child Job to the parent Job.
Creating the child Job
In this tutorial, you will create two Jobs: a parent Job and a child Job. The child Job will read data from a text file, populate the total number of rows and pass the rows to the parent Job.
The input file, named in.txt, is as follows:
id;name
1;Shong
2;Elise
3;Sabrina
This Job will use the following components:
- a tFileInputDelimited component to read data from a text file and a tLogRow to print it on the console to create the first subjob,
- a tFixedFlowInput component, to populate the total number of rows read by the tFileInputDelimited and buffer it with a tBufferOutput.
Procedure
Creating the parent job
This Job will use the following components:
- a tRunJob component to call the childjob and get the value buffered by the tBufferOutput component in the child Job and pass it to a tJavaRow component.