}else if ( tupleSource.getType() == NodeTypeEnums.FromNode ) {
FromMemory fromMemory = ( FromMemory ) smem.createNodeMemory( ( FromNode ) tupleSource, wm );
fromMemory.getBetaMemory().setSegmentMemory( smem );
}
LeftTupleSinkPropagator sink = tupleSource.getSinkPropagator();
LeftTupleSinkNode firstSink = (LeftTupleSinkNode) sink.getFirstLeftTupleSink() ;
LeftTupleSinkNode secondSink = firstSink.getNextLeftTupleSinkNode();
if ( secondSink == null ) {
if ( NodeTypeEnums.isLeftTupleSource( firstSink ) ) {
tupleSource = ( LeftTupleSource ) firstSink;
} else {
// rtn or rian
// While not technically in a segment, we want to be able to iterate easily from the last node memory to the ria/rtn memory
// we don't use createNodeMemory, as these may already have been created by, but not added, by the method updateRiaAndTerminalMemory
if ( firstSink.getType() == NodeTypeEnums.RightInputAdaterNode) {
RiaNodeMemory memory = ( RiaNodeMemory) wm.getNodeMemory( (MemoryFactory) firstSink );
smem.getNodeMemories().add( memory.getRiaRuleMemory() );
memory.getRiaRuleMemory().setSegmentMemory( smem );
} else if ( NodeTypeEnums.isTerminalNode( firstSink) ) {
RuleMemory rmem = ( RuleMemory ) wm.getNodeMemory( (MemoryFactory) firstSink );
smem.getNodeMemories().add( rmem );
rmem.setSegmentMemory( smem );
}
smem.setTipNode( firstSink );
break;
}
} else if ( sink.size() == 2 &&
NodeTypeEnums.isBetaNode( secondSink ) &&
((BetaNode)secondSink).isRightInputIsRiaNode() ) {
// must be a subnetwork split, always take the non riaNode path
tupleSource = ( LeftTupleSource )secondSink;
} else {