org.drools.core.reteoo
Class QueryTerminalNode
java.lang.Object
org.drools.core.common.BaseNode
org.drools.core.reteoo.AbstractTerminalNode
org.drools.core.reteoo.QueryTerminalNode
- All Implemented Interfaces:
- Externalizable, Serializable, MemoryFactory, NetworkNode, LeftTupleSink, LeftTupleSinkNode, Sink, TerminalNode
public class QueryTerminalNode
- extends AbstractTerminalNode
- implements LeftTupleSinkNode
Leaf Rete-OO node responsible for enacting Action s on a
matched Rule.
- See Also:
org.kie.rule.Rule,
Serialized Form
|
Field Summary |
static short |
type
|
|
Method Summary |
void |
assertLeftTuple(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
Assert a new Tuple. |
void |
attach(BuildContext context)
Attaches the node into the network. |
LeftTuple |
createLeftTuple(InternalFactHandle factHandle,
LeftTuple leftTuple,
LeftTupleSink sink)
|
LeftTuple |
createLeftTuple(InternalFactHandle factHandle,
LeftTupleSink sink,
boolean leftTupleMemoryEnabled)
|
LeftTuple |
createLeftTuple(LeftTuple leftTuple,
LeftTupleSink sink,
PropagationContext pctx,
boolean leftTupleMemoryEnabled)
|
LeftTuple |
createLeftTuple(LeftTuple leftTuple,
RightTuple rightTuple,
LeftTuple currentLeftChild,
LeftTuple currentRightChild,
LeftTupleSink sink,
boolean leftTupleMemoryEnabled)
|
LeftTuple |
createLeftTuple(LeftTuple leftTuple,
RightTuple rightTuple,
LeftTupleSink sink)
|
LeftTuple |
createPeer(LeftTuple original)
|
protected void |
doCollectAncestors(NodeSet nodeSet)
|
protected void |
doRemove(RuleRemovalContext context,
ReteooBuilder builder,
InternalWorkingMemory[] workingMemories)
Removes the node from teh network. |
Declaration[] |
getDeclarations()
|
ObjectTypeNode.Id |
getLeftInputOtnId()
|
LeftTupleSinkNode |
getNextLeftTupleSinkNode()
Returns the next node |
LeftTupleSinkNode |
getPreviousLeftTupleSinkNode()
Returns the previous node |
Query |
getQuery()
|
Rule |
getRule()
|
Declaration[] |
getSalienceDeclarations()
|
GroupElement |
getSubRule()
|
int |
getSubruleIndex()
|
Declaration[] |
getTimerDelayDeclarations()
|
Declaration[] |
getTimerPeriodDeclarations()
|
short |
getType()
|
boolean |
isFireDirect()
|
boolean |
isInUse()
Returns true in case the current node is in use (is referenced by any other node) |
boolean |
isLeftTupleMemoryEnabled()
|
void |
modifyLeftTuple(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
networkUpdated(UpdateContext updateContext)
A method that is called for all nodes whose network below them
changed, after the change is complete, providing them with an oportunity
for state update |
void |
readExternal(ObjectInput in)
|
void |
retractLeftTuple(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
setLeftInputOtnId(ObjectTypeNode.Id leftInputOtnId)
|
void |
setLeftTupleMemoryEnabled(boolean tupleMemoryEnabled)
|
void |
setNextLeftTupleSinkNode(LeftTupleSinkNode next)
Sets the next node |
void |
setPreviousLeftTupleSinkNode(LeftTupleSinkNode previous)
Sets the previous node |
String |
toString()
|
void |
updateNewNode(InternalWorkingMemory workingMemory,
PropagationContext context)
|
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class org.drools.core.reteoo.AbstractTerminalNode |
createMemory, getDeclaredMask, getInferredMask, getLeftInferredMask, getLeftTupleSource, getNegativeMask, initDeclaredMask, initInferredMask, initPathMemory, modifyLeftTuple, setDeclaredMask, setInferredMask, setNegativeMask, unwrapTupleSource |
| Methods inherited from class org.drools.core.common.BaseNode |
addAssociation, attach, collectAncestors, getAssociations, getId, getPartitionId, hashCode, isStreamMode, remove, removeAssociation, setId, setPartitionId |
type
public static final short type
- See Also:
- Constant Field Values
QueryTerminalNode
public QueryTerminalNode()
QueryTerminalNode
public QueryTerminalNode(int id,
LeftTupleSource source,
Rule rule,
GroupElement subrule,
int subruleIndex,
BuildContext context)
- Constructor
- Parameters:
id - node IDsource - the tuple source for this noderule - the rule this node belongs tosubrule - the subrule this node belongs tocontext - the current build context
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
- Specified by:
readExternal in interface Externalizable- Overrides:
readExternal in class AbstractTerminalNode
- Throws:
IOException
ClassNotFoundException
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
- Specified by:
writeExternal in interface Externalizable- Overrides:
writeExternal in class AbstractTerminalNode
- Throws:
IOException
getQuery
public Query getQuery()
getRule
public Rule getRule()
- Specified by:
getRule in interface TerminalNode- Specified by:
getRule in class AbstractTerminalNode
assertLeftTuple
public void assertLeftTuple(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Assert a new
Tuple.
- Specified by:
assertLeftTuple in interface LeftTupleSink
- Parameters:
leftTuple - The Tuple being asserted.workingMemory - The working memory seesion.context - The PropagationContext of the WorkingMemory action
retractLeftTuple
public void retractLeftTuple(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Specified by:
retractLeftTuple in interface LeftTupleSink
modifyLeftTuple
public void modifyLeftTuple(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Specified by:
modifyLeftTuple in interface LeftTupleSink
toString
public String toString()
- Overrides:
toString in class BaseNode
attach
public void attach(BuildContext context)
- Description copied from class:
BaseNode
- Attaches the node into the network. Usually to the parent
ObjectSource or TupleSource
- Specified by:
attach in class BaseNode
networkUpdated
public void networkUpdated(UpdateContext updateContext)
- Description copied from class:
BaseNode
- A method that is called for all nodes whose network below them
changed, after the change is complete, providing them with an oportunity
for state update
- Specified by:
networkUpdated in class BaseNode
doRemove
protected void doRemove(RuleRemovalContext context,
ReteooBuilder builder,
InternalWorkingMemory[] workingMemories)
- Description copied from class:
BaseNode
- Removes the node from teh network. Usually from the parent
ObjectSource or TupleSource
- Specified by:
doRemove in class BaseNode
doCollectAncestors
protected void doCollectAncestors(NodeSet nodeSet)
- Specified by:
doCollectAncestors in class BaseNode
isInUse
public boolean isInUse()
- Description copied from class:
BaseNode
- Returns true in case the current node is in use (is referenced by any other node)
- Specified by:
isInUse in class BaseNode
- Returns:
updateNewNode
public void updateNewNode(InternalWorkingMemory workingMemory,
PropagationContext context)
isLeftTupleMemoryEnabled
public boolean isLeftTupleMemoryEnabled()
- Specified by:
isLeftTupleMemoryEnabled in interface LeftTupleSink
setLeftTupleMemoryEnabled
public void setLeftTupleMemoryEnabled(boolean tupleMemoryEnabled)
- Specified by:
setLeftTupleMemoryEnabled in interface LeftTupleSink
getSubRule
public GroupElement getSubRule()
- Specified by:
getSubRule in interface TerminalNode
- Returns:
- the subrule
isFireDirect
public boolean isFireDirect()
- Specified by:
isFireDirect in interface TerminalNode
getDeclarations
public Declaration[] getDeclarations()
- Specified by:
getDeclarations in interface TerminalNode
getSubruleIndex
public int getSubruleIndex()
getPreviousLeftTupleSinkNode
public LeftTupleSinkNode getPreviousLeftTupleSinkNode()
- Returns the previous node
- Specified by:
getPreviousLeftTupleSinkNode in interface LeftTupleSinkNode
- Returns:
- The previous TupleSinkNode
setPreviousLeftTupleSinkNode
public void setPreviousLeftTupleSinkNode(LeftTupleSinkNode previous)
- Sets the previous node
- Specified by:
setPreviousLeftTupleSinkNode in interface LeftTupleSinkNode
- Parameters:
previous - The previous TupleSinkNode
getNextLeftTupleSinkNode
public LeftTupleSinkNode getNextLeftTupleSinkNode()
- Returns the next node
- Specified by:
getNextLeftTupleSinkNode in interface LeftTupleSinkNode
- Returns:
- The next TupleSinkNode
setNextLeftTupleSinkNode
public void setNextLeftTupleSinkNode(LeftTupleSinkNode next)
- Sets the next node
- Specified by:
setNextLeftTupleSinkNode in interface LeftTupleSinkNode
- Parameters:
next - The next TupleSinkNode
getType
public short getType()
- Specified by:
getType in interface NetworkNode- Specified by:
getType in interface LeftTupleSink
createLeftTuple
public LeftTuple createLeftTuple(InternalFactHandle factHandle,
LeftTupleSink sink,
boolean leftTupleMemoryEnabled)
- Specified by:
createLeftTuple in interface LeftTupleSink
createLeftTuple
public LeftTuple createLeftTuple(InternalFactHandle factHandle,
LeftTuple leftTuple,
LeftTupleSink sink)
- Specified by:
createLeftTuple in interface LeftTupleSink
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple,
LeftTupleSink sink,
PropagationContext pctx,
boolean leftTupleMemoryEnabled)
- Specified by:
createLeftTuple in interface LeftTupleSink
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple,
RightTuple rightTuple,
LeftTupleSink sink)
- Specified by:
createLeftTuple in interface LeftTupleSink
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple,
RightTuple rightTuple,
LeftTuple currentLeftChild,
LeftTuple currentRightChild,
LeftTupleSink sink,
boolean leftTupleMemoryEnabled)
- Specified by:
createLeftTuple in interface LeftTupleSink
getLeftInputOtnId
public ObjectTypeNode.Id getLeftInputOtnId()
- Specified by:
getLeftInputOtnId in interface LeftTupleSink
setLeftInputOtnId
public void setLeftInputOtnId(ObjectTypeNode.Id leftInputOtnId)
- Specified by:
setLeftInputOtnId in interface LeftTupleSink
createPeer
public LeftTuple createPeer(LeftTuple original)
- Specified by:
createPeer in interface LeftTupleSink- Overrides:
createPeer in class AbstractTerminalNode
getSalienceDeclarations
public Declaration[] getSalienceDeclarations()
- Specified by:
getSalienceDeclarations in interface TerminalNode
getTimerPeriodDeclarations
public Declaration[] getTimerPeriodDeclarations()
- Specified by:
getTimerPeriodDeclarations in interface TerminalNode
getTimerDelayDeclarations
public Declaration[] getTimerDelayDeclarations()
- Specified by:
getTimerDelayDeclarations in interface TerminalNode
Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.