protected void doRemove(final RuleRemovalContext context, final ReteooBuilder builder, final InternalWorkingMemory[] workingMemories) { if ( !this.isInUse() ) { for( InternalWorkingMemory workingMemory : workingMemories ) { workingMemory.clearNodeMemory( this ); } tupleSource.removeTupleSink( this ); } else { throw new RuntimeException("ConditionalBranchNode cannot be shared"); } }
protected void doRemove(final RuleRemovalContext context, final ReteooBuilder builder, final InternalWorkingMemory[] workingMemories) { if ( !this.isInUse() ) { for( InternalWorkingMemory workingMemory : workingMemories ) { workingMemory.clearNodeMemory( this ); } tupleSource.removeTupleSink( this ); } else { // need to re-wire eval expression to the same one from another rule // that is sharing this node Entry<Rule, RuleComponent> next = this.getAssociations().entrySet().iterator().next(); this.condition = (EvalCondition) next.getValue(); } }
protected void doRemove(RuleRemovalContext context, ReteooBuilder builder, InternalWorkingMemory[] workingMemories) { if (!isInUse()) { for ( InternalWorkingMemory workingMemory : workingMemories ) { workingMemory.clearNodeMemory( this ); } tupleSource.removeTupleSink(this); } }
protected void doRemove(final RuleRemovalContext context, final ReteooBuilder builder, final InternalWorkingMemory[] workingMemories) { if ( !this.isInUse() && this instanceof NodeMemory ) { for( InternalWorkingMemory workingMemory : workingMemories ) { workingMemory.clearNodeMemory( (NodeMemory) this ); } } if ( !isInUse() && this instanceof ObjectSink ) { this.source.removeObjectSink((ObjectSink) this); } }
protected void doRemove(final RuleRemovalContext context, final ReteooBuilder builder, final InternalWorkingMemory[] workingMemories) { if ( !this.isInUse() ) { for ( InternalWorkingMemory workingMemory : workingMemories ) { FromMemory memory = (FromMemory) workingMemory.getNodeMemory( this ); Iterator it = memory.betaMemory.getLeftTupleMemory().iterator(); for ( LeftTuple leftTuple = (LeftTuple) it.next(); leftTuple != null; leftTuple = (LeftTuple) it.next() ) { unlinkCreatedHandles( workingMemory, memory, leftTuple ); leftTuple.unlinkFromLeftParent(); leftTuple.unlinkFromRightParent(); } workingMemory.clearNodeMemory( this ); } tupleSource.removeTupleSink( this ); } }
protected void doRemove(final RuleRemovalContext context, final ReteooBuilder builder, final InternalWorkingMemory[] workingMemories) { if ( !this.isInUse() ) { for ( InternalWorkingMemory workingMemory : workingMemories ) { final RIAMemory memory = (RIAMemory) workingMemory.getNodeMemory( this ); Iterator it = memory.memory.iterator(); for ( ObjectEntry entry = (ObjectEntry) it.next(); entry != null; entry = (ObjectEntry) it.next() ) { LeftTuple leftTuple = (LeftTuple) entry.getKey(); leftTuple.unlinkFromLeftParent(); leftTuple.unlinkFromRightParent(); } workingMemory.clearNodeMemory( this ); } } if ( !isInUse() ) { tupleSource.removeTupleSink(this); } }
rightTuple = tmp; workingMemory.clearNodeMemory(this);