run if

Four Stars

run if

hi, 

i have this job Capture.PNGand i have this resultCapture1.PNG

 

 

and i want to send mail if he see "A" in the last column, but here he just takes the last line in the last column ( it's "B") and the answerof the run if is "B".

Thanks for your answer Smiley Very Happy

Highlighted
Sixteen Stars

Re: run if

 
Sixteen Stars

Re: run if

Use a tFlowToIterate after the tLogRow. Then connect that to a tJava using an iterate link. After the tJava, use your RunIf. The RunIf logic should be based on a globalMap value. This is because the tFlowToIterate component will convert your data row to globalMap values. The key to each column will be the row name feeding into the globalMap and the column name. So, if your column is a String and is called "MyValue" and your row is called "row3", your globalMap value will be accessed like below....

 

((String)globalMap.get("row3.MyValue"))

Your previous method did not work as the RunIf fires after the component has finished. By adding the tFlowToIterate, it means the subsequent components both start and end with each iteration. This means your RunIf will be tested for every row.

Four Stars

Re: run if

@rhall_2_0  we use that in tJava?

((String)globalMap.get("row3.MyValue"))

 

 

Sixteen Stars

Re: run if

No, the tJava should be left empty. The globalMap code I gave you simply shows you how to access the column value for your RunIf logic.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.