Package org.drools.reteoo

Examples of org.drools.reteoo.AccumulateNode$AccumulateContext


    @Override
    protected void doVisit(NetworkNode node,
                           Stack<NetworkNode> nodeStack,
                           StatefulKnowledgeSessionInfo info) {
        AccumulateNode an = (AccumulateNode) node;
        DefaultNodeInfo ni = (DefaultNodeInfo) info.getNodeInfo( node );
        final AccumulateMemory memory = (AccumulateMemory) info.getSession().getNodeMemory( an );
       
        ni.setMemoryEnabled( true );
       
        if( an.isObjectMemoryEnabled() ) {
            ni.setFactMemorySize( memory.betaMemory.getRightTupleMemory().size() );
        }
        if( an.isLeftTupleMemoryEnabled() ) {
            ni.setTupleMemorySize( memory.betaMemory.getLeftTupleMemory().size() );
            ni.setCreatedFactHandles( memory.betaMemory.getCreatedHandles().size() );
        }

    }
View Full Code Here


        if( ! context.getBehaviors().isEmpty() ) {
            behaviors = (Behavior[]) context.getBehaviors().toArray( new Behavior[ context.getBehaviors().size() ]);
        }

        context.setTupleSource( (LeftTupleSource) utils.attachNode( context,
                                                                new AccumulateNode( context.getNextId(),
                                                                                    context.getTupleSource(),
                                                                                    context.getObjectSource(),
                                                                                    (AlphaNodeFieldConstraint[]) resultAlphaConstraints.toArray( new AlphaNodeFieldConstraint[resultAlphaConstraints.size()] ),
                                                                                    sourceBinder,
                                                                                    resultsBinder,
View Full Code Here

    @Override
    protected void doVisit(NetworkNode node,
                           Stack<NetworkNode> nodeStack,
                           StatefulKnowledgeSessionInfo info) {
        AccumulateNode an = (AccumulateNode) node;
        DefaultNodeInfo ni = (DefaultNodeInfo) info.getNodeInfo( node );
        final AccumulateMemory memory = (AccumulateMemory) info.getSession().getNodeMemory( an );
       
        ni.setMemoryEnabled( true );
       
        if( an.isObjectMemoryEnabled() ) {
            ni.setFactMemorySize( memory.betaMemory.getRightTupleMemory().size() );
        }
        if( an.isLeftTupleMemoryEnabled() ) {
            ni.setTupleMemorySize( memory.betaMemory.getLeftTupleMemory().size() );
            FastIterator it =  memory.betaMemory.getLeftTupleMemory().fullFastIterator();
           
            int i = 0;
            for ( LeftTuple leftTuple = BetaNode.getFirstLeftTuple( memory.betaMemory.getLeftTupleMemory(), it ); leftTuple != null; leftTuple = ( LeftTuple) it.next( leftTuple  )) {
View Full Code Here

        final BetaConstraints sourceBinder = utils.createBetaNodeConstraint( context,
                                                                             context.getBetaconstraints(),
                                                                             false );

        context.setTupleSource( (TupleSource) utils.attachNode( context,
                                                                new AccumulateNode( context.getNextId(),
                                                                                    context.getTupleSource(),
                                                                                    context.getObjectSource(),
                                                                                    (AlphaNodeFieldConstraint[]) resultAlphaConstraints.toArray( new AlphaNodeFieldConstraint[resultAlphaConstraints.size()] ),
                                                                                    sourceBinder,
                                                                                    resultsBinder,
View Full Code Here

            Accumulate accumulate = new Accumulate( sourcePattern,
                                                    new Declaration[]{}, // required declaration
                                                    new Declaration[]{}, // inner declarations
                                                    new Accumulator[]{accumulator},
                                                    false );
            AccumulateNode accNode = new AccumulateNode( buildContext.getNextId(),
                                                         leftTupleSource,
                                                         rightObjectSource,
                                                         alphaResultConstraint,
                                                         betaSourceConstraints,
                                                         new EmptyBetaConstraints(),
                                                         accumulate,
                                                         false,
                                                         buildContext );

            accNode.attach();
            context.put( name,
                         accNode );

        } else {
            StringBuilder msgBuilder = new StringBuilder();
View Full Code Here

            Accumulate accumulate = new Accumulate( sourcePattern,
                                                    new Declaration[]{}, // required declaration
                                                    new Accumulator[]{accumulator},
                                                    false );
            AccumulateNode accNode = new AccumulateNode( buildContext.getNextId(),
                                                         leftTupleSource,
                                                         rightObjectSource,
                                                         alphaResultConstraint,
                                                         betaSourceConstraints,
                                                         new EmptyBetaConstraints(),
                                                         accumulate,
                                                         false,
                                                         buildContext );

            accNode.attach(buildContext);
            context.put( name,
                         accNode );

        } else {
            StringBuilder msgBuilder = new StringBuilder();
View Full Code Here

                                                sourcePattern.getRequiredDeclarations(),
                                                (Declaration[]) collect.getInnerDeclarations().values().toArray( new Declaration[0] ),
                                                new Accumulator[] { accumulator },
                                                false );
        context.setTupleSource( (LeftTupleSource) utils.attachNode( context,
                                                                    new AccumulateNode( context.getNextId(),
                                                                                        context.getTupleSource(),
                                                                                        context.getObjectSource(),
                                                                                        (AlphaNodeFieldConstraint[]) resultAlphaConstraints.toArray( new AlphaNodeFieldConstraint[resultAlphaConstraints.size()] ),
                                                                                        binder, // source binder
                                                                                        resultBinder,
View Full Code Here

TOP

Related Classes of org.drools.reteoo.AccumulateNode$AccumulateContext

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.