This use case shows that it is possible to access the input flow using a dedicated variable and following a specific syntax such as: input_row.name. The source data is processed at runtime by the tJavaRow component.
A common Job using tJavaRow is generally composed of:
- a tFileInputDelimited component to read data from a text file,
- a tJavaRow to apply transformation to the data processed,
- a tLogRow component to print data in the console.
- In the Palette, slide a tFileInputDelimited , a tJavaRow and a tLogRow component onto the workspace.
- Connect tFileInputDelimited to tJavaRow and tJavaRow to tLogRow using a Row > Main link.
Set the Basic settings of the tFileInputDelimited
- Double-click on tFileInputDelimited to display its Basic settings. The tFileInputDelimited reads the same text file and use the same schema as in the tJava example .
- When prompted, click OK to accept the propagation or click afterward on the Sync columns button in the Basic settings view of tJavaRow.
Double-click on tJavaRow to display its Basic
settings view and add the following code in the
output_row.id = input_row.id; output_row.name = (input_row.name).toUpperCase();Note: This code converts the column names to upper case.
- Execute the Job by pressing F6.