Need help on tjavarow , tjava connection using runif

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

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now