org.drools.reteoo
Class ExistsNode
java.lang.Object
org.drools.common.BaseNode
org.drools.reteoo.LeftTupleSource
org.drools.reteoo.BetaNode
org.drools.reteoo.ExistsNode
- All Implemented Interfaces:
- Externalizable, Serializable, NetworkNode, NodeMemory, LeftTupleSink, LeftTupleSinkNode, ObjectSink, ObjectSinkNode, RightTupleSink, Sink
public class ExistsNode
- extends BetaNode
ExistsNode
extends BetaNode
to perform tests for
the existence of a Fact plus one or more conditions. Where existence
is found the left ReteTuple is copied and propagated. Further to this it
maintains the "truth" by canceling any
Activations that are no longer
considered true by the retraction of ReteTuple's or FactHandleImpl.
Tuples are considered to be asserted from the left input and facts from the right input.
The BetaNode
provides the BetaMemory to store asserted ReteTuples and
FactHandleImpls. Each fact handle is stored in the right
memory.
- See Also:
- Serialized Form
Method Summary |
void |
assertLeftTuple(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
Assert a new ReteTuple from the left input. |
void |
assertObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
Assert a new FactHandleImpl from the right input. |
LeftTuple |
createLeftTuple(InternalFactHandle factHandle,
LeftTupleSink sink,
boolean leftTupleMemoryEnabled)
|
LeftTuple |
createLeftTuple(LeftTuple leftTuple,
LeftTupleSink sink,
boolean leftTupleMemoryEnabled)
|
LeftTuple |
createLeftTuple(LeftTuple leftTuple,
RightTuple rightTuple,
LeftTuple currentLeftChild,
LeftTuple currentRightChild,
LeftTupleSink sink,
boolean leftTupleMemoryEnabled)
|
LeftTuple |
createLeftTuple(LeftTuple leftTuple,
RightTuple rightTuple,
LeftTupleSink sink)
|
Memory |
createMemory(RuleBaseConfiguration config)
|
short |
getType()
|
void |
modifyLeftTuple(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
modifyRightTuple(RightTuple rightTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
retractLeftTuple(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
Retract the
ReteTuple, any resulting propagated joins are also retracted. |
void |
retractRightTuple(RightTuple rightTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
Retract the FactHandleImpl . |
String |
toString()
|
void |
updateSink(LeftTupleSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory)
Updates the given sink propagating all previously propagated tuples to it |
Methods inherited from class org.drools.reteoo.BetaNode |
attach, attach, createMemory, createRightTuple, doRemove, dumpMemory, equals, getBehaviors, getConstraints, getFirstLeftTuple, getFirstLeftTuple, getFirstRightTuple, getFirstRightTuple, getLeftIterator, getLeftTupleSource, getNextLeftTupleSinkNode, getNextObjectSinkNode, getObjectTypeNode, getPreviousLeftTupleSinkNode, getPreviousObjectSinkNode, getRawConstraints, getRightIterator, getRules, hashCode, isConcurrentRightTupleMemory, isLeftTupleMemoryEnabled, isObjectMemoryEnabled, leftUnlinked, modifyLeftTuple, modifyObject, networkUpdated, readExternal, rightUnlinked, setConcurrentRightTupleMemory, setLeftTupleMemoryEnabled, setNextLeftTupleSinkNode, setNextObjectSinkNode, setObjectMemoryEnabled, setPreviousLeftTupleSinkNode, setPreviousObjectSinkNode, setUnificationJoin, writeExternal |
ExistsNode
public ExistsNode()
ExistsNode
public ExistsNode(int id,
LeftTupleSource leftInput,
ObjectSource rightInput,
BetaConstraints joinNodeBinder,
Behavior[] behaviors,
BuildContext context)
- Construct.
- Parameters:
id
- The unique id for this node.leftInput
- The left input TupleSource
.rightInput
- The right input ObjectSource
.joinNodeBinder
- The constraints to be applied to the right objects
assertLeftTuple
public void assertLeftTuple(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Assert a new
ReteTuple
from the left input. It iterates
over the right FactHandleImpl
's and if any match is found,
a copy of the ReteTuple
is made and propagated.
- Parameters:
tuple
- The Tuple
being asserted.context
- The PropagationContext
workingMemory
- The working memory session.
assertObject
public void assertObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Assert a new
FactHandleImpl
from the right input. If it
matches any left ReteTuple's that had no matches before, propagate
tuple as an assertion.
- Parameters:
factHandle
- The FactHandleImpl
being asserted.context
- The PropagationContext
workingMemory
- The working memory session.
retractRightTuple
public void retractRightTuple(RightTuple rightTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Retract the
FactHandleImpl
. If the handle has any
ReteTuple
matches and those tuples now have no
other match, retract tuple
- Parameters:
handle
- the being retractedcontext
- The PropagationContext
workingMemory
- The working memory session.
retractLeftTuple
public void retractLeftTuple(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Retract the
ReteTuple, any resulting propagated joins are also retracted.
- Parameters:
leftTuple
- The tuple being retractedcontext
- The PropagationContext
workingMemory
- The working memory session.
modifyLeftTuple
public void modifyLeftTuple(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
modifyRightTuple
public void modifyRightTuple(RightTuple rightTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
updateSink
public void updateSink(LeftTupleSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Updates the given sink propagating all previously propagated tuples to it
- Specified by:
updateSink
in class LeftTupleSource
toString
public String toString()
- Overrides:
toString
in class BetaNode
getType
public short getType()
createLeftTuple
public LeftTuple createLeftTuple(InternalFactHandle factHandle,
LeftTupleSink sink,
boolean leftTupleMemoryEnabled)
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple,
LeftTupleSink sink,
boolean leftTupleMemoryEnabled)
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple,
RightTuple rightTuple,
LeftTupleSink sink)
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple,
RightTuple rightTuple,
LeftTuple currentLeftChild,
LeftTuple currentRightChild,
LeftTupleSink sink,
boolean leftTupleMemoryEnabled)
createMemory
public Memory createMemory(RuleBaseConfiguration config)
Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.