Skip to main content Skip to complementary content
Close announcements banner

Configuring a Job using a tJavaFlex component

The tJavaFlex component is used to inject code at the start/end of a Job and to transform data transformations for each row.

A common Job using tJavaFlex is generally composed of:

  • a tFileInputDelimited component to read data from a text file,
  • a tJavaFlex to inject specific code at various moment of the Job processing (start, main or end parts),
  • a tLogRow component to print data in the console and processing information based on what the code injection says in the start and/or end part of tJavaFlex.

Procedure

  1. In the Palette, slide a tFileInputDelimited , a tJavaFlex and a tLogRow component onto the workspace.
  2. Connect tFileInputDelimited to tJavaRow and tJavaRow to tLogRow using a Row > Main link.
  3. Set the Basic settings of the tFileInputDelimited component.
  4. 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 and tJavaRow example .
  5. When prompted, click OK to accept the propagation or click afterward on the Sync columns button in the tJavaRow Basic settings view.
  6. Double-click on tJavaRow to display its Basic settings view. Add the following code in the Start code area:
    System.out.println("******The subJob begins to work!******");
    int nb_line=0
  7. Add the following code in the Main code area:
    row2.name=(row1.name).toUpperCase();
    nb_line++;
  8. Add the following code in the End code area:
    System.out.println("The total number of processed data is: "+nb_line);
    System.out.println("******The subJob finishes!******");
    Information noteNote: This code converts the column names to upper case.
  9. Execute the Job by pressing F6.

Results

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!