One Star

Call 2 subjobs with different context parameters?

Hi
I have a tricky problem and hopefully there's a solution to it.
I've created a couple of jobs which basically all do the same but the time period for which KPIs are calculated is different.
In order to distinguish between different time periods and logics jobs are called by using context parameters (and passed to children) in AMC.
Everything works fine as long as only one job with one context is called.
Now I would like to call the job for "weekly" numbers and the job for "month to date" numbers at the same time, from one job.
In AMC i can pass only one context, so this doesn't seem to be a solution.
In the job itself i can select the appropriate context for the child job. But the child's child job (and so on) won't get the defined context of its father by default.
Unfortunately I cannot define the context down to the deepest levels as the jobs are all the same.
Let me try to visualize my issue:
father job (context weekly AND month to date)
|
|-- tRunJob1 (context weekly)
|--tRunJob11* (context weekly)
|--tRunJob111* (context weekly)
|
|-- tRunJob2 (context month to date)
|--tRunJob21* (context weekly)
|--tRunJob211* (context weekly)

* tRunJob21 = tRunJob11; tRunJob211= tRunJob111
Any idea how to solve this?
Thanks, Reiko
6 REPLIES
One Star

Re: Call 2 subjobs with different context parameters?

Hi Reiko
Please show me all 'Context Param' of tRunJob components.
In fact, you can pass multi contexts down to your child jobs.
Or i misunderstand what you mean?
Best regards!
Pedro
One Star

Re: Call 2 subjobs with different context parameters?

Hi Pedro,
sorry for the delay.
Please have a look at the attached picture. I think my question wasn't right asked.
I do know that i can have child jobs with different parameters within on father job.
But if i set those parameters within tRunJob they won't be inherited down to all childred below! Instead I would have to set the parameters at every level of children again - which is not possible since each child job calls the same subjobs (remember that jobs are controlled by parameters only to manage different time periods).
What I want to accomplish is one father job which calls 2 child jobs (which are the same talend jobs) but with different parameters. Because the child job itself calls another child jobs (and so on) the parameters (set at the highest level = father job) need to be available at every level.
Can such be done with Talend?
Thanks,
Reiko
One Star

Re: Call 2 subjobs with different context parameters?

Hi
Smiley Wink I catch your point this time.
I'm afraid you have to duplicate the job.
Because it's impossible to use the same job with different conditions and contexts.
Regards
Pedro
One Star

Re: Call 2 subjobs with different context parameters?

Thanks Pedro!
Maybe this could be a feature in the future: "Apply context to children" functionality within tRunJob.
Cheers,
Reiko
One Star mpa
One Star

Re: Call 2 subjobs with different context parameters?

It's possible to pass context parameters to your child jobs. Basic settings of a tRunjob component and add the context parameters to be passed.
So i'm guessing you can do something as: tRunjob --> tJava (to change the values of the context variables) --> tRunjob (pass the same context variables but they contain other values now)
Hope I understood what was needed.
Kind regards
One Star

Re: Call 2 subjobs with different context parameters?

Hi mpa
In fact, i still feel confused about his essential request.
According to his first post, I think he wants to pass context between two child jobs at the same level.
Regards,
Pedro