Configuring the Job for catching the message triggered by the tDie component - 7.3

Logs and errors (Integration)

Version
7.3
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Data Governance > Third-party systems > Logs and errors components (Integration)
Data Quality and Preparation > Third-party systems > Logs and errors components (Integration)
Design and Development > Third-party systems > Logs and errors components (Integration)
Last publication date
2024-02-21
Configure the components used in the Job that catches the message triggered by the tDie component and then displays the message on the console.

Procedure

  1. Double-click the tRowGenerator component to open its row generator editor.
  2. Define the schema by adding one column id of Integer type, and select the predefined function Numeric.sequence(String,int,int) in the Functions column.
  3. Enter the number of rows to be generated in the Number of Rows for RowGenerator field, 0 in this example. When done, click OK to close the dialog box.
  4. Double-click the tFileOutputDelimited component to open its Basic settings view, and in the File Name field, specify the path to the file that will hold the data to be generated.
  5. Click the If connection, and in the Condition field on the Basic settings view, specify the condition based on which the tDie component will be triggered. In this example, it is ((Integer)globalMap.get("tRowGenerator_1_NB_LINE")) <=0, which means the tDie component will be triggered when the number of rows to be generated is less than or equal to zero.
  6. Double-click the tDie component to open its Basic settings view, and in the Die message field, enter the message to be triggered before the Job is killed. In this example, it is no row generated.
  7. Double-click the tJava component to open its Basic settings view, and in the Code field, enter
    System.out.println("The number of rows generated is " + ((Integer)globalMap.get("tRowGenerator_1_NB_LINE")) + ". #This message will not be displayed if no row is generated.");
    Note that this message will be displayed only when the number of rows generated is greater than zero. In this example, the number of rows to be generated is 0, so the Job will be killed and this message will not be displayed.
  8. Double-click the tLogCatcher component to open its Basic settings view and select the Catch tDie check box to catch the message triggered by the tDie component.
  9. Double-click the tLogRow component to open its Basic settings view, and then select Table (print values in cells of a table) in the Mode area for better readability of the result.