Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

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
Labels (3)
9 Replies
Anonymous
Not applicable

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
_AnonymousUser
Specialist III
Specialist III
Author

Hi Shong,
Thank you very much for your reply.
I "redid" my jobs from scratch and it worked... 0683p000009MPcz.png
Sorry for the inconvenience and thank you very much for your support.
You guys rock! (and Talend too 0683p000009MACn.png
Regards
Gilles
Anonymous
Not applicable

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 0683p000009MAB6.png
(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)
Anonymous
Not applicable

Pleaaase help !!!!!!!!!!!!!!!!!!
Anonymous
Not applicable

hi
thanks to reload image with drag&drop utility 0683p000009MACn.png
0683p000009MBPZ.png
regards
laurent
Anonymous
Not applicable

testtest
Anonymous
Not applicable

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
Anonymous
Not applicable

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
Anonymous
Not applicable

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