Class ActivationRuleGroup

  • All Implemented Interfaces:
    java.lang.Comparable<Rule>, Rule

    public class ActivationRuleGroup
    extends CompositeRule
    An activation rule group is a composite rule that fires the first applicable rule and ignores other rules in the group (XOR logic). Rules are first sorted by their natural order (priority by default) within the group. This class is not thread-safe.
    • Constructor Detail

      • ActivationRuleGroup

        public ActivationRuleGroup()
        Create an activation rule group.
      • ActivationRuleGroup

        public ActivationRuleGroup​(java.lang.String name)
        Create an activation rule group.
        Parameters:
        name - of the activation rule group
      • ActivationRuleGroup

        public ActivationRuleGroup​(java.lang.String name,
                                   java.lang.String description)
        Create a conditional rule group.
        Parameters:
        name - of the activation rule group
        description - of the activation rule group
      • ActivationRuleGroup

        public ActivationRuleGroup​(java.lang.String name,
                                   java.lang.String description,
                                   int priority)
        Create an activation rule group.
        Parameters:
        name - of the activation rule group
        description - of the activation rule group
        priority - of the activation rule group
    • Method Detail

      • evaluate

        public boolean evaluate​(Facts facts)
        Description copied from class: BasicRule
        This method implements the rule's condition(s). Implementations should handle any runtime exception and return true/false accordingly
        Specified by:
        evaluate in interface Rule
        Specified by:
        evaluate in class CompositeRule
        Returns:
        true if the rule should be applied given the provided facts, false otherwise
      • execute

        public void execute​(Facts facts)
                     throws java.lang.Exception
        Description copied from class: BasicRule
        This method implements the rule's action(s).
        Specified by:
        execute in interface Rule
        Specified by:
        execute in class CompositeRule
        Throws:
        java.lang.Exception - thrown if an exception occurs when performing action(s)