![]() |
|
The job of the FilteringStrategy
is to take the list of rules
which were found by the FindingStrategy
and filter out those
rules which should not be fired. There are three sets of filtering strategies
used in TriggerPoint:
A different strategy can be used for each of these scenarios, along with different strategies for classifier and non-classifier rules. The zero rules strategy is invoked if no rules are found by the finding strategy, the one rule strategy is invoked if exactly one rule is found, and the multiple rules strategy is invoked if more than one rule is found.
BRBeans provides several filtering strategies that can be used:
FilteringStrategy
interface. You can use these
for setting the strategies on a TriggerPoint
.
As an example, here is one common way to use filtering strategies. Say
you want to ensure that exactly one rule is found on a TriggerPoint
call.
You would set all three strategies (zero rules, one rule, and multiple rules)
for this TriggerPoint
to FilteringStrategy.ACCEPT_ONE
.
This strategy throws an exception if the number of rules is not exactly one.
The following sequence of method calls would accomplish this for TriggerPoint tp
:
tp.setNoRulesFilteringStrategy(FilteringStrategy.ACCEPT_ONE, TriggerPoint.ALL_RULES);
tp.setOneRuleFilteringStrategy(FilteringStrategy.ACCEPT_ONE, TriggerPoint.ALL_RULES);
tp.setMultipleRulesFilteringStrategy(FilteringStrategy.ACCEPT_ONE, TriggerPoint.ALL_RULES);
Related concepts... | |
Firing strategy | |
Combining strategy | |
View PDF file... | |
To view a PDF file containing this article and related articles, click: | |
![]() | |
![]() |