Package org.rossonet.ext.rules.api
Interface RuleListener
-
public interface RuleListenerA listener for rule execution events.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidafterEvaluate(Rule rule, Facts facts, boolean evaluationResult)Triggered after the evaluation of a rule.default booleanbeforeEvaluate(Rule rule, Facts facts)Triggered before the evaluation of a rule.default voidbeforeExecute(Rule rule, Facts facts)Triggered before the execution of a rule.default voidonEvaluationError(Rule rule, Facts facts, java.lang.Exception exception)Triggered on condition evaluation error due to any runtime exception.default voidonFailure(Rule rule, Facts facts, java.lang.Exception exception)Triggered after a rule has failed.default voidonSuccess(Rule rule, Facts facts)Triggered after a rule has been executed successfully.
-
-
-
Method Detail
-
afterEvaluate
default void afterEvaluate(Rule rule, Facts facts, boolean evaluationResult)
Triggered after the evaluation of a rule.- Parameters:
rule- that has been evaluatedfacts- known after evaluating the ruleevaluationResult- true if the rule evaluated to true, false otherwise
-
beforeEvaluate
default boolean beforeEvaluate(Rule rule, Facts facts)
Triggered before the evaluation of a rule.- Parameters:
rule- being evaluatedfacts- known before evaluating the rule- Returns:
- true if the rule should be evaluated, false otherwise
-
beforeExecute
default void beforeExecute(Rule rule, Facts facts)
Triggered before the execution of a rule.- Parameters:
rule- the current rulefacts- known facts before executing the rule
-
onEvaluationError
default void onEvaluationError(Rule rule, Facts facts, java.lang.Exception exception)
Triggered on condition evaluation error due to any runtime exception.- Parameters:
rule- that has been evaluatedfacts- known while evaluating the ruleexception- that happened while attempting to evaluate the condition.
-
onFailure
default void onFailure(Rule rule, Facts facts, java.lang.Exception exception)
Triggered after a rule has failed.- Parameters:
rule- the current rulefacts- known facts after executing the ruleexception- the exception thrown when attempting to execute the rule
-
-