Interface RuleListener


  • public interface RuleListener
    A listener for rule execution events.
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default void afterEvaluate​(Rule rule, Facts facts, boolean evaluationResult)
      Triggered after the evaluation of a rule.
      default boolean beforeEvaluate​(Rule rule, Facts facts)
      Triggered before the evaluation of a rule.
      default void beforeExecute​(Rule rule, Facts facts)
      Triggered before the execution of a rule.
      default void onEvaluationError​(Rule rule, Facts facts, java.lang.Exception exception)
      Triggered on condition evaluation error due to any runtime exception.
      default void onFailure​(Rule rule, Facts facts, java.lang.Exception exception)
      Triggered after a rule has failed.
      default void onSuccess​(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 evaluated
        facts - known after evaluating the rule
        evaluationResult - 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 evaluated
        facts - 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 rule
        facts - 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 evaluated
        facts - known while evaluating the rule
        exception - 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 rule
        facts - known facts after executing the rule
        exception - the exception thrown when attempting to execute the rule
      • onSuccess

        default void onSuccess​(Rule rule,
                               Facts facts)
        Triggered after a rule has been executed successfully.
        Parameters:
        rule - the current rule
        facts - known facts after executing the rule