Examples of Accumulate


Examples of org.drools.core.rule.Accumulate

            Accumulator accumulator = new MVELAccumulatorFunctionExecutor( compilationUnit,
                                                                           accFunction );
            ((MVELCompileable) accumulator).compile( data );

            Accumulate accumulate = new Accumulate( sourcePattern,
                                                    new Declaration[]{}, // required declaration
                                                    new Accumulator[]{accumulator},
                                                    false );
            AccumulateNode accNode = new AccumulateNode( buildContext.getNextId(),
                                                         leftTupleSource,
View Full Code Here

Examples of org.drools.core.rule.Accumulate

        this.accumulator = new MockAccumulator();

        final ObjectType srcObjType = new ClassObjectType(String.class);
        final Pattern sourcePattern = new Pattern(0,
                                                  srcObjType);
        this.accumulate = new Accumulate(sourcePattern,
                                         new Declaration[0],
                                         new Accumulator[]{this.accumulator},
                                         false);

        this.node = new AccumulateNode(15,
View Full Code Here

Examples of org.drools.core.rule.Accumulate

        final boolean readLocalsFromTuple = PackageBuilderUtil.isReadLocalsFromTuple(accumDescr, source);
       
        Map<String, Declaration> declsInScope = context.getDeclarationResolver().getDeclarations( context.getRule() );
        Map<String, Class< ? >> declCls = DeclarationScopeResolver.getDeclarationClasses( declsInScope );

        Accumulate accumulate;
        if ( accumDescr.isExternalFunction() ) {
            // if it uses 1+ external function, build methods for them
            accumulate = buildExternalFunctionCall( context,
                                                    accumDescr,
                                                    source,
View Full Code Here

Examples of org.drools.core.rule.Accumulate

        if (srcLeftTuples.getInsertFirst() != null) {
            doLeftInserts(accNode, sink, am, wm, srcLeftTuples, tempLeftTuples);
        }

        Accumulate accumulate = accNode.getAccumulate();
        // we do not need collect retracts. RightTuple retracts end up as updates for lefttuples.
        // LeftTuple retracts are already on the trgLeftTuples
        for (LeftTuple leftTuple = tempLeftTuples.getInsertFirst(); leftTuple != null; ) {
            LeftTuple next = leftTuple.getStagedNext();
            evaluateResultConstraints(accNode, sink, accumulate, leftTuple, leftTuple.getPropagationContext(),
View Full Code Here

Examples of org.drools.core.rule.Accumulate

                              AccumulateMemory am,
                              InternalWorkingMemory wm,
                              LeftTupleSets srcLeftTuples,
                              LeftTupleSets trgLeftTuples) {

        Accumulate accumulate = accNode.getAccumulate();
        BetaMemory bm = am.getBetaMemory();
        LeftTupleMemory ltm = bm.getLeftTupleMemory();
        RightTupleMemory rtm = bm.getRightTupleMemory();
        ContextEntry[] contextEntry = bm.getContext();
        BetaConstraints constraints = accNode.getRawConstraints();

        boolean leftTupleMemoryEnabled = accNode.isLeftTupleMemoryEnabled();
        if (leftTupleMemoryEnabled && srcLeftTuples.insertSize() > 32 && ltm instanceof AbstractHashTable) {
            ((AbstractHashTable) ltm).ensureCapacity(srcLeftTuples.insertSize());
        }

        for (LeftTuple leftTuple = srcLeftTuples.getInsertFirst(); leftTuple != null; ) {
            LeftTuple next = leftTuple.getStagedNext();

            boolean useLeftMemory = leftTupleMemoryEnabled || RuleNetworkEvaluator.useLeftMemory(accNode, leftTuple);

            if (useLeftMemory) {
                ltm.add(leftTuple);
            }

            PropagationContext context = leftTuple.getPropagationContext();

            AccumulateContext accresult = new AccumulateContext();


            leftTuple.setObject(accresult);

            accresult.context = accumulate.createContext();

            accumulate.init(am.workingMemoryContext,
                            accresult.context,
                            leftTuple,
                            wm);

            constraints.updateFromTuple(contextEntry,
View Full Code Here

Examples of org.drools.core.rule.Accumulate

                               LeftTupleSink sink,
                               AccumulateMemory am,
                               InternalWorkingMemory wm,
                               RightTupleSets srcRightTuples,
                               LeftTupleSets trgLeftTuples) {
        Accumulate accumulate = accNode.getAccumulate();

        BetaMemory bm = am.getBetaMemory();
        LeftTupleMemory ltm = bm.getLeftTupleMemory();
        RightTupleMemory rtm = bm.getRightTupleMemory();
        ContextEntry[] contextEntry = bm.getContext();
View Full Code Here

Examples of org.drools.core.rule.Accumulate

                              InternalWorkingMemory wm,
                              LeftTupleSets srcLeftTuples,
                              LeftTupleSets trgLeftTuples) {
        BetaMemory bm = am.getBetaMemory();
        RightTupleMemory rtm = bm.getRightTupleMemory();
        Accumulate accumulate = accNode.getAccumulate();
        ContextEntry[] contextEntry = bm.getContext();
        BetaConstraints constraints = accNode.getRawConstraints();

        for (LeftTuple leftTuple = srcLeftTuples.getUpdateFirst(); leftTuple != null; ) {
            LeftTuple next = leftTuple.getStagedNext();
View Full Code Here

Examples of org.drools.core.rule.Accumulate

                               LeftTupleSets trgLeftTuples) {
        BetaMemory bm = am.getBetaMemory();
        LeftTupleMemory ltm = bm.getLeftTupleMemory();
        ContextEntry[] contextEntry = bm.getContext();
        BetaConstraints constraints = accNode.getRawConstraints();
        Accumulate accumulate = accNode.getAccumulate();

        for (RightTuple rightTuple = srcRightTuples.getUpdateFirst(); rightTuple != null; ) {
            RightTuple next = rightTuple.getStagedNext();
            PropagationContext context = rightTuple.getPropagationContext();
View Full Code Here

Examples of org.drools.core.rule.Accumulate

                              LeftTupleSets srcLeftTuples,
                              LeftTupleSets trgLeftTuples) {
        BetaMemory bm = am.getBetaMemory();
        LeftTupleMemory ltm = bm.getLeftTupleMemory();
        //ContextEntry[] contextEntry = bm.getContext();
        Accumulate accumulate = accNode.getAccumulate();

        for (LeftTuple leftTuple = srcLeftTuples.getDeleteFirst(); leftTuple != null; ) {
            LeftTuple next = leftTuple.getStagedNext();
            if (leftTuple.getMemory() != null) {
                // it may have been staged and never actually added
View Full Code Here

Examples of org.drools.core.rule.Accumulate

                               AccumulateMemory am,
                               InternalWorkingMemory wm,
                               RightTupleSets srcRightTuples,
                               LeftTupleSets trgLeftTuples) {
        RightTupleMemory rtm = am.getBetaMemory().getRightTupleMemory();
        Accumulate accumulate = accNode.getAccumulate();

        for (RightTuple rightTuple = srcRightTuples.getDeleteFirst(); rightTuple != null; ) {
            RightTuple next = rightTuple.getStagedNext();
            if (rightTuple.getMemory() != null) {
                // it may have been staged and never actually added
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.