set context parameters dynamically in tJava

One Star

set context parameters dynamically in tJava

Is this possible. I tried a sample job and it din happen happen.
One Star

Re: set context parameters dynamically in tJava

I am able to pass context parameters set dynamically in a jave file from one job to another subjob. But this is not working when i pass it to a sub-sub job......... Any other way out?
One Star

Re: set context parameters dynamically in tJava

Any inputs please ?
One Star

Re: set context parameters dynamically in tJava

You can set contexts via tjava using the following example:
context.myContext = "myValue"
to pass it to a subjob you can use tRunJob component with the Transmit Whole Context option or the individual context paramaters options.
Hope this is what you're looking for.
One Star

Re: set context parameters dynamically in tJava

i am doing this ....... but this works only for a subjob .......... if i want to pass it on to further subjobs , it does not work!!! Smiley Sad
One Star

Re: set context parameters dynamically in tJava

i tried using tContextDump also .... but it only works for pre configured context parameters ... for a context variable being set dynamically in tJava , it does not work !! any workarounds here ?
Community Manager

Re: set context parameters dynamically in tJava

Hello
Please upload some screenshots of your job.
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Seven Stars

Re: set context parameters dynamically in tJava

I can't any more find where I came up with this answer but apparently context values are stored in more than one place and tContextDump picks up only those values defined when the job begins so if you set context values dynamically using tJava you need to follow with the following statement so that tContextDump will use the new values:
context.synchronizeContext();