About run if trigger.

One Star

About run if trigger.

I use tRest to call web,and return data, tRest returns schema include Body and ERROR_CODE, if ERROR_CODE if null,means the call is OK.
So I use run if trigger to connect tRest and tjava, condition is : tRest.ERROR_CODE!=null . Talend return error:tRest cannot be resolved to a variable.
So how do i write this condition? I am a bit confused with the way to get value in talend, and can't find it in the document.

Community Manager

Re: About run if trigger.

Hi 
Link tRest to a tJavaRow and check the if ERROR_CODE is null there, eg:
tRest--main--tJavaRow--runIf--tJava
on tJavaRow:
if(input_row.ERROR_CODE!=null){
globalMap.put("hasError", true);
}else{
globalMap.put("hasError", false);
}
Set the condition as:
(Boolean)globalMap.get("hasError")

Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

2019 GARTNER 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

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