Package org.drools.base.rule.constraint
Interface Constraint
- All Superinterfaces:
Cloneable,Externalizable,RuleComponent,Serializable
- All Known Subinterfaces:
AlphaNodeFieldConstraint,BetaConstraint<C>,IndexableConstraint,IntervalProviderConstraint
- All Known Implementing Classes:
MutableTypeConstraint,NegConstraint,QueryNameConstraint,XpathConstraint
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumAn enum for Constraint Types -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddPackageNames(Collection<String> otherPkgs) clone()Clones the constraintdefault booleandefault BitMaskgetListenedPropertyMask(Optional<Pattern> pattern, ObjectType objectType, List<String> settableProperties) Returns property reactivity BitMask of this constraint.default Collection<String>Returns all the declarations required by the given constraint implementation.getType()Returns the type of the constraint, either ALPHA, BETA or UNKNOWNbooleanReturns true in case this constraint is a temporal constraintdefault voidmergeEvaluationContext(Constraint other) default voidregisterEvaluationContext(RuleBuildContext ruleBuildContext) voidreplaceDeclaration(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.Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
-
Method Details
-
getRequiredDeclarations
Declaration[] getRequiredDeclarations()Returns all the declarations required by the given constraint implementation.- Returns:
-
replaceDeclaration
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
Constraint.ConstraintType 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 constraintsobjectType-settableProperties-- Returns:
- property reactivity BitMask
-
equals
-
registerEvaluationContext
-
mergeEvaluationContext
-
getPackageNames
-
addPackageNames
-