Skip to main content Skip to complementary content

Creating a parent Job to pass a value to a child Job

Before you begin

You have created a text file, in this example in.text.
id;name;scope
1;Shong;98
2;Ross;90
3;Tom;55
4;Patrick;99
5;Pedro;90

Procedure

  1. Create a Standard Job called ParentJob and configure it as follows.
  2. Double-click the tFileInputDelimited to open its Basic settings view and then configure its parameters.
    • Click the [...] button next to the File Name/Stream field and browse to the source file, in this example in.txt.
    • Set Header to 1.
    • Click the Edit schema button and add three columns to the schema, id as Integer, name as String and scope as Integer.
  3. In the Basic settings of the tFlowToIterate component, make sure that the Use the default (key,value) in global variables. box is checked.
  4. Open the Basic settings view of the tRunJob component to configure its parameters.
  5. In the Job field, select the child Job, in this example ChildJob.
  6. In the Context Param field, click the [+] button to add the two parameters defined in the Context view of the child Job, in this example name and scope.
  7. Define the value for each parameter, (String)globalMap.get("row1.name") for name and (Integer)globalMap.get("row1.scope") for scope.
  8. Press Ctrl+S to save your changes.
  9. Press F6 to execute the parent Job.

Results

The following results print to the console.

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!