CombiningStrategy method

The job of the CombiningStrategy is to take the results of the rules that are fired by the FiringStrategy and combine them to form a reasonable result to the TriggerPoint caller. Business Rule Beans (BRBeans) provides several combining strategies to be used in applications:

Return All
Returns the results from all of the rules fired in an array (this is the default)
Return First
Returns only the result from the first rule fired
Return Last
Returns only the result from the last rule fired
Return AND
Returns the logical AND of the results from all the rules fired. This strategy requires that all of the results returned by the fired rules are either ConstraintReturn objects or java.lang.Boolean objects. An exception is thrown if this is not the case.
Return OR
Returns the logical OR of the results from all of the rules fired. This strategy requires that all of the results returned by the fired rules are either ConstraintReturn objects or java.lang.Boolean objects. An exception is thrown if this is not the case.
Throw Violation
Throws a ConstraintViolationException containing all of the failed ConstraintReturn objects if any ConstraintReturns contain false. Otherwise, it returns a true ConstraintReturn.

Instances of these combining strategies are stored in static constants defined in the CombiningStrategy interface. You can use these for setting the strategies on a TriggerPoint. For example, the following method call sets the CombiningStrategy on TriggerPoint tp to be the Return_First strategy:

tp.setCombiningStrategy(CombiningStrategy.RETURN_FIRST, TriggerPoint.ALL_RULES);

Related concepts
Predefined strategy objects
FiringStrategy method



Searchable topic ID:   cbrb_strat4
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_strat4.html

Library | Support | Terms of Use | Feedback