How to define connection settings - 6.3

Talend Open Studio for ESB User Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for ESB
task
Design and Development
EnrichPlatform
Talend Studio

You can display the properties of a connection by selecting it and clicking the Component view tab, or by right-clicking the connection and selecting Settings from the contextual menu. This section summarizes connection property settings.

Row connection settings

The Basic settings vertical tab of the Component view of the connection displays the schema of the data flow handled by the connection. You can change the schema by clicking the Edit schema button. For more information, see How to set a built-in schema.

The Advanced settings vertical tab lets you monitor the data flow over the connection in a Job without using a separate tFlowMeter component. The measured information will be interpreted and displayed in a monitoring tool such Talend Activity Monitoring Console (available with Talend subscription-based products).

To monitor the data over the connection, perform the following settings in the Advanced settings vertical tab:

  1. Select the Monitor this connection check box.

  2. From the Mode list, select Absolute to log the actual number of rows passes over the connection, or Relative to log the ratio (%) of the number of rows passed over this connection against a reference connection. If you select Relative, you need to select a reference connection from the Connections List list.

  3. Click the plus button to add a line in the Thresholds table and define a range of the number of rows to be logged.

For more information about flow metrics, see the documentation of the tFlowMeterCatcher component in Talend Open Studio Components Reference Guide.

Iterate connection settings

When you configure an Iterate connection, you are actually enabling parallel iterations. For further information, see How to launch parallel iterations to read data.

Trigger connection settings

Run if connection settings

In the Basic settings view of a Run if connection, you can set the condition to the subJob in Java.

You can use variables in your condition. Pressing Ctrl+Space allows you to access all global and context variables. For more information, see How to use variables in a Job.

Warning

When adding a comment after the condition, be sure to enclose it between /* and */ even if it is a single-line comment.

In the following example, a message is triggered if the input file contains 0 rows of data.

  1. Create a Job and drop three components to the design workspace: a tFileInputDelimited, a tLogRow, and a tMsgBox.

  2. Connect the components as follows:

    • Right-click the tFileInputDelimited component, select Row > Main from the contextual menu, and click the tLogRow component.

    • Right-click the tFileInputDelimited component, select Trigger > Run if from the contextual menu, and click the tMsgBox component.

  3. Configure the tFileInputDelimited component so that it reads a file that contains no data rows.

  4. Select the Run if connection between the tFileInputDelimited component and the tMsgBox component, and click the Component view. In the Condition field on the Basic settings tab, pressing Ctrl+Space to access the variable list, and select the NB_LINE variable of the tFileInputDelimited component. Edit the condition as follows:

    ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE"))==0
  5. Go to the Component view of the tMsgBox component, and enter a message, "No data is read from the file" for example, in the Message field.

  6. Save and run the Job. You should see the message you defined in the tMsgBox component.