Class JexlRule

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

    public class JexlRule
    extends BasicRule
    • Constructor Detail

      • JexlRule

        public JexlRule()
      • JexlRule

        public JexlRule​(org.apache.commons.jexl3.JexlEngine jexl)
    • Method Detail

      • description

        public JexlRule description​(java.lang.String description)
      • 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
        Overrides:
        evaluate in class BasicRule
        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
        Overrides:
        execute in class BasicRule
        Throws:
        java.lang.Exception - thrown if an exception occurs when performing action(s)
      • name

        public JexlRule name​(java.lang.String name)
      • priority

        public JexlRule priority​(int priority)
      • then

        public JexlRule then​(java.lang.String action)
      • when

        public JexlRule when​(java.lang.String condition)