One Star

Need help on tjavarow , tjava connection using runif

Hi,
I have a scenario in which after process some vale using tjavarow need to call some another function/code/component based on condition.
I am using run if , but failed to achieve it.

Regards,
Anup
8 REPLIES
Community Manager

Re: Need help on tjavarow , tjava connection using runif

Hi
Some screenshots of job will be helpful for us understanding your problem well.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Need help on tjavarow , tjava connection using runif

please check the sample image.
Community Manager

Re: Need help on tjavarow , tjava connection using runif

Hi
What's the condition expression you set now? Please describe more information what you want to do.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Need help on tjavarow , tjava connection using runif

My Table contain application_id. Based on that it I want to use some componet. The component may be tJava / tJavarow / tRunJob
One Star

Re: Need help on tjavarow , tjava connection using runif

Hi,
What don't you just put your condition in your tJava row???
If(){
....
} else if (){
}
...
Employee

Re: Need help on tjavarow , tjava connection using runif

You can use a context var inside your tjavarow like this :
context.myvar = input_row. (in your case : application.id if I understand)

On your "if" link you can use the context var to test your choice :
"myapplication1".equals(context.myvar)
One Star

Re: Need help on tjavarow , tjava connection using runif

Thanx for the suggestion .
I have try out .. its working ..but facing new problem .
i have connect tJavarow with tjava using if .
It give result for last record only
Community Manager

Re: Need help on tjavarow , tjava connection using runif

Hi
The runif trigger is fired after the tJavaRow works, that's why you only get the last record. In this case, you need to iterate each row, for example:
....tMap--out1---tFlowToiteate--iterate---tFixedFlowInput--main--tJavaRow---runIf---tJava_2
on tFixedFlowInput, generate each row of out1, for example, add two columns on the schema:
key:value
idSmiley SadInteger)globalMap.get("out1.id") //assuming the data type of id column is integer/int type.
nameSmiley SadString)globalMap.get("out1.name") //assuming the data type of name column is String type.
on tJavaRow: do as Xavier MOUCHOT mentioned.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business