Creating pseudo components using tJavaFlex

The tJavaFlex component is similar to the tJavaRow component, in that it is included into a flow. The difference between the two components is that the tJavaFlex component has pre and post processes that are performed before and after the individual rows are processed, so it is similar to a pre-built Talend component.

Getting ready

Open the job jo_cook_ch05_0030_tJavaFlex.

How to do it…

  1. Open the tJavaFlex component.
  2. In the Start Code section, enter the following:
    String allNames = "";
    Integer NB_LINE = 0;
  3. In the Main Code section enter the following:
    allNames = allNames + row1.name + "|";
    NB_LINE += 1;
  4. In the End Code section, enter the following:
    globalMap.put("allNames", allNames); globalMap.put("tJavaFlex_1_NB_LINE", ...

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.