public void retractRightTuple(final RightTuple rightTuple,
final PropagationContext context,
final InternalWorkingMemory workingMemory) {
final BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( this );
if ( isUnlinkingEnabled() ) {
RightTupleSets stagedRightTuples = memory.getStagedRightTuples();
switch ( rightTuple.getStagedType() ) {
// handle clash with already staged entries
case LeftTuple.INSERT:
stagedRightTuples.removeInsert( rightTuple );
break;
case LeftTuple.UPDATE:
stagedRightTuples.removeUpdate( rightTuple );
break;
}
if ( memory.getAndDecCounter() == 1 && isEmptyBetaConstraints() ) {
// NotNodes can only be unlinked, if they have no variable constraints
memory.linkNode( workingMemory );
} else if ( stagedRightTuples.deleteSize() == 0 ) {
// nothing staged before, notify rule, so it can evaluate network
memory.getSegmentMemory().notifyRuleLinkSegment( workingMemory );
}
stagedRightTuples.addDelete( rightTuple );
return;
}
RightTupleMemory rtm = memory.getRightTupleMemory();
if ( rightTuple.getBlocked() != null ) {