Package org.drools.reteoo

Examples of org.drools.reteoo.LeftTupleSinkPropagator


            } 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
                    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 {
View Full Code Here


            }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 {
View Full Code Here

            smem = smems[++smemIndex]; // 1
            node = smem.getRootNode();
            nodeMem = smem.getNodeMemories().getFirst();
        } else {
            // lia is in shared segment, so point to next node
            LeftTupleSinkPropagator sink = liaNode.getSinkPropagator();
            LeftTupleSinkNode firstSink = (LeftTupleSinkNode) sink.getFirstLeftTupleSink() ;
            LeftTupleSinkNode secondSink = firstSink.getNextLeftTupleSinkNode();
            if ( sink.size() == 2 ) {
                // As we check above for segment splits, if the sink size is 2, it must be a subnetwork.
                // Always take the non riaNode path
                node = secondSink;
            } else {
                node = firstSink;
View Full Code Here

TOP

Related Classes of org.drools.reteoo.LeftTupleSinkPropagator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.