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.