com.ibm.websphere.brb.strategy
Class ThrowViolationCombiningStrategy

java.lang.Object
  extended bycom.ibm.websphere.brb.strategy.ThrowViolationCombiningStrategy
All Implemented Interfaces:
CombiningStrategy, java.io.Serializable

public class ThrowViolationCombiningStrategy
extends java.lang.Object
implements CombiningStrategy, java.io.Serializable

Throws a ConstraintViolationException containing all failing ConstraintReturns if any results are false. Returns a single true ConstraintReturn if all results are true. The input results are expected to be of type ConstraintReturn or type Boolean. If this is not the case, a BusinessRuleBeansException is thrown. If the overall result is false but there are no failing ConstraintReturns (i.e. all failing rules returned Booleans), then the ConstraintViolationException that is thrown will not contain any failing ConstraintReturns.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.ibm.websphere.brb.CombiningStrategy
RETURN_ALL, RETURN_AND, RETURN_FIRST, RETURN_LAST, RETURN_OR, THROW_VIOLATION
 
Constructor Summary
ThrowViolationCombiningStrategy()
           
 
Method Summary
 java.lang.Object combineResults(TriggerPoint tp, java.lang.Object[] results)
          Throws a ConstraintViolationException containing all failed ConstraintReturns if any results are false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThrowViolationCombiningStrategy

public ThrowViolationCombiningStrategy()
Method Detail

combineResults

public java.lang.Object combineResults(TriggerPoint tp,
                                       java.lang.Object[] results)
                                throws BusinessRuleBeansException
Throws a ConstraintViolationException containing all failed ConstraintReturns if any results are false. Returns a single true ConstraintReturn if all results are true.

Specified by:
combineResults in interface CombiningStrategy
Parameters:
tp - the trigger point which is used to make this call
results - the list of results of firing the rules
Returns:
The combined result of the rules fired on this TriggerPoint call. Any type of object can be returned as the result.
Throws:
BusinessRuleBeansException - if any exceptions occur