Procedure
-
In the Contexts view, add a new context variable with
the Name of xmlInput and the
Type of String.
In this example, the context variable xmlInput of the Job will be specified in the MDM process which wants to invoke this Job.
You can search for further information about MDM processes on Talend Help Center (https://help.talend.com).
If you cannot find the Contexts view, go to Window > Show view > Talend, and select Contexts.
For more information about how to define context variables, see Talend Studio User Guide.
You can search for further information about how to define context variables on Talend Help Center (https://help.talend.com).
-
Double-click the tJava component to open
its Component view, and in the
Code area, enter the code according to your
needs.
In this example, enter
System.out.println("#############################"+context.xmlInput);
. - Double-click the tFixedFlowInput component to open its Component view.
-
Click the [...] button next
to Edit schema to open the dialog box and
define the schema for the data to be used by the source system.
In this example, add one new column col0 of the type String.
- After the schema is defined, click Yes in the Propagate dialog box to propagate the schema changes to the following component tBufferOutput.
- In the Number of rows field, enter 1.
-
In the Mode area, select Use Single
Table and enter "Paris" in the
Value column that corresponds to the column
col0 you have defined.
In this example, the value of the col0 provides the agent region information to be retrieved by MDM.
- Double-click the tBufferOutput component to open its Component view, and then make sure its schema is synchronized with the previous component tFixedFlowInput.
- Run the Job and make sure the execution succeeds.