Skip to main content Skip to complementary content

Creating the child Job to pass a value to the parent 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 component to print it on the console,
  • a tFixedFlowInput component to get the total number of rows read by the tFileInputDelimited component and a tBufferOutput component to buffer the value.

Procedure

  1. Create a Job and name it childJob.
  2. Add a tFileInputDelimited component and a tLogRow component on the workspace and link them with a Row > Main connection.
  3. Add a tFixedFlowInput component and a tBufferOutput component on the workspace and link them with a Row > Main connection.
  4. Link the first subJob to the second one with a Trigger > On Subjob Ok connection.
  5. Click the tFileInputDelimited component to open its Basic settings view and fill the File name/Stream with the in.txt file path and the Header field with 1.
  6. Click the [...] button next to Edit schema to open the schema dialog box and define the schema by adding two columns, id of Integer type and name of String type.
  7. Double-click the tFixedFlowInput component to create a column named nb_line of Integer type.
  8. In the Mode area, select Use Single Table and fill the Value cell with ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")).

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!