Interface Constraint

All Superinterfaces:
Cloneable, Externalizable, RuleComponent, Serializable
All Known Subinterfaces:
AlphaNodeFieldConstraint, BetaConstraint<C>, IndexableConstraint, IntervalProviderConstraint
All Known Implementing Classes:
MutableTypeConstraint, NegConstraint, QueryNameConstraint, XpathConstraint

public interface Constraint extends RuleComponent, Externalizable, Cloneable
  • Method Details

    • getRequiredDeclarations

      Declaration[] getRequiredDeclarations()
      Returns all the declarations required by the given constraint implementation.
      Returns:
    • replaceDeclaration

      void replaceDeclaration(Declaration oldDecl, Declaration newDecl)
      When a rule contains multiple logical branches, i.e., makes use of 'OR' CE, it is required to clone patterns and declarations for each logical branch. Since this is done at ReteOO build type, when constraints were already created, eventually some constraints need to update their references to the declarations.
      Parameters:
      oldDecl -
      newDecl -
    • clone

      Constraint clone()
      Clones the constraint
      Returns:
    • getType

      Returns the type of the constraint, either ALPHA, BETA or UNKNOWN
      Returns:
    • isTemporal

      boolean isTemporal()
      Returns true in case this constraint is a temporal constraint
      Returns:
    • getListenedPropertyMask

      default BitMask getListenedPropertyMask(Optional<Pattern> pattern, ObjectType objectType, List<String> settableProperties)
      Returns property reactivity BitMask of this constraint.
      Parameters:
      pattern - which this constraint belongs to. if pattern is empty, bind variables are considered to be declared in the same pattern. It should be fine for alpha constraints
      objectType -
      settableProperties -
      Returns:
      property reactivity BitMask
    • equals

      default boolean equals(Object object, RuleBase kbase)
    • registerEvaluationContext

      default void registerEvaluationContext(RuleBuildContext ruleBuildContext)
    • mergeEvaluationContext

      default void mergeEvaluationContext(Constraint other)
    • getPackageNames

      default Collection<String> getPackageNames()
    • addPackageNames

      default void addPackageNames(Collection<String> otherPkgs)