Trigger RunIf Condition giving False

Four Stars

Trigger RunIf Condition giving False

Hi All
I am using Run if Trigger in talend with the below condition
(String)globalMap.get("row3.STATUS")=="ACTIVE"

Value getting passed is ACTIVE but the trigger is failing and giving status as false instead of TRUE.
Please advice.
Thanks

Re: Trigger RunIf Condition giving False

Hi tanveer,

Please use below condition:

((String)globalMap.get("row3.STATUS")).equals("ACTIVE")

Let me know if it works.

Best Regards,
Amol Smiley Happy
Ten Stars

Re: Trigger RunIf Condition giving False

This will work and the reason is that in Java the "==" operator checks to see whether the objects are the same (ie pointing to the same location in memory). What you wanted to do is check the value held by the object. It is like checking two boxes both containing the word "ACTIVE". "==" checks to see if the boxes are the same. ".equals()" checks to see if the contents of the boxes are the same.

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