Details
-
Feature Request
-
Resolution: Unresolved
-
Critical
-
5.0.0.M5, 5.0.0.CR1
-
None
-
Low
Description
Custom exception handler for condition evaluator.
Its proposed to introduce custom exception handler for condition evaluator becaue "always re-trow" approach is not appropriate for some cases when fail-safe rule execution is necessary.
There is an requirment which can't be satisfied with current implementation of condition evaluator: "All rules that are present in agenda should be performed fail safe and independed".
So it means that if there are 2 rules and one of them throws a NullPointer exception while condition evaluation (because of wrong configuration) the second rule have to be performed.
Changes have to be applied to following class:
drools-core\src\main\java\org\drools\rule\EvalCondition.java
in method:
public boolean isAllowed(final Tuple tuple,
final WorkingMemory workingMemory,
final Object context) {
try
}
should be replaced with somethig like this
public boolean isAllowed(final Tuple tuple,
final WorkingMemory workingMemory,
final Object context) {
try { return this.expression.evaluate( tuple, this.requiredDeclarations, workingMemory, context ); }
catch ( final Exception e )
{ getExceptionHandler().handle(e); }}