Run If Conditional Query

Five Stars

Run If Conditional Query

Hi,
I'm not able to find the answer in the documentation so i was hoping someone might be able to help me understand something.

I have a job which passes data into a child job through an iteration, the child job then passes back data which collects into a tHashOutput to be loaded in another subjob which contains the tHashInput.

I was getting errors when the first part of the process didn't extract any data (a common scenario in this routine) and so i linked the subjob with the tHashInput with a RunIF connection (using a ((Integer)globalMap.get("'my_connection'_NB_LINE")) >0 clause).
However, on doing this i started getting null pointer exceptions on the tHashOutput, so i'm not sure this is a viable way of performing this logic?

Basically, I want to know if there is a way of executing a subjob ONLY IF there is data populated in the hashInput, and i want to execute this subjob after all iterations in the first subjob have completed.

A simple mock up of my routine:

Subjob1)

FixedFlowInput --> FlowToIterate --> ChildJob --> tHashOutput

Subjob2)

tHashInput --> Load to a database.

Please help! Thanks Smiley Happy

One Star

Re: Run If Conditional Query

Hi,
It should work as it. If no row in tHashInput, nothing goes to the next step, and that's all.
Can you capture the job and share it?
Regards,
TRF
Five Stars

Re: Run If Conditional Query


I've attached a screenshot of the job - as you can see it is a little more complicated than my sample.

Basically - i just want the the brown subjob "Input Mambu Client ID into nCino" to only run when there is data placed in tHashOutput1. I'd tried connecting the brown subjob via a runIf as mentioned previously, but this didn't work.

(RunIF condition was ((Integer)globalMap.get("'Out3_NB_LINE")) >0
Nine Stars JR
Nine Stars

Re: Run If Conditional Query

The quick and dirty way would be to connect your OnSubjobOK coming out of "Create Client" to a dummy tJava component that does nothing (just leave the default in it) and then create a "Run If" connection from there to your "Input Mambu..." subjob with the condition you mention above. Please let us know if this works for you.
Five Stars

Re: Run If Conditional Query

Hey,
Thanks - i don't mind a dirty option! That certainly works for me - thanks for your help!

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog