FilteringStrategy method

The job of the FilteringStrategy is to take the list of rules that were found by the FindingStrategy and filter out the rules that 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.

Business Rule Beans (BRBeans) provides the following filtering strategies that can be used:

Accept Any
BRBeans utilizes all of the rules found (this is the default).
Accept One
BRBeans expects one rule only.
Accept First
BRBeans utilizes the first rule found.
Accept Last
BRBeans utilizes the last rule found.
Instances of these filtering strategies are stored in static constants defined in the 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. You want to ensure that exactly one rule is found on a TriggerPoint call. Thus, 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 accomplishes 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
Predefined strategy objects
FindingStrategy method



Searchable topic ID:   cbrb_strat2
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/brb/concepts/cbrb_strat2.html

Library | Support | Terms of Use | Feedback