Creating the child Job to pass a value to the parent Job - 7.3

Buffer

EnrichVersion
Cloud
7.3
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
EnrichPlatform
Talend Studio
task
Data Governance > Third-party systems > Buffer components
Data Quality and Preparation > Third-party systems > Buffer components
Design and Development > Third-party systems > Buffer components

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")).