Class BuildContext

  • All Implemented Interfaces:
    org.drools.base.RuleBuildContext

    public class BuildContext
    extends java.lang.Object
    implements org.drools.base.RuleBuildContext
    A build context for Reteoo Builder
    • Method Detail

      • getTerminals

        public java.util.List<TerminalNode> getTerminals()
      • isEmptyForAllBetaConstraints

        public boolean isEmptyForAllBetaConstraints()
      • syncObjectTypesWithObjectCount

        public void syncObjectTypesWithObjectCount()
      • getObjectSource

        public ObjectSource getObjectSource()
        Returns:
        the objectSource
      • setObjectSource

        public void setObjectSource​(ObjectSource objectSource)
        Parameters:
        objectSource - the objectSource to set
      • getPatterns

        public java.util.List<org.drools.base.rule.Pattern> getPatterns()
      • addPattern

        public void addPattern​(org.drools.base.rule.Pattern pattern)
      • getTupleSource

        public LeftTupleSource getTupleSource()
        Returns:
        the tupleSource
      • setTupleSource

        public void setTupleSource​(LeftTupleSource tupleSource)
        Parameters:
        tupleSource - the tupleSource to set
      • getWorkingMemories

        public java.util.Collection<InternalWorkingMemory> getWorkingMemories()
        Return the array of working memories associated with the given rulebase.
      • getNextNodeId

        public int getNextNodeId()
        Returns an Id for the next node
      • getNextMemoryId

        public int getNextMemoryId()
      • releaseId

        public void releaseId​(org.drools.base.common.NetworkNode node)
        Method used to undo previous id assignment
      • push

        public void push​(org.drools.base.rule.RuleConditionElement rce)
        Adds the rce to the build stack
      • pop

        public org.drools.base.rule.RuleConditionElement pop()
        Removes the top stack element
      • peek

        public org.drools.base.rule.RuleConditionElement peek()
        Returns the top stack element without removing it
      • getBuildstack

        public java.util.Collection<org.drools.base.rule.RuleConditionElement> getBuildstack()
      • getBetaconstraints

        public java.util.List<org.drools.base.rule.constraint.BetaNodeFieldConstraint> getBetaconstraints()
      • setBetaconstraints

        public void setBetaconstraints​(java.util.List<org.drools.base.rule.constraint.BetaNodeFieldConstraint> betaconstraints)
      • getAlphaConstraints

        public java.util.List<org.drools.base.rule.constraint.AlphaNodeFieldConstraint> getAlphaConstraints()
      • addPathEndNode

        public void addPathEndNode​(PathEndNode node)
      • isTupleMemoryEnabled

        public boolean isTupleMemoryEnabled()
      • setTupleMemoryEnabled

        public void setTupleMemoryEnabled​(boolean hasLeftMemory)
      • isQuery

        public boolean isQuery()
      • getCurrentEntryPoint

        public org.drools.base.rule.EntryPointId getCurrentEntryPoint()
        Returns:
        the currentEntryPoint
      • setCurrentEntryPoint

        public void setCurrentEntryPoint​(org.drools.base.rule.EntryPointId currentEntryPoint)
        Parameters:
        currentEntryPoint - the currentEntryPoint to set
      • getNodes

        public java.util.List<BaseNode> getNodes()
        Returns:
        the nodes
      • setNodes

        public void setNodes​(java.util.List<BaseNode> nodes)
        Parameters:
        nodes - the nodes to set
      • getPartitionId

        public org.drools.base.common.RuleBasePartitionId getPartitionId()
        Returns:
        the partitionId
      • setPartitionId

        public void setPartitionId​(org.drools.base.common.RuleBasePartitionId partitionId)
        Parameters:
        partitionId - the partitionId to set
      • isStreamMode

        public boolean isStreamMode()
      • getExpirationOffset

        public long getExpirationOffset​(org.drools.base.rule.Pattern pattern)
      • getRule

        public org.drools.base.definitions.rule.impl.RuleImpl getRule()
        Specified by:
        getRule in interface org.drools.base.RuleBuildContext
      • setRule

        public void setRule​(org.drools.base.definitions.rule.impl.RuleImpl rule)
      • getSubRule

        public org.drools.base.rule.GroupElement getSubRule()
      • popRuleComponent

        public org.drools.base.rule.RuleComponent popRuleComponent()
        Removes the top element from the rule component stack. The rule component stack is used to add trackability to the ReteOO nodes so that they can be linked to the rule components that originated them.
      • peekRuleComponent

        public org.drools.base.rule.RuleComponent peekRuleComponent()
        Peeks at the top element from the rule component stack. The rule component stack is used to add trackability to the ReteOO nodes so that they can be linked to the rule components that originated them.
      • pushRuleComponent

        public void pushRuleComponent​(org.drools.base.rule.RuleComponent ruleComponent)
        Adds the ruleComponent to the top of the rule component stack. The rule component stack is used to add trackability to the ReteOO nodes so that they can be linked to the rule components that originated them.
      • getRootObjectTypeNode

        public ObjectTypeNode getRootObjectTypeNode()
      • setRootObjectTypeNode

        public void setRootObjectTypeNode​(ObjectTypeNode source)
      • getLastBuiltPatterns

        public org.drools.base.rule.Pattern[] getLastBuiltPatterns()
      • setLastBuiltPattern

        public void setLastBuiltPattern​(org.drools.base.rule.Pattern lastBuiltPattern)
      • getConsequenceName

        public java.lang.String getConsequenceName()
      • setConsequenceName

        public void setConsequenceName​(java.lang.String consequenceName)
      • getSubRuleIndex

        public int getSubRuleIndex()
      • setSubRuleIndex

        public void setSubRuleIndex​(int subRuleIndex)