Run if Conditions

One Star

Run if Conditions

I have a question how to program next line, or how to use multiple if statements, nested if possible
For example:
if (ParameterName = "PARAMETERNAME") AND (ParameterName = "SECONDPARAMETERNAME") AND (ParameterValue of "SECONDPARAMETERNAME" = 10) or (ParameterValue of "SECONDPARAMETERNAME" = 11)
then how do i need to create a Condition check here ?
Or better asked, how do you need to define an 'AND' or an 'OR' condition here ? is this by using the && or || here ? or does this goes different.
And is it possible to create nested if Conditions here ????
Thanks in advance
One Star

Re: Run if Conditions

in talend you have to write expression like this.
ParameterName.equals("PARAMETERNAME") && (ParameterName.equals("SECONDPARAMETERNAME") &&(ParameterValue ."SECONDPARAMETERNAME" = 10) ||(ParameterValue."SECONDPARAMETERNAME" = 11)?true:false
for nested
ParameterName.equals("PARAMETERNAME") ?(ParameterName.equals("SECONDPARAMETERNAME") ?true:false:false
hope it helps you

Re: Run if Conditions

Let me describe my situation, then it probably becomes more clear
I use 3 components
a Database (firebird) containing parameters and corresponding values , that are selected using this SQL Statement:
Returns a list of parameterNames and ParameterValues
tContextLoad component, in where i have defined an schema OfLoadParameters, with 2 fields called ParameterName and ParameterValue. On the LoadParameters (Output) side there are 4 fields, called ParameterName, ParameterValue and the 2 default values called key and value
tRunJob Component that should be started when the run if value ParameterName = PARAMETERNAME and ParameterValue = PARAMETERVALUE
PARAMETERNAME and PARAMETERVALUE both are string types.
What is now the exact code definition that i need to enter when i want to start this particular job under above mentioned condition.
For me it is not clear how this run if is created and when you should use the GlobalMap thing or when i should created a different code statement.
Perhaps it is a good idea to create an Component for Run if as well, where you visual can enter the condition.
One Star

Re: Run if Conditions

It will better if you give a screenshot anyhow
You can try by giving like
in the if you can check context.ParameterName.equals(<data from the Database input>)
hope this clarifies you

Re: Run if Conditions

Hi mr Lawrence,
Do you mind if i send the example to your email adres directly, because i the screenshot pictures are not uploaded when i press Submit, but deleted.
If you don't mind, can you please send me your email adres then ?
One Star

Re: Run if Conditions

It will be better, if you are able to upload the screenshot in forum as there will me more people who can help you.
to upload the screenshots, there are some specific rules like resolution

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Definitive Guide to Data Quality

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



Introduction to Talend Open Studio for Data Integration.


Downloads and Trials

Test drive Talend's enterprise products.