Class DefaultRulesEngine

  • All Implemented Interfaces:
    RulesEngine

    public final class DefaultRulesEngine
    extends AbstractRulesEngine
    Default RulesEngine implementation. Rules are fired according to their natural order which is priority by default. This implementation iterates over the sorted set of rules, evaluates the condition of each rule and executes its actions if the condition evaluates to true.
    • Method Detail

      • check

        public java.util.Map<Rule,​java.lang.Boolean> check​(Rules rules,
                                                                 Facts facts)
        Description copied from interface: RulesEngine
        Check rules without firing them.
        Returns:
        a map with the result of evaluation of each rule
      • fire

        public void fire​(Rules rules,
                         Facts facts)
        Description copied from interface: RulesEngine
        Fire all registered rules on given facts.