Adding complex logic into a flow using tJavaRow

The tJavaRow component allows Java logic to be performed for every record within a flow.

Getting ready

Open the job jo_cook_ch05_0020_tJavaRow.

How to do it…

  1. Add the tJavaRow and tLogRow components.
  2. Link the flows as shown in the following screenshot:
    How to do it…
  3. Open the schema and you will see that there are no fields in the output. Highlight name, dateOfBirth, and age, and click on the single arrow.
  4. Use the + button to add new columns cleansedName (String) and rowCount (Integer), so that the schema looks like the following:
  5. Close the schema by pressing ok and then press the Generate code button in the main tJavaRow ...

Get Talend Open Studio Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.