One Star

Executing control flow in Talend open studio

Hi All,


I need a help. I'm executing a delivery job email execution in talend job, where there is an input query in toracleinput. If the condition of the component is satisfied I would want to send a mail mentioning job is successful and if the condition is not met, I would want to send another tsendmail with job failure message (just like an if condition). 


Could you suggest how to implement this logic in talend


Many thanks for your help




Re: Executing control flow in Talend open studio


What does your condition look like? Have you tried to use trigger "OnsubjobOK" and "OnsubjobError" to see if it works?

Elaborating your case with an example will be preferred.

Best regards


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

Re: Executing control flow in Talend open studio

There are a couple ways to do this, the OnSubjobOk or OnSubjobError is one way that is dependent on the component failing or being successful.  Many time the components or subjob will not fail so you won't get the email.  


Another way is to build the logic into a tMap to look for a condition so that if a field is null them fail and send to an tSendMail like below.


Another way would be to use the Trigger "Run if" between components so that looks like this




There is a third way and using a combination of tDie, tLogCatcher and the RunIf which I showed in a live Facebook session that I believe is posted on the community site but it looks like this below. Use tDie components to check for the condition you want from Oracle, again it may need a tMap to check, not sure what your condition is, but use the tDie to flag the issue and where, then use the PostJob to run after everything is complete to check for errors.  In this example I use a tJavarow to set the output of the tLogCatcher to a context variable that I then can use in the Run If condition.



Hope this was helpful.

One Star

Re: Executing control flow in Talend open studio

Thanks . That was helpful