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…
- Add the
tJavaRow
andtLogRow
components. - Link the flows as shown in the following screenshot:
- Open the schema and you will see that there are no fields in the output. Highlight
name
,dateOfBirth
, andage
, and click on the single arrow. - Use the + button to add new columns
cleansedName
(String) androwCount
(Integer), so that the schema looks like the following: - 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.