Package org.drools.reteoo

Examples of org.drools.reteoo.LeftInputAdapterNode$RightTupleSinkAdapter


    public JoinNode buildJoinNode( int id, LeftTupleSource leftInput, ObjectSource rightInput, BetaConstraints binder, BuildContext context ) {
        return new JoinNode( id, leftInput, rightInput, binder, context );
    }

    public LeftInputAdapterNode buildLeftInputAdapterNode( int id, ObjectSource objectSource, BuildContext context ) {
        return new LeftInputAdapterNode( id, objectSource, context );
    }
View Full Code Here


    public int evaluateNetwork(InternalWorkingMemory wm) {
        SegmentMemory[] smems = rmem.getSegmentMemories();

        int smemIndex = 0;
        SegmentMemory smem = smems[smemIndex]; // 0
        LeftInputAdapterNode liaNode = (LeftInputAdapterNode) smem.getRootNode();

        LinkedList<Memory> nodeMemories = smem.getNodeMemories();

        LiaNodeMemory liaNodeMemory = (LiaNodeMemory) nodeMemories.getFirst();

        StagedLeftTuples trgTuples = new StagedLeftTuples();
        StagedLeftTuples srcTuples = smem.getStagedLeftTuples();
        pLiaNode.doNode( liaNode, liaNodeMemory, wm, srcTuples, trgTuples );

        LeftTupleSource node = null;
        Memory nodeMem = null;
        if ( liaNode == smem.getTipNode() ) {
            // Segment only contains LiaNode, so need to propagate peers
            SegmentPropagator.propagate( smem, trgTuples, wm );
            smem = smems[smemIndex]; // 1
            nodeMem = smem.getNodeMemories().getFirst();
            node = smem.getRootNode();
        } else {
            node = (LeftTupleSource) liaNode.getSinkPropagator().getFirstLeftTupleSink(); // we know it can only have one child
            nodeMem = liaNodeMemory.getNext();
        }

        eval( node, nodeMem, smems, smemIndex, trgTuples, null, wm);
View Full Code Here

        str += "    lian0, otn1;";

        NodeTestResult result = executeTest( str );

        ObjectTypeNode otn1 = (ObjectTypeNode) result.context.get( "otn1" );
        LeftInputAdapterNode lian0 = (LeftInputAdapterNode) result.context.get( "lian0" );
        assertNotNull( lian0 );

        assertSame( lian0,
                    otn1.getSinkPropagator().getSinks()[0] );
    }
View Full Code Here

            }
        }
       
        ReteooWorkingMemory wm = ((StatefulKnowledgeSessionImpl)kbase.newStatefulKnowledgeSession()).session;
       
        LeftInputAdapterNode liaNode = (LeftInputAdapterNode) node.getSinkPropagator().getSinks()[0];
        JoinNode j2 = ( JoinNode ) liaNode.getSinkPropagator().getSinks()[0]; // $p2
        JoinNode j3 = ( JoinNode ) j2.getSinkPropagator().getSinks()[0]// $p3
       
        SingleBetaConstraints c = ( SingleBetaConstraints ) j2.getRawConstraints();
        assertEquals( "$name", ((VariableConstraint)c.getConstraint()).getRequiredDeclarations()[0].getIdentifier() );
        assertTrue( c.isIndexed() );       
View Full Code Here

        }   
       
        ReteooWorkingMemory wm = ((StatefulKnowledgeSessionImpl)kbase.newStatefulKnowledgeSession()).session;
       
        AlphaNode alphanode = ( AlphaNode ) node.getSinkPropagator().getSinks()[0];
        LeftInputAdapterNode liaNode = (LeftInputAdapterNode) alphanode.getSinkPropagator().getSinks()[0];
        JoinNode j = ( JoinNode ) liaNode.getSinkPropagator().getSinks()[0]; // $p2
       
        TripleNonIndexSkipBetaConstraints c = ( TripleNonIndexSkipBetaConstraints ) j.getRawConstraints();
        //assertEquals( "$name", ((VariableConstraint)c.getConstraint()).getRequiredDeclarations()[0].getIdentifier() );
        assertTrue( c.isIndexed() );       
        BetaMemory bm = ( BetaMemory ) wm.getNodeMemory( j );
View Full Code Here

        str += "    lian0, otn1;";

        NodeTestResult result = executeTest( str );

        ObjectTypeNode otn1 = (ObjectTypeNode) result.context.get( "otn1" );
        LeftInputAdapterNode lian0 = (LeftInputAdapterNode) result.context.get( "lian0" );
        assertNotNull( lian0 );

        assertSame( lian0,
                    otn1.getSinkPropagator().getSinks()[0] );
    }
View Full Code Here

        } else {
            throw new IllegalArgumentException( "Cannot execute arguments " + args );
        }
        ObjectTypeNode otn = (ObjectTypeNode) context.get( source );

        LeftInputAdapterNode liaNode = new LeftInputAdapterNode( buildContext.getNextId(),
                                                                 otn,
                                                                 buildContext );
        liaNode.attach();
        context.put( name,
                     liaNode );
    }
View Full Code Here

                // if a previous object source was bound, but no tuple source
                if ( context.getObjectSource() != null && context.getTupleSource() == null ) {
                    // adapt it to a Tuple source                   
                    context.setTupleSource( (LeftTupleSource) utils.attachNode( context,
                                                                                new LeftInputAdapterNode( context.getNextId(),
                                                                                                          context.getObjectSource(),
                                                                                                          context ) ) );

                    context.setObjectSource( null );
                }
View Full Code Here

    public JoinNode buildJoinNode( int id, LeftTupleSource leftInput, ObjectSource rightInput, BetaConstraints binder, BuildContext context ) {
        return new JoinNode( id, leftInput, rightInput, binder, context );
    }

    public LeftInputAdapterNode buildLeftInputAdapterNode( int id, ObjectSource objectSource, BuildContext context ) {
        return new LeftInputAdapterNode( id, objectSource, context );
    }
View Full Code Here

                // if a previous object source was bound, but no tuple source
                if ( context.getObjectSource() != null && context.getTupleSource() == null ) {
                    // adapt it to a Tuple source                   
                    context.setTupleSource( (LeftTupleSource) utils.attachNode( context,
                                                                                new LeftInputAdapterNode( context.getNextId(),
                                                                                                          context.getObjectSource(),
                                                                                                          context ) ) );

                    context.setObjectSource( null );
                }
View Full Code Here

TOP

Related Classes of org.drools.reteoo.LeftInputAdapterNode$RightTupleSinkAdapter

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.