[resolved] stop talend job if zero (0) rows input

One Star

[resolved] stop talend job if zero (0) rows input

HI,
My job looks similar to the below:
tfileinputdelimited --(main)--> tmap --(main)--> staging_tbl (subjob1)
| \ ^
| (subjobok) \ (reject) | (lookup)
| \ dim1
| tfileout
v
staging_tbl--(main)--> tmap --(main)--> dim2 (subjob2)
| ^
| (subjobok) | (lookup)
| dim2
v
staging_tbl--(main)--> tmap --(main)--> dim3 (subjob3)
| ^
| (subjobok) | (lookup)
| dim3
v
other subjobs
:
:
some cases all my records in tfileinputdelimited are rejected to tfileout hence 0 rows loaded into staging_tbl.
Now I don't want to proceed beyond subjob1 (i.e. subjob2, subjob3, ... ).
Is there any way I can stop execution if 0 rows loaded into my staging_tbl.
Thank you.

Accepted Solutions
One Star

Re: [resolved] stop talend job if zero (0) rows input

Hi
You might create a subjob between subjob1 and subjob2.
tJava--Run-if-->tDie
Let's say staging_tbl is using tMysqlOutput.
The run-if condition is ((Integer)globalMap.get("tMysqlOutput_1_NB_LINE"))==0.
Regards,
Pedro

All Replies
One Star

Re: [resolved] stop talend job if zero (0) rows input

Hi
You might create a subjob between subjob1 and subjob2.
tJava--Run-if-->tDie
Let's say staging_tbl is using tMysqlOutput.
The run-if condition is ((Integer)globalMap.get("tMysqlOutput_1_NB_LINE"))==0.
Regards,
Pedro
One Star

Re: [resolved] stop talend job if zero (0) rows input

Thank you Pedro. This is resolved.