Display error if tFilterRow results == 0

Seven Stars

Display error if tFilterRow results == 0

I have a job in which I use a rowFilter based on a condition. It works. But, what I want to do more is to display an error or stop the job if the number of filtered rows is 0. How can I achieve that?

This is my job:

 

job.jpg

 

Does anyone could help me?

Thank you in advance.


Accepted Solutions
Seven Stars

Re: Display error if tFilterRow results == 0

I solved it! I linked tFilterRow > run if > tDie


@Emanuele89 wrote:

I put tSetGlobalVariable after tFilterRow_1. In Value I wrote ((integer)globalMpa.get("tFilterRow_1_NB_LINE_OK")).intValue(), but how can I stop the job if the result is 0? I need to catch it.


@TRF wrote:
Check for tFilterRow_1_NB_LINE_OK global variable after the component (change 1 to reflect the real number for your component).

 


 


All Replies
Fifteen Stars TRF
Fifteen Stars

Re: Display error if tFilterRow results == 0

Check for tFilterRow_1_NB_LINE_OK global variable after the component (change 1 to reflect the real number for your component).

TRF
Seven Stars

Re: Display error if tFilterRow results == 0

I put tSetGlobalVariable after tFilterRow_1. In Value I wrote ((integer)globalMpa.get("tFilterRow_1_NB_LINE_OK")).intValue(), but how can I stop the job if the result is 0? I need to catch it.


@TRF wrote:
Check for tFilterRow_1_NB_LINE_OK global variable after the component (change 1 to reflect the real number for your component).

 

Employee

Re: Display error if tFilterRow results == 0

hi Emanuele89,

You could use the Run if Trigger and give the condition as ((Integer)globalMap.get("tFilterRow_1_NB_LINE"))>0 condition followed by the logic you want to incorporate

2018-08-22_201854.jpg

 

Thanks,

RekhaSree

 

 

.

 

 

Seven Stars

Re: Display error if tFilterRow results == 0

I solved it! I linked tFilterRow > run if > tDie


@Emanuele89 wrote:

I put tSetGlobalVariable after tFilterRow_1. In Value I wrote ((integer)globalMpa.get("tFilterRow_1_NB_LINE_OK")).intValue(), but how can I stop the job if the result is 0? I need to catch it.


@TRF wrote:
Check for tFilterRow_1_NB_LINE_OK global variable after the component (change 1 to reflect the real number for your component).

 


 

Fifteen Stars TRF
Fifteen Stars

Re: Display error if tFilterRow results == 0

Great!
Don't forget to mark your case as solved (Kudo also accepted).

TRF

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

How to deploy Talend Jobs as Docker images to Amazon, Azure and Google Cloud reg...

Learn how to deploy Talend Jobs as Docker images to Amazon, Azure and Google Cloud registries

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

Talend API Services Publish to Talend Cloud

Learn how to publish your API Services to Talend Cloud

Watch Now