Scenario 2: Waiting for a file to be created and continuing the iteration loop after a message is triggered - 6.3

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

Based on the previous scenario, this scenario describes a Job triggers a message on the console when a text file is created in the directory being scanned, without ending the scanning process immediately. The Job continues scanning the directory until the number of iterations reaches the defined maximum value.

  1. Double-click tWaitForFile to open its Basic settings view.

  2. In the Time (in seconds) between iterations field, enter the time interval in seconds between each two iterations. In this example, it is set to 5.

  3. In the Max. number of iterations (infinite loop if empty) field, enter the maximum number of iterations. In this example, it is set to 10.

  4. From the Then drop-down list, select continue loop to continue the iteration loop after the message is triggered.

  5. Press Ctrl+S to save the Job.

  6. Press F6 to execute the Job.

  7. Create a text file continue.txt in the defined directory.

    When a text file is created, a message about file creation is displayed on the Run console. The iteration loop is ended until the number of iterations reaches ten, followed by another message showing the time the iteration loop is ended and the number of iterations executed.