Setting up the child Jobs - Cloud

Talend Cloud Data Management Platform Studio User Guide

EnrichVersion
Cloud
EnrichProdName
Talend Cloud
EnrichPlatform
Talend Management Console
Talend Studio
task
Design and Development
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.
  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".
    Note: 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);
  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);