
|
Component family |
Orchestration |
|
|
Function |
tLoop iterates on a task |
|
|
Purpose |
tLoop allows you to execute a |
|
|
Basic settings |
Loop Type |
Select a type of loop to be carried out: either For or While.
For: The task or Job is carried out
While: The task or Job is carried |
|
For |
From |
Type in the first instance number which the loop should start |
|
|
To |
Type in the last instance number which the loop should finish |
|
|
Step |
Type in the step the loop should be incremented of. A step of 2 |
|
Values are increasing |
Select this check box to only allow an increasing sequence. |
|
|
While |
Declaration |
Type in an expression initiating the loop. |
|
|
Condition |
Type in the condition that should be met for the loop to |
|
Iteration |
Type in the expression showing the operation to be performed at |
|
|
Usage |
tLoop is to be used as a start |
|
|
Global Variables |
ERROR_MESSAGE: the error message generated by the CURRENT_VALUE: the current value. Only available for a CURRENT_ITERATION: the sequence number of the current A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see Talend Studio |
|
|
Connections |
Outgoing links (from this component to another): Row: Iterate.
Trigger: On Subjob Ok; On Subjob Incoming links (from one component to this one): Row: Iterate;
Trigger: On Subjob Ok; On Subjob For further information regarding connections, see |
|
|
Log4j |
The activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html. |
|
|
Limitation |
n/a |
|
This scenario describes a Job composed of a parent Job and a child Job. The parent Job
implements a loop which executes a child Job five times, with a pause of three seconds
between each two executions.
-
Create a Parent Job, and drop tLoop, tRunJob, and tSleep components to the workspace.
-
Connect tLoop to tRunJob using a Row > Iterate connection, and connect tRunJob to tSleep using a
Row > Main
connection.
-
Create a Child Job, and drop tRowGenerator and tLogRow
components to the workspace. -
Connect tRowGenerator to tLogRow using a Row
> Main connection.
-
On the Basic settings view of the tLoop component, choose For loop type and type in the instance number to start from
(1), to finish with (5) and the
step (1).
-
On the Basic settings view of the tRunJob component, select Child
Job in the Job field.
-
On the Basic settings view of the tSleep component, enter 3 in the
Pause field. -
Double-click tRowGenerator to open the schema
editor. Then click the plus button to add four new columns:-
id, to generate sequence numbers
-
firstname, to generate random first names
-
lastname, to generate random last names
-
city, to generate random city names
For more information about tRowGenerator, see
tRowGenerator.
-
-
Press F6 to run the
Parent Job.The Child Job will be executed five times with a
three-second pause between each two executions, displaying random personal
information on the Run console as configured in
the tRowGenerator component.