Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

tSystem return value

Highlighted
Seven Stars

tSystem return value

Hi,

 

We are trying to overwrite context variable value (retrieved from config  text file) with return value of tSystem component.Following is design.

 

tSystem -> tJavaRow  -> tJava1

 

We are able to print return value of tSystem In tjavarow and able to overwrite context variable value with following code.

 

System.out.println("value 1 :----"+((String)globalMap.get("tSystem_1_OUTPUT")));

  context.pct = (String)globalMap.get("tSystem_1_OUTPUT");

 System.out.println("context value print1... : "+ context.pct);

 

 

So above two values are printing correctly .And it seems context variable value also overwritten.However when we print again same values in tJava component.We are getting NULL value for below first statement and second statement return old value (mentioned in text file)

 

System.out.println("value 2 :----"+((String)globalMap.get("tSystem_1_OUTPUT"))); 

System.out.println("context value print1... : "+ context.pct);

 

Why context variable value is showing old value after changing in tjavarow component?

 

 

 

 

 

 

 

 


Accepted Solutions
Highlighted
Seven Stars

Re: tSystem return value

All components are connected as row(main).As mentioned there are only three components

 

tsystem - > tjavarow  -> tjava.

 

We cannot provide screenshot.please assist asap.

 

 

 

View solution in original post


All Replies
Highlighted
Employee

Re: tSystem return value

Hi,

Could you please advise whether you are using On SubJob Ok or On Component Ok for linking the components? Could you please share the screen shot of the job?

Warm Regards,

Nikhil Thampi
Highlighted
Seven Stars

Re: tSystem return value

All components are connected as row(main).As mentioned there are only three components

 

tsystem - > tjavarow  -> tjava.

 

We cannot provide screenshot.please assist asap.

 

 

 

View solution in original post

Highlighted
Seven Stars

Re: tSystem return value

You can close this ... after changing component link from "row(main)" to "on component Ok" .it worked.

 

Thanks

 

Regards,

Vivek

Highlighted
Employee

Re: tSystem return value

Hi,

 

    I would recommend to use On SubJob Ok compared to On Component Ok as it will make sure that the flow is always linear without any surprises.

 

Warm Regards,

 

Nikhil Thampi

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