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.

    Author:
    Mahmoud Ben Hassine ([email protected])
    • Method Detail

      • fire

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

        public Map<Rule,​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