Skip to main content

I'm sure this is really basic but I'm stumped. How do I take some sort of action based on the number of features emitted by a previous transformer?

 

In this particular instance I need to abort the final write (and send an email) if the number of features are less than 2000. I have a Counter, and can see the number of features. I have a Tester, but it appears to be testing each feature instead of the total count.

 

Counter and Testertester equation: _count > 2000 

 

Hi @mattw1ilkie​ ,

There are a few ways I can think of to do this: a FeatureCounter or a StatisticsCalculator (select an attribute and just get the total count).

Then you can use a Tester to test the attribute that is created that will hold the total number of features coming through.

(Then a Terminator transformer for the Failed port of the Tester - if you are looking to end the workspace if anything comes out of the Failed port)

Hope this helps!

Andrea


In my scenario Aggregator turned out to be the better transformer to use. When I used FeatureCounter an email was sent for every single record in the incoming stream!

 

image


Reply