Skip to main content Skip to complementary content

Setting up the child Jobs

The example below shows how to share a value between different Jobs via the routine defined earlier.

Procedure

  1. Create a Job named childJob1, and add two components by typing their names on the design workspace or dropping them from the Palette to the design workspace:
    • A tFixedFlowInput to generate an input data flow
    • A tJavaRow to receive the data and in which the Job calls the setter method to give a new value to the variable
  2. Double-click the tFixedFlowInput component to open its Basic settings view.
  3. Click the [...] button next to Edit schema to open the [Schema] dialog box and define the schema of the input data. In this example, the schema has only one column name of the string type.
    [Schema] dialog box for the tFixedFlowInput component.
  4. In the Mode area, select Use Single Table option, and define the corresponding value for the message column in the Values table. In this example, the value is "Talend".
    Basic settings view.
    Information noteNote: The tJava component is calling the getter method and assigning the return value to a string variable, then printing the variable value in the console.
  5. Double-click the tJavaRow component to open its Basic settings view.
  6. In the Code area, enter the following code to add the setter method.
    MyRoutine.setValue(input_row.name);
    Basic settings view.
  7. Create a Job called childJob2 and then create a tJava component in this Job.
  8. Double-click the tJava component to open its Basic settings view.
  9. In the Code area, enter the following code to add the getter method.
    String name=MyRoutine.getValue();
    System.out.println(name);
    Basic settings view.

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!