Interface RuleSet<R extends Rule>

Type Parameters:
R - rule type parameter
All Known Subinterfaces:
Knowledge, RuleSession<S>, RuleSetContext<C,R>, StatefulSession, StatelessSession
All Known Implementing Classes:
AbstractSessionWrapper, KnowledgeWrapper

public interface RuleSet<R extends Rule>

Interface describes a mutable collection of rules. Both Knowledge and RuleSession are extending this interface.

  • Method Details

    • getRules

      List<R> getRules()

      Method returns a list of rules created so far.

      Returns:
      list of currently known rules
    • ruleExists

      default boolean ruleExists(String name)
      Checks if a rule with the specified name exists in the rule set.
      Parameters:
      name - the name of the rule
      Returns:
      true if a rule with the specified name exists, false otherwise
    • getRule

      R getRule(String name)
      Retrieves a rule based on its name.
      Parameters:
      name - the name of the rule to retrieve
      Returns:
      the rule with the specified name, or null if no rule with that name exists
    • getRule

      default R getRule(Named named)
      Retrieves a rule based on the name of the named object.
      Parameters:
      named - the object with a name
      Returns:
      the rule with the specified name, or null if no rule with that name exists
    • setRuleBuilderExceptionHandler

      @Deprecated default void setRuleBuilderExceptionHandler(RuleBuilderExceptionHandler handler)
      Deprecated.
      Since version 3.1.0, for performance reasons, rules are no longer compiled one by one. As such, the use of this exception handler has become obsolete. Please join our discussions on GitHub to propose a new approach.
      Parameters:
      handler - exception handler
    • resolveFieldReferences

      FieldReference[] resolveFieldReferences(String[] args, NamedType.Resolver typeMapper)