Package org.drools.core.reteoo
Class ExistsNode
- java.lang.Object
-
- org.drools.core.common.BaseNode
-
- org.drools.core.reteoo.LeftTupleSource
-
- org.drools.core.reteoo.BetaNode
-
- org.drools.core.reteoo.ExistsNode
-
- All Implemented Interfaces:
java.io.Serializable
,org.drools.base.common.NetworkNode
,MemoryFactory
,LeftTupleNode
,LeftTupleSink
,LeftTupleSinkNode
,ObjectSink
,ObjectSinkNode
,RightTupleSink
,Sink
public class ExistsNode extends BetaNode
ExistsNode
extendsBetaNode
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 anyActivation
s 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 andFactHandleImpl
s. Each fact handle is stored in the right memory.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.drools.core.reteoo.BetaNode
constraints, indexedUnificationJoin, isLogTraceEnabled, log, objectMemory, rightInput, rightInputIsRiaNode, tupleMemoryEnabled
-
Fields inherited from class org.drools.core.reteoo.LeftTupleSource
leftDeclaredMask, leftInferredMask, leftInput, leftNegativeMask, sink
-
Fields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId, partitionsEnabled
-
-
Constructor Summary
Constructors Constructor Description ExistsNode()
ExistsNode(int id, LeftTupleSource leftInput, ObjectSource rightInput, BetaConstraints joinNodeBinder, BuildContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LeftTuple
createLeftTuple(InternalFactHandle factHandle, boolean leftTupleMemoryEnabled)
LeftTuple
createLeftTuple(InternalFactHandle factHandle, LeftTuple leftTuple, Sink sink)
LeftTuple
createLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, LeftTuple currentLeftChild, LeftTuple currentRightChild, Sink sink, boolean leftTupleMemoryEnabled)
LeftTuple
createLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, Sink sink)
LeftTuple
createLeftTuple(LeftTuple leftTuple, Sink sink, PropagationContext pctx, boolean leftTupleMemoryEnabled)
LeftTuple
createPeer(LeftTuple original)
boolean
doRemove(RuleRemovalContext context, ReteooBuilder builder)
Removes the node from the network.short
getType()
boolean
isLeftUpdateOptimizationAllowed()
void
modifyRightTuple(RightTuple rightTuple, PropagationContext context, ReteEvaluator reteEvaluator)
void
retractRightTuple(RightTuple rightTuple, PropagationContext pctx, ReteEvaluator reteEvaluator)
java.lang.String
toString()
-
Methods inherited from class org.drools.core.reteoo.BetaNode
assertObject, byPassModifyToBetaNode, calculateHashCode, createMemory, createRightTuple, doAttach, doDeleteRightTuple, doUpdateRightTuple, equals, getBetaMemory, getBetaMemoryFromRightInput, getConstraints, getFirstLeftTuple, getFirstRightTuple, getFirstTuple, getLeftIterator, getNextLeftTupleSinkNode, getNextObjectSinkNode, getObjectTypeNode, getPreviousLeftTupleSinkNode, getPreviousObjectSinkNode, getRawConstraints, getRightDeclaredMask, getRightInferredMask, getRightInput, getRightInputOtnId, getRightIterator, getRightNegativeMask, getRules, getStartTuple, initDeclaredMask, initInferredMask, initInferredMask, isIndexedUnificationJoin, isLeftTupleMemoryEnabled, isObjectMemoryEnabled, isRightInputIsRiaNode, isRightInputPassive, modifyObject, networkUpdated, reorderRightTuple, setLeftListenedProperties, setNextLeftTupleSinkNode, setNextObjectSinkNode, setPartitionId, setPreviousLeftTupleSinkNode, setPreviousObjectSinkNode, setRightInput, setRightInputOtnId, unwrapRightInput
-
Methods inherited from class org.drools.core.reteoo.LeftTupleSource
addTupleSink, addTupleSink, addTupleSink, getFirstLeftTupleSinkIgnoreRemoving, getLeftDeclaredMask, getLeftInferredMask, getLeftInputOtnId, getLeftInputPattern, getLeftNegativeMask, getLeftTupleSource, getObjectCount, getObjectType, getObjectTypeForPropertyReactivity, getPathIndex, getSinkPropagator, initMasks, isInUse, removeTupleSink, setLeftInferredMask, setLeftInputOtnId, setLeftTupleSource, setNodeConstraintsPropertyReactiveMask, setObjectCount, setPartitionIdWithSinks, setSourcePartitionId, setSourcePartitionId
-
Methods inherited from class org.drools.core.common.BaseNode
addAssociatedTerminal, addAssociation, addAssociation, attach, getAssociatedRules, getAssociatedTerminalsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hasAssociatedTerminal, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociatedTerminal, removeAssociation, setId, setPartitionsEnabled, setStreamMode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.reteoo.LeftTupleNode
getLeftTupleSource, getObjectCount, getPathIndex, getSinkPropagator, setObjectCount
-
Methods inherited from interface org.drools.core.reteoo.LeftTupleSink
getLeftInferredMask, getLeftInputOtnId, setLeftInputOtnId, setPartitionIdWithSinks
-
Methods inherited from interface org.drools.core.common.MemoryFactory
getMemoryId
-
Methods inherited from interface org.drools.base.common.NetworkNode
addAssociatedTerminal, getAssociatedRules, getAssociatedTerminalsSize, getId, getPartitionId, getSinks, hasAssociatedTerminal, isAssociatedWith, removeAssociatedTerminal
-
Methods inherited from interface org.drools.core.reteoo.ObjectSinkNode
setPartitionIdWithSinks
-
-
-
-
Constructor Detail
-
ExistsNode
public ExistsNode()
-
ExistsNode
public ExistsNode(int id, LeftTupleSource leftInput, ObjectSource rightInput, BetaConstraints joinNodeBinder, BuildContext context)
-
-
Method Detail
-
getType
public short getType()
- Specified by:
getType
in interfaceorg.drools.base.common.NetworkNode
- Specified by:
getType
in classLeftTupleSource
-
createLeftTuple
public LeftTuple createLeftTuple(InternalFactHandle factHandle, boolean leftTupleMemoryEnabled)
-
createLeftTuple
public LeftTuple createLeftTuple(InternalFactHandle factHandle, LeftTuple leftTuple, Sink sink)
-
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)
-
createPeer
public LeftTuple createPeer(LeftTuple original)
- Specified by:
createPeer
in interfaceLeftTupleSink
- Specified by:
createPeer
in classLeftTupleSource
-
retractRightTuple
public void retractRightTuple(RightTuple rightTuple, PropagationContext pctx, ReteEvaluator reteEvaluator)
-
modifyRightTuple
public void modifyRightTuple(RightTuple rightTuple, PropagationContext context, ReteEvaluator reteEvaluator)
-
doRemove
public boolean doRemove(RuleRemovalContext context, ReteooBuilder builder)
Description copied from class:BaseNode
Removes the node from the network. Usually from the parentObjectSource
orTupleSource
-
isLeftUpdateOptimizationAllowed
public boolean isLeftUpdateOptimizationAllowed()
-
-