Skip to main content Skip to complementary content

Configuring the tJavaFlex component

Procedure

  1. Double-click tJavaFlex to display its Basic settings view and define its properties.
  2. Click the [...] button next to Edit schema to open the corresponding dialog box where you can define the data structure to pass to the component that follows.
  3. Click the [+] button to add two columns: key and value and then set their types to Integer and String respectively.
  4. Click OK to validate your changes and close the dialog box.
  5. In the Basic settings view of tJavaFlex, select the Data Auto Propagate check box to automatically propagate data to the component that follows.
    In this example, we do not want to do any transformation on the retrieved data.
  6. In the Start code field, enter the code to be executed in the initialization phase.
    In this example, the code indicates the initialization of tJavaFlex by displaying the START message and sets up the loop and the variables to be used afterwards in the Java code:
    System.out.println("## START\n#");
    String [] valueArray = {"Miss", "Mrs", "Mr"};
    
    for (int i=0;i<valueArray.length;i++) {
  7. In the Main code field, enter the code you want to apply on each of the data rows.
    In this example, we want to display each key with its value:
    row1.key = i;
    row1.value = valueArray[i];
    Information noteWarning:

    In the Main code field, "row1" corresponds to the name of the link that comes out of tJavaFlex. If you rename this link, you have to modify the code of this field accordingly.

  8. In the End code field, enter the code that will be executed in the closing phase.
    In this example, the brace (curly bracket) closes the loop and the code indicates the end of the execution of tJavaFlex by displaying the END message:
    }
    System.out.println("#\n## END");
  9. If needed, double-click tLogRow and in its Basic settings view, click the [...] button next to Edit schema to make sure that the schema has been correctly propagated.

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 – please let us know!