Package org.drools.core.spi

Examples of org.drools.core.spi.PropagationContext


            InternalFactHandle handle = this.handleFactory.newFactHandle( queryObject,
                                                                          null,
                                                                          this,
                                                                          this );

            final PropagationContext pCtx = pctxFactory.createPropagationContext(getNextPropagationIdCounter(), PropagationContext.INSERTION,
                                                                                 null, null, handle, getEntryPoint());

            BaseNode[] tnodes = evalQuery(queryObject.getName(), queryObject, handle, pCtx);

            executeQueuedActions();
View Full Code Here


        try {
            startOperation();
            this.kBase.readLock();
            this.lock.lock();

            final PropagationContext pCtx = pctxFactory.createPropagationContext(getNextPropagationIdCounter(), PropagationContext.INSERTION,
                                                                                 null, null, factHandle, getEntryPoint());

            LeftInputAdapterNode lian = ( LeftInputAdapterNode ) factHandle.getFirstLeftTuple().getLeftTupleSink().getLeftTupleSource();
            LeftInputAdapterNode.LiaNodeMemory lmem = (LeftInputAdapterNode.LiaNodeMemory) getNodeMemory( (MemoryFactory) lian);
            SegmentMemory lsmem = lmem.getSegmentMemory();
View Full Code Here

        InternalWorkingMemoryEntryPoint ep = (InternalWorkingMemoryEntryPoint) handle.getEntryPoint();
        ObjectTypeConf typeConf = ((InternalWorkingMemoryEntryPoint) handle.getEntryPoint()).getObjectTypeConfigurationRegistry().getObjectTypeConf( ep.getEntryPoint(), object );

        PropagationContextFactory pctxFactory = wm.getKnowledgeBase().getConfiguration().getComponentFactory().getPropagationContextFactory();

        PropagationContext propagationContext = pctxFactory.createPropagationContext(wm.getNextPropagationIdCounter(), PropagationContext.INSERTION, null, null, handle, ep.getEntryPoint(), context);
        // keeping this list for a later cleanup is necessary because of the lazy propagations that might occur
        pctxs.add( propagationContext );

        ep.getEntryPointNode().assertObject( handle,
                                             propagationContext,
                                             typeConf,
                                             wm );

        propagationContext.evaluateActionQueue( wm );
        wm.executeQueuedActions();
    }
View Full Code Here

                                   final InternalWorkingMemory wm,
                                   final BetaMemory memory) {
        RightTupleSets stagedRightTuples = memory.getStagedRightTuples();
        boolean  stagedDeleteWasEmpty = false;
        if ( streamMode ) {
            PropagationContext pctx = rightTuple.getPropagationContext();
            stagedDeleteWasEmpty = memory.getSegmentMemory().getStreamQueue().addDelete(new RightTupleEntry(rightTuple, pctx, memory, pctx.getType()));
            //log.trace( "NotNode delete queue={} size={} lt={}", System.identityHashCode( memory.getSegmentMemory().getTupleQueue() ), memory.getSegmentMemory().getTupleQueue().size(), rightTuple );
            registerUnlinkedPaths(wm, memory.getSegmentMemory(), stagedDeleteWasEmpty);
        } else {
            stagedDeleteWasEmpty = stagedRightTuples.addDelete( rightTuple );
        }
View Full Code Here

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

            PropagationContext context = leftTuple.getPropagationContext();

            AccumulateContext accresult = new AccumulateContext();


            leftTuple.setObject(accresult);
View Full Code Here

                rightTuple.clearStaged();
                rightTuple = next;
                continue;
            }

            PropagationContext context = rightTuple.getPropagationContext();
            constraints.updateFromFactHandle(contextEntry,
                                             wm,
                                             rightTuple.getFactHandle());

            FastIterator leftIt = accNode.getLeftIterator(ltm);
View Full Code Here

        for (LeftTuple leftTuple = srcLeftTuples.getUpdateFirst(); leftTuple != null; ) {
            LeftTuple next = leftTuple.getStagedNext();
            final AccumulateContext accctx = (AccumulateContext) leftTuple.getObject();

            PropagationContext context = leftTuple.getPropagationContext();

            constraints.updateFromTuple(contextEntry,
                                        wm,
                                        leftTuple);
View Full Code Here

        BetaConstraints constraints = accNode.getRawConstraints();
        Accumulate accumulate = accNode.getAccumulate();

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

            LeftTuple childLeftTuple = rightTuple.getFirstChild();

            FastIterator leftIt = accNode.getLeftIterator(ltm);
            LeftTuple leftTuple = accNode.getFirstLeftTuple(rightTuple, ltm, context, leftIt);
View Full Code Here

            }

            LeftTuple lastLeftTuple = null;
            for (; leftTuple != null; lastLeftTuple = leftTuple, leftTuple = getNextLeftTuple()) {

                PropagationContext pctx = leftTuple.getPropagationContext();
                pctx = RuleTerminalNode.findMostRecentPropagationContext(leftTuple, pctx);

                //check if the rule is not effective or
                // if the current Rule is no-loop and the origin rule is the same then return
                if (cancelAndContinue(wm, rtn, rule, leftTuple, pctx, filter)) {
View Full Code Here

        }
    }

    private static void removeQueuedTupleEntry( TupleEntryQueue tupleQueue ) {
        TupleEntry tupleEntry = tupleQueue.remove();
        PropagationContext originalPctx = tupleEntry.getPropagationContext();

        while (true) {
            processStreamTupleEntry(tupleQueue, tupleEntry);
            if (tupleQueue.isEmpty()) {
                return;
            }
            tupleEntry = tupleQueue.peek();
            PropagationContext pctx = tupleEntry.getPropagationContext();

            // repeat if either the pctx number is the same, or the event time is the same or before
            if (pctx.getPropagationNumber() != originalPctx.getPropagationNumber()) {
                break;
            }
            tupleEntry = tupleQueue.remove();
        }
    }
View Full Code Here

TOP

Related Classes of org.drools.core.spi.PropagationContext

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.