Run If, update and commit in the same iteration

Four Stars

Run If, update and commit in the same iteration

Hello,
I'm kind of new with Talend. And I have a problem with an update and a commit inside an iteration.
Here's my diagram

As you can see I have a tOracleInput to start the iteration, and after a tJavaRow, tOracleRow and a tJavaRow. Here the subjob ends. If the Run If is true after tJavaRow_3 I make an update and a commit, and I need to do this for every iteration of the tOracleInput. But it seems that the update and the commit are done after all the iterations ended, i mean, they're executed only for the last row of the iteration.
Can anyone help me please.

Re: Run If, update and commit in the same iteration

looks like your images are missing. if you can upload the images Im sure we can assist
Four Stars

Re: Run If, update and commit in the same iteration

Thank you JohnGarrettMartin for your answer, 
I uploaded them.
I don't know what happened.

Done it. Yeah!!!

Re: Run If, update and commit in the same iteration

"if" links are evaluated during the END section of a component -- so they are not checked per-row as you expect in the job. 
a simple fix for this is to insert a tFlowToIterate component between your initial select and tJavaRow_2. Then you would connect this to the rest of the job using the "iterate" link. 
tFlowToIterate puts the row values in the globalMap for each iteration-- by default it uses the pattern for the globalMap keys: <row name>.<columnName> so an example call would look like:
context.curr_row_value = (String)globalMap.get("row9.columnName");
Four Stars

Re: Run If, update and commit in the same iteration

"if" links are evaluated during the END section of a component -- so they are not checked per-row as you expect in the job. 
a simple fix for this is to insert a tFlowToIterate component between your initial select and tJavaRow_2. Then you would connect this to the rest of the job using the "iterate" link. 
tFlowToIterate puts the row values in the globalMap for each iteration-- by default it uses the pattern for the globalMap keys: <row name>.<columnName> so an example call would look like:
context.curr_row_value = (String)globalMap.get("row9.columnName");


Thank you JohnGarrettMartin!!!!
It works perfectly.
Thank you.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog