How to share variables between two different Jobs

One Star

How to share variables between two different Jobs

Hi all,
I need to pass values between two dependent Job
The job "A" has a tRunJob to launch a job "B".
Thus, A is the father of B.
How I can use variables (not necessarily using context) and pass them between A and B ? I mean that I need to modify and read variables by both jobs, just as global variables.
I tried using the context variables, but, whenever I can pass a value (on the context) from A to B, I am not able to do the opposite..
So, I bet there would be some other solutions.
Thanks
Community Manager

Re: How to share variables between two different Jobs

Hi
Which version of TOS did you use? I can pass the value from father job to chird job with TOS2.2.2.
Also, you can define the global variable for all the jobs in Contexts in Resipotory viewer.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Employee

Re: How to share variables between two different Jobs

As far as I understand your problem, solution is to use a tContextLoad after the tRunJob and in the child job, update somewhere (file, database) the value for the given context variable.
One Star

Re: How to share variables between two different Jobs

hi, I'm using global contexts for my jobs.
but when i export the jobs each jobs has their own context files.
How I can configure so that all jobs share the same context file?
because when i want to change some values in context, I'll have to change in every job's context now.
I want to change only context and it should set.
any suggestions??
Thank You.
Six Stars

Re: How to share variables between two different Jobs

1. create a context file of schema key,value as a csv file.
2. goto project settings > implicit context load > select context file made
3. job settings > define context variables in your job which are there in file or DB.
4. now you can get the same value for each job
Regards,
Jugal