Package org.drools.core.reteoo
Class RuleTerminalNode
- java.lang.Object
-
- org.drools.core.common.BaseNode
-
- org.drools.core.reteoo.AbstractTerminalNode
-
- org.drools.core.reteoo.RuleTerminalNode
-
- All Implemented Interfaces:
Externalizable
,Serializable
,MemoryFactory<PathMemory>
,NetworkNode
,LeftTupleNode
,LeftTupleSink
,LeftTupleSinkNode
,PathEndNode
,Sink
,TerminalNode
public class RuleTerminalNode extends AbstractTerminalNode
Leaf Rete-OO node responsible for enactingAction
s on a matchedRule
.- See Also:
Rule
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RuleTerminalNode.SortDeclarations
-
Nested classes/interfaces inherited from interface org.drools.core.reteoo.PathEndNode
PathEndNode.PathMemSpec
-
-
Field Summary
Fields Modifier and Type Field Description protected Declaration[]
allDeclarations
protected String
consequenceName
protected Declaration[]
enabledDeclarations
protected boolean
fireDirect
protected ObjectTypeNode.Id
leftInputOtnId
protected LeftTupleSinkNode
nextTupleSinkNode
protected LeftTupleSinkNode
previousTupleSinkNode
protected Declaration[]
requiredDeclarations
protected RuleImpl
rule
The rule to invoke upon match.protected Declaration[]
salienceDeclarations
protected GroupElement
subrule
the subrule reference is needed to resolve declarations because declarations may have different offsets in each subruleprotected int
subruleIndex
-
Fields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId, partitionsEnabled
-
-
Constructor Summary
Constructors Constructor Description RuleTerminalNode()
RuleTerminalNode(int id, LeftTupleSource source, RuleImpl rule, GroupElement subrule, int subruleIndex, BuildContext context)
-
Method Summary
-
Methods inherited from class org.drools.core.reteoo.AbstractTerminalNode
createMemory, createPeer, doRemove, getDeclaredMask, getInferredMask, getLeftInferredMask, getLeftTupleSource, getNegativeMask, getObjectCount, getObjectTypeNode, getPathEndNodes, getPathIndex, getPathMemSpec, getPathNodes, getPathNodes, getSinkPropagator, hasPathNode, initDeclaredMask, initInferredMask, initPathMemory, isInUse, isLeftTupleMemoryEnabled, isTerminalNodeOf, networkUpdated, resetPathMemSpec, setDeclaredMask, setInferredMask, setLeftTupleMemoryEnabled, setNegativeMask, setObjectCount, setPartitionIdWithSinks, setPathEndNodes, unwrapTupleSource
-
Methods inherited from class org.drools.core.common.BaseNode
addAssociation, addAssociation, attach, getAssociatedRules, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociation, setId, setPartitionId, setPartitionsEnabled, setStreamMode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.common.MemoryFactory
getMemoryId
-
Methods inherited from interface org.drools.core.common.NetworkNode
getAssociatedRules, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getPartitionId, isAssociatedWith
-
Methods inherited from interface org.drools.core.reteoo.PathEndNode
calculatePathMemSpec, calculatePathMemSpec
-
-
-
-
Field Detail
-
rule
protected RuleImpl rule
The rule to invoke upon match.
-
subrule
protected GroupElement subrule
the subrule reference is needed to resolve declarations because declarations may have different offsets in each subrule
-
subruleIndex
protected int subruleIndex
-
allDeclarations
protected Declaration[] allDeclarations
-
requiredDeclarations
protected Declaration[] requiredDeclarations
-
salienceDeclarations
protected Declaration[] salienceDeclarations
-
enabledDeclarations
protected Declaration[] enabledDeclarations
-
previousTupleSinkNode
protected LeftTupleSinkNode previousTupleSinkNode
-
nextTupleSinkNode
protected LeftTupleSinkNode nextTupleSinkNode
-
fireDirect
protected boolean fireDirect
-
leftInputOtnId
protected transient ObjectTypeNode.Id leftInputOtnId
-
consequenceName
protected String consequenceName
-
-
Constructor Detail
-
RuleTerminalNode
public RuleTerminalNode()
-
RuleTerminalNode
public RuleTerminalNode(int id, LeftTupleSource source, RuleImpl rule, GroupElement subrule, int subruleIndex, BuildContext context)
-
-
Method Detail
-
setDeclarations
public void setDeclarations(Map<String,Declaration> decls)
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classAbstractTerminalNode
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classAbstractTerminalNode
- Throws:
IOException
-
getRule
public RuleImpl getRule()
Retrieve theAction
associated with this node.- Specified by:
getRule
in interfaceTerminalNode
- Specified by:
getRule
in classAbstractTerminalNode
- Returns:
- The
Action
associated with this node.
-
getSubRule
public GroupElement getSubRule()
-
doAttach
public void doAttach(BuildContext context)
-
getAllDeclarations
public Declaration[] getAllDeclarations()
-
getRequiredDeclarations
public Declaration[] getRequiredDeclarations()
-
getSalienceDeclarations
public Declaration[] getSalienceDeclarations()
-
setSalienceDeclarations
public void setSalienceDeclarations(Declaration[] salienceDeclarations)
-
getEnabledDeclarations
public Declaration[] getEnabledDeclarations()
-
setEnabledDeclarations
public void setEnabledDeclarations(Declaration[] enabledDeclarations)
-
getConsequenceName
public String getConsequenceName()
-
cancelMatch
public void cancelMatch(AgendaItem match, InternalWorkingMemoryActions workingMemory)
-
getNextLeftTupleSinkNode
public LeftTupleSinkNode getNextLeftTupleSinkNode()
Returns the next node- Returns:
- The next TupleSinkNode
-
setNextLeftTupleSinkNode
public void setNextLeftTupleSinkNode(LeftTupleSinkNode next)
Sets the next node- Parameters:
next
- The next TupleSinkNode
-
getPreviousLeftTupleSinkNode
public LeftTupleSinkNode getPreviousLeftTupleSinkNode()
Returns the previous node- Returns:
- The previous TupleSinkNode
-
setPreviousLeftTupleSinkNode
public void setPreviousLeftTupleSinkNode(LeftTupleSinkNode previous)
Sets the previous node- Parameters:
previous
- The previous TupleSinkNode
-
getType
public short getType()
-
createLeftTuple
public LeftTuple createLeftTuple(InternalFactHandle factHandle, LeftTuple leftTuple, Sink sink)
-
createLeftTuple
public LeftTuple createLeftTuple(InternalFactHandle factHandle, boolean leftTupleMemoryEnabled)
-
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple, Sink sink, PropagationContext pctx, boolean leftTupleMemoryEnabled)
-
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, Sink sink)
-
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, LeftTuple currentLeftChild, LeftTuple currentRightChild, Sink sink, boolean leftTupleMemoryEnabled)
-
getLeftInputOtnId
public ObjectTypeNode.Id getLeftInputOtnId()
-
setLeftInputOtnId
public void setLeftInputOtnId(ObjectTypeNode.Id leftInputOtnId)
-
isFireDirect
public boolean isFireDirect()
-
setFireDirect
public void setFireDirect(boolean fireDirect)
-
-