Page 1 of 1

Is it possible to check existence of data in data flow?

Posted: Mon Mar 08, 2010 9:45 am
by avackova
Is it possible to check the non-existence of data? For example, I might want to raise an error if no data is received in a flow.

Re: Is it possible to check existence of data in data flow?

Posted: Mon Mar 08, 2010 9:49 am
by avackova
You can check number of processed records in all components with transformation, you write by yourself - in finished() method. If your counter is still on initial
value you can just raise an error (raise_error function in ctl), eg. put a Reformat between other components:

Code: Select all

//#TL
int counter = 0;
// Transforms input record into output record.
function transform() {
   counter++;
   $0.* := $0.*;
}

// Called after the component finishes.
function finished() {
   if (counter == 0) raise_error("Input flow is empty");
}