Package org.drools.core.reteoo.builder
Class PatternBuilder
java.lang.Object
org.drools.core.reteoo.builder.PatternBuilder
- All Implemented Interfaces:
ReteooComponentBuilder
A builder for patterns
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattachAlphaNodes(BuildContext context, BuildUtils utils, List<AlphaNodeFieldConstraint> alphaConstraints) voidbuild(BuildContext context, BuildUtils utils, RuleConditionElement rce) Builds and attach if needed the given RuleConditionalElementprotected voidlinkAlphaConstraint(AlphaNodeFieldConstraint constraint, List<AlphaNodeFieldConstraint> alphaConstraints) protected voidlinkBetaConstraint(BetaConstraint constraint, List<BetaConstraint> betaConstraints) booleanrequiresLeftActivation(BuildUtils utils, RuleConditionElement rce) A boolean function that indicates if the builder requires a previous left (tuple) activation in order to corretly build the given component.
-
Constructor Details
-
PatternBuilder
public PatternBuilder()
-
-
Method Details
-
build
Description copied from interface:ReteooComponentBuilderBuilds and attach if needed the given RuleConditionalElement- Specified by:
buildin interfaceReteooComponentBuilder- Parameters:
context- current build context
-
linkBetaConstraint
-
linkAlphaConstraint
protected void linkAlphaConstraint(AlphaNodeFieldConstraint constraint, List<AlphaNodeFieldConstraint> alphaConstraints) -
attachAlphaNodes
public void attachAlphaNodes(BuildContext context, BuildUtils utils, List<AlphaNodeFieldConstraint> alphaConstraints) throws InvalidPatternException - Throws:
InvalidPatternException
-
requiresLeftActivation
Description copied from interface:ReteooComponentBuilderA boolean function that indicates if the builder requires a previous left (tuple) activation in order to corretly build the given component. In other words, if it returns true and no previous TupleSource is already created, an InitialFact pattern must be added with appropriate left input adapter for the network to be correctly built. For instance, NOT / EXISTS / ACCUMULATE are examples of builders that must return true for this method, while PATTERN must return false.- Specified by:
requiresLeftActivationin interfaceReteooComponentBuilderrce- the element to be built- Returns:
- true if a tuple source is required, false otherwise.
-