Sunday, November 15, 2015

What is the best component to use for Foreach loop and While loop in Talend - tFlowToIterate and tIterateToFlow

Based on experience, I would recommend tFlowToIterate and tIterateToFlow are the best component to use for Foreach and While loop.
tFlowToIterate
https://help.talend.com/images/54/bk-components-rg-542/tFlowToIterate_icon32_white.png This component is used to read data line by line from the input flow and store the data entries in iterative global variables.
In this above Job, set of records come from MSSQL database via query, you need to do three things for each and every row. You can use “row13.column1”,”row13.column2”,etc in tHttpRequest_1, tJava_2 and tHttpRequest_2.
Also another advantage of using this component, we can use many link to iterate these iterates are run in order. In here iterete2 (order:1) run first, because (order:1) then order:2, Order:3, etc. This feature is help for many ETL process.

tIterateToFlow
https://help.talend.com/download/attachments/8123220/tIterateToFlowOut_icon32_white.png?version=1&modificationDate=1355333600000&api=v2 Allows you to transform non processable data into a processable flow.
https://help.talend.com/download/attachments/8123220/Use_Case_tIterateToFlow1.png?version=1&modificationDate=1355333601000&api=v2
Mapping table:
https://help.talend.com/download/attachments/8123220/Use_Case_tIterateToFlow4.png?version=1&modificationDate=1355333604000&api=v2
Output will be:

Cheers!
Uma

No comments:

Post a Comment