tForeach
tForeach Standard properties
These properties are used to configure tForeach running in the Standard Job framework.
The Standard
tForeach component belongs to the Orchestration family.
The component in this framework is available in all Talend
products.
Basic settings
Values |
Use the [+] button to add rows to |
Advanced settings
tStatCatcher Statistics |
Select this check box to collect the log data at a component |
Global Variables
Global Variables |
ERROR_MESSAGE: the error message generated by the
CURRENT_VALUE: the value currently iterated upon. This is 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 |
Usage
Usage rule |
tForeach is an input component |
Iterating on a list and retrieving the values
This scenario describes a two component Job in which a list is created and iterated upon in a
tForeach component. The values are then retrieved
in a tJava component.
Setting up the Job
- Drop a tForeach and a tJava component onto the design workspace.
-
Link tForeach to tJava using a Row >
Iterate connection.

Configuring the components
-
Double-click tForeach to open its
Basic settings view: -
Click the [+] button to add as many rows
to the Values list as required. -
Click on the Value fields to enter the
list values, between double quotation marks. -
Double-click tJava to open its
Basic settings view: -
Enter the following Java code in the Code area:
System.out.println(globalMap.get("tForeach_1_CURRENT_VALUE")+"_out");
Saving and executing the Job
-
Press Ctrl+S to save
your Job. -
Press F6 to execute the
Job.
The tJava run view displays the list values
retrieved from tForeach, each one suffixed
with _out:
