One Star

Passing context parameters in a tRunJob

Hi,
I'm using TOS 2.2.1.
I have a Master job and a Slave job.
I'm trying to use a tRunJob to call the slave job from the master job, but I also want to pass a context param from the master to the slave.
I have created a context param in my slave job.
In the tRunJob properties tab, when I choose my slave job, I can see the context param declared.
In the value field for this parameter, I set the value passed ("90"), but in the slave job, I have a tJavaFlex job that prints out the parameters either in the param Properties object or in the param_context Properties object and it does not show the "90" value.
Looking at the code, it seems that the master job calls the slave job with a "--context_param" parameter and it appends the values entered in the Properties tab.
BUT, it seems that it not passing the parameter key to the slave job and even if I manually put "KEY=VALUE" in the value field, I can not get it in the slave job.
Anyone has managed to pass parameters from one job to another ?
Thanks a lot in advance!
Regards
Gilles
9 REPLIES
Community Manager

Re: Passing context parameters in a tRunJob

Hi
I created a simple job as your said, I created a context param in slave job without any value, then call this job in master job using the tRunjob component, I set the context param value in the properties panel of tRunjob component. Finally, I run master job and get the value.
I wonder if I create the right job as you do, if not, please upload some screenshots of your job.
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Passing context parameters in a tRunJob

Hi Shong,
Thank you very much for your reply.
I "redid" my jobs from scratch and it worked... Smiley Sad
Sorry for the inconvenience and thank you very much for your support.
You guys rock! (and Talend too Smiley Happy
Regards
Gilles
One Star

Re: Passing context parameters in a tRunJob

This is a tFlowIterate and a tRunJob to take for each value ( an ID) the concerned data from the database through de tRunJob. The problem is that i stock this ID in a context variable, but it always take only one value, and does not take the second value even if i use iterate, please help me i m a newbie in Talend Smiley Tongue
(I don't know why i cannot insert a screenshot of my job can anybody tell me how i can do it ? it 's always show the source code of the image and not the image itself :s)
One Star

Re: Passing context parameters in a tRunJob

Pleaaase help !!!!!!!!!!!!!!!!!!
Seventeen Stars

Re: Passing context parameters in a tRunJob

hi
thanks to reload image with drag&drop utility Smiley Happy

regards
laurent
One Star

Re: Passing context parameters in a tRunJob

testtest
One Star

Re: Passing context parameters in a tRunJob

Thank you very much i don't know why it doesn't work this is the link for my job : https://www.talendforge.org/forum/img/members/288490/job.png
Community Manager

Re: Passing context parameters in a tRunJob

Hi 
You are using tFlowToIterate to iterate each rows from database, it has stored the current value of each column to a global variable for used later, you don't need a tSetGlobalVar component or to store the value to context variable any more. The job can be redesigned to:
tMssqlInput--main(row1)--tFlowToIterate--iterate-->tRunjob
You can access the current value of a column such as ID column with this expression:
(Integer)globalMap.get("row1.ID")  

Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Passing context parameters in a tRunJob

Hi
Yes you are right !! I did it and it works but the problem is that whan i store the value of my ID it does not retrieve data from the tRunJob for each ID and this is for me the big problem !! Please have you any idea about this ?
Best Regards
Ghalia