One Star

[resolved] Run child jobs conditionally and unite the buffered results afterwards

Hi all,
I have three jobs:
- FatherJob
- ChildJob1
- ChildJob2
Both ChildJobs use a tBufferOutput to push their results back to the FatherJob, using a generic schema.
What I would like: in the start of the FatherJob, I would like to run one of the child jobs (based on a condition). The second part of the job is generic and have the generic schema of the tBufferOutput in the ChildJobs as input schema.
This is illustrated by the attached image. However, in this set-up of the job, this is not possible (see the image for the error message).
Any suggestions how to accomplish this (I'm using TOS, so unfortunately I can't use joblets)?
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] Run child jobs conditionally and unite the buffered results afterwards

In the meantime I had already tried the exact same set-up as rretzbach suggests, and that is working perfectly! Great, thanks.
(BTW due to security requirements I'm not allowed to store the temp results in a file, only in-memory is allowed. The tBufferOutput/Input-combinations work perfectly fine.
3 REPLIES
Moderator

Re: [resolved] Run child jobs conditionally and unite the buffered results afterwards

Hi,
In deed, there is a circle which is not allowed by talend.
Here is a KB article about TalendHelpCenter:Can I create a Job with multiple paths from a single source to the same target?, is it useful for your case.
Talend joblet designs is only available in Talend Enterprise Subscription Version.
Best regards
Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Run child jobs conditionally and unite the buffered results afterwards

Hi,
as far as I know the way "merge" connections work is that the merge order 1 flow starts the process and "fetches" all other merge connections afterwards. So the reason for the error message you see is that tRunJob_1 starts and tries to "fetch" tRunJob_2, but it can't because it has an unexpected "if condition".
You could store your intermediate subjob results in a buffer or in a file though, please see my screenshot:
One Star

Re: [resolved] Run child jobs conditionally and unite the buffered results afterwards

In the meantime I had already tried the exact same set-up as rretzbach suggests, and that is working perfectly! Great, thanks.
(BTW due to security requirements I'm not allowed to store the temp results in a file, only in-memory is allowed. The tBufferOutput/Input-combinations work perfectly fine.