Choice VS filter

02-27-2024 08:35 PM
New Contributor III

Considering best practices and scalability, could you provide guidance on the optimal approach for handling such TRUE FALSE statement scenarios within the GeoEvent framework? I want to ensure the most efficient and maintainable configuration. Should I always choose choice when Only one of the statement is TRUE even if its 2 choices only? 

0 Kudos
1 Reply
New Contributor III

@EricIronside wrote a great article on the topic of choices vs. filters:

From that article:

"A choice element with one when clause and the optional otherwise route disabled is functionally equivalent to a filter element."

In other words, if you want to process both TRUE and FALSE, use a choice, but if you want to process only TRUE or only FALSE, you can use a filter or a choice.

I would use a filter in the latter case because a choice restricts what kind of input it will take. From Eric's article:

"Each choice element must have at least one parent element and that parent element must be either an Input element, a filter element, or a Processor element."

I have encountered situations where I had to add a No Operation processor to get a choice to work. It was worth it because a choice is better than multiple filters, but it would be easier to use a filter if you needed to process only the TRUE case or only the FALSE case.

0 Kudos