Package org.drools.core.common

Examples of org.drools.core.common.BetaConstraints


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

            for (RightTuple rightTuple = srcRightTuples.getInsertFirst(); rightTuple != null; ) {
                RightTuple next = rightTuple.getStagedNext();

                rtm.add(rightTuple);
                PropagationContext context = rightTuple.getPropagationContext();

                constraints.updateFromFactHandle(contextEntry,
                                                 wm,
                                                 rightTuple.getFactHandle());

                FastIterator leftIt = accNode.getLeftIterator(ltm);

                for (LeftTuple leftTuple = accNode.getFirstLeftTuple(rightTuple, ltm, context, leftIt); leftTuple != null; leftTuple = (LeftTuple) leftIt.next(leftTuple)) {
                    if (constraints.isAllowedCachedRight(contextEntry,
                                                         leftTuple)) {
                        final AccumulateContext accctx = (AccumulateContext) leftTuple.getObject();
                        addMatch(accNode,
                                 accumulate,
                                 leftTuple,
                                 rightTuple,
                                 null,
                                 null,
                                 wm,
                                 am,
                                 accctx,
                                 true);

                        // right inserts and updates are done first
                        // so any existing leftTuples we know are updates, but only add if not already added
                        if (leftTuple.getStagedType() == LeftTuple.NONE) {
                            trgLeftTuples.addUpdate(leftTuple);
                        }

                    }
                }

                rightTuple.clearStaged();
                rightTuple = next;
            }
            constraints.resetFactHandle(contextEntry);
        }
View Full Code Here


                                  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();
                final AccumulateContext accctx = (AccumulateContext) leftTuple.getObject();

                PropagationContext context = leftTuple.getPropagationContext();

                constraints.updateFromTuple(contextEntry,
                                            wm,
                                            leftTuple);

                FastIterator rightIt = accNode.getRightIterator(rtm);
                RightTuple rightTuple = accNode.getFirstRightTuple(leftTuple,
                                                                   rtm,
                                                                   null,
                                                                   rightIt);

                LeftTuple childLeftTuple = leftTuple.getFirstChild();

                // first check our index (for indexed nodes only) hasn't changed and we are returning the same bucket
                // if rightTuple is null, we assume there was a bucket change and that bucket is empty
                if (childLeftTuple != null && rtm.isIndexed() && !rightIt.isFullIterator() && (rightTuple == null || (rightTuple.getMemory() != childLeftTuple.getRightParent().getMemory()))) {
                    // our index has changed, so delete all the previous matchings
                    removePreviousMatchesForLeftTuple(accNode,
                                                      accumulate,
                                                      leftTuple,
                                                      wm,
                                                      am,
                                                      accctx,
                                                      true);

                    childLeftTuple = null; // null so the next check will attempt matches for new bucket
                }

                // we can't do anything if RightTupleMemory is empty
                if (rightTuple != null) {
                    doLeftUpdatesProcessChildren(accNode,
                                                 am,
                                                 wm,
                                                 bm,
                                                 accumulate,
                                                 constraints,
                                                 rightIt,
                                                 leftTuple,
                                                 accctx,
                                                 rightTuple,
                                                 childLeftTuple);
                }

                leftTuple.clearStaged();
                trgLeftTuples.addUpdate(leftTuple);

                leftTuple = next;
            }
            constraints.resetTuple(contextEntry);
        }
View Full Code Here

                                   RightTupleSets srcRightTuples,
                                   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();

                LeftTuple childLeftTuple = rightTuple.getFirstChild();

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

                constraints.updateFromFactHandle(contextEntry,
                                                 wm,
                                                 rightTuple.getFactHandle());

                // first check our index (for indexed nodes only) hasn't changed and we are returning the same bucket
                // We assume a bucket change if leftTuple == null
                if (childLeftTuple != null && ltm.isIndexed() && !leftIt.isFullIterator() && (leftTuple == null || (leftTuple.getMemory() != childLeftTuple.getLeftParent().getMemory()))) {
                    // our index has changed, so delete all the previous matches
                    removePreviousMatchesForRightTuple(accNode,
                                                       accumulate,
                                                       rightTuple,
                                                       context,
                                                       wm,
                                                       am,
                                                       childLeftTuple,
                                                       trgLeftTuples);
                    childLeftTuple = null; // null so the next check will attempt matches for new bucket
                }

                // if LeftTupleMemory is empty, there are no matches to modify
                if (leftTuple != null) {
                    if (leftTuple.getStagedType() == LeftTuple.NONE) {
                        trgLeftTuples.addUpdate(leftTuple);
                    }

                    doRightUpdatesProcessChildren(accNode,
                                                  am,
                                                  wm,
                                                  bm,
                                                  constraints,
                                                  accumulate,
                                                  leftIt,
                                                  rightTuple,
                                                  childLeftTuple,
                                                  leftTuple,
                                                  trgLeftTuples);
                }

                rightTuple.clearStaged();
                rightTuple = next;
            }
            constraints.resetFactHandle(contextEntry);
        }
View Full Code Here

                accctx.getResultFactHandle().setObject(result);
            }

            // First alpha node filters
            AlphaNodeFieldConstraint[] resultConstraints = accNode.getResultConstraints();
            BetaConstraints resultBinder = accNode.getResultBinder();
            boolean isAllowed = result != null;
            for (int i = 0, length = resultConstraints.length; isAllowed && i < length; i++) {
                if (!resultConstraints[i].isAllowed(accctx.resultFactHandle,
                                                    workingMemory,
                                                    memory.alphaContexts[i])) {
                    isAllowed = false;
                }
            }
            if (isAllowed) {
                resultBinder.updateFromTuple(memory.resultsContext,
                                             workingMemory,
                                             leftTuple);
                if (!resultBinder.isAllowedCachedLeft(memory.resultsContext,
                                                      accctx.getResultFactHandle())) {
                    isAllowed = false;
                }
                resultBinder.resetTuple(memory.resultsContext);
            }


            LeftTuple childLeftTuple = (LeftTuple) accctx.getResultLeftTuple();
            childLeftTuple.setPropagationContext(leftTuple.getPropagationContext());
View Full Code Here

                                  LeftTupleSets srcLeftTuples,
                                  LeftTupleSets trgLeftTuples) {
            LeftTupleMemory ltm = bm.getLeftTupleMemory();
            RightTupleMemory rtm = bm.getRightTupleMemory();
            ContextEntry[] contextEntry = bm.getContext();
            BetaConstraints constraints = notNode.getRawConstraints();

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

                FastIterator it = notNode.getRightIterator(rtm);
                PropagationContext context = leftTuple.getPropagationContext();

                boolean useLeftMemory = useLeftMemory(notNode, leftTuple);

                constraints.updateFromTuple(contextEntry,
                                            wm,
                                            leftTuple);

                // This method will also remove rightTuples that are from subnetwork where no leftmemory use used
                findLeftTupleBlocker(notNode, rtm, contextEntry, constraints, leftTuple, it, context, useLeftMemory);

                if (leftTuple.getBlocker() == null) {
                    // tuple is not blocked, so add to memory so other fact handles can attempt to match
                    if (useLeftMemory) {
                        ltm.add(leftTuple);
                    }

                    trgLeftTuples.addInsert(sink.createLeftTuple(leftTuple,
                                                                 sink,
                                                                 leftTuple.getPropagationContext(), useLeftMemory)); // use leftTuple pctx here, as no right input caused the trigger anway
                }
                leftTuple.clearStaged();
                leftTuple = next;
            }
            constraints.resetTuple(contextEntry);
        }
View Full Code Here

                                   LeftTupleSets trgLeftTuples) {

            LeftTupleMemory ltm = bm.getLeftTupleMemory();
            RightTupleMemory rtm = bm.getRightTupleMemory();
            ContextEntry[] contextEntry = bm.getContext();
            BetaConstraints constraints = notNode.getRawConstraints();

            LeftTupleSets stagedLeftTuples = null;
            if (!bm.getSegmentMemory().isEmpty()) {
                stagedLeftTuples = bm.getSegmentMemory().getFirst().getStagedLeftTuples();
            }

            // this must be processed here, rather than initial insert, as we need to link the blocker
            unlinkNotNodeOnRightInsert(notNode,
                                       bm,
                                       wm);

            for (RightTuple rightTuple = srcRightTuples.getInsertFirst(); rightTuple != null; ) {
                RightTuple next = rightTuple.getStagedNext();

                rtm.add(rightTuple);

                FastIterator it = notNode.getLeftIterator(ltm);
                PropagationContext context = rightTuple.getPropagationContext();

                constraints.updateFromFactHandle(contextEntry,
                                                 wm,
                                                 rightTuple.getFactHandle());
                for (LeftTuple leftTuple = notNode.getFirstLeftTuple(rightTuple, ltm, context, it); leftTuple != null; ) {
                    // preserve next now, in case we remove this leftTuple
                    LeftTuple temp = (LeftTuple) it.next(leftTuple);

                    if (leftTuple.getStagedType() == LeftTuple.UPDATE) {
                        // ignore, as it will get processed via left iteration. Children cannot be processed twice
                        leftTuple = temp;
                        continue;
                    }

                    // we know that only unblocked LeftTuples are  still in the memory
                    if (constraints.isAllowedCachedRight(contextEntry,
                                                         leftTuple)) {
                        leftTuple.setBlocker(rightTuple);
                        rightTuple.addBlocked(leftTuple);

                        // this is now blocked so remove from memory
                        ltm.remove(leftTuple);

                        // subclasses like ForallNotNode might override this propagation
                        // ** @TODO (mdp) need to not break forall
                        LeftTuple childLeftTuple = leftTuple.getFirstChild();

                        if (childLeftTuple != null) { // NotNode only has one child
                            childLeftTuple.setPropagationContext(rightTuple.getPropagationContext());
                            childLeftTuple = deleteLeftChild(childLeftTuple, trgLeftTuples, stagedLeftTuples);
                        }
                    }

                    leftTuple = temp;
                }
                rightTuple.clearStaged();
                rightTuple = next;
            }
            constraints.resetFactHandle(contextEntry);
        }
View Full Code Here

                                  LeftTupleSets trgLeftTuples,
                                  LeftTupleSets stagedLeftTuples) {
            LeftTupleMemory ltm = bm.getLeftTupleMemory();
            RightTupleMemory rtm = bm.getRightTupleMemory();
            ContextEntry[] contextEntry = bm.getContext();
            BetaConstraints constraints = notNode.getRawConstraints();

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

                PropagationContext context = leftTuple.getPropagationContext();

                FastIterator rightIt = notNode.getRightIterator(rtm);
                RightTuple firstRightTuple = notNode.getFirstRightTuple(leftTuple, rtm, null, rightIt);

                // If in memory, remove it, because we'll need to add it anyway if it's not blocked, to ensure iteration order
                RightTuple blocker = leftTuple.getBlocker();
                if (blocker == null) {
                    ltm.remove(leftTuple);
                } else {
                    // check if we changed bucket
                    if (rtm.isIndexed() && !rightIt.isFullIterator()) {
                        // if newRightTuple is null, we assume there was a bucket change and that bucket is empty               
                        if (firstRightTuple == null || firstRightTuple.getMemory() != blocker.getMemory()) {
                            blocker.removeBlocked(leftTuple);
                            blocker = null;
                        }
                    }
                }

                constraints.updateFromTuple(contextEntry,
                                            wm,
                                            leftTuple);

                // if we where not blocked before (or changed buckets), or the previous blocker no longer blocks, then find the next blocker
                if (blocker == null || !constraints.isAllowedCachedLeft(contextEntry,
                                                                        blocker.getFactHandle())) {
                    if (blocker != null) {
                        // remove previous blocker if it exists, as we know it doesn't block any more
                        blocker.removeBlocked(leftTuple);
                    }

                    // find first blocker, because it's a modify, we need to start from the beginning again       
                    for (RightTuple newBlocker = firstRightTuple; newBlocker != null; newBlocker = (RightTuple) rightIt.next(newBlocker)) {
                        if (constraints.isAllowedCachedLeft(contextEntry,
                                                            newBlocker.getFactHandle())) {
                            leftTuple.setBlocker(newBlocker);
                            newBlocker.addBlocked(leftTuple);

                            break;
                        }
                    }

                    LeftTuple childLeftTuple = leftTuple.getFirstChild();

                    if (leftTuple.getBlocker() != null) {
                        // blocked
                        if (childLeftTuple != null) {
                            // blocked, with previous children, so must have not been previously blocked, so retract
                            // no need to remove, as we removed at the start
                            // to be matched against, as it's now blocked
                            childLeftTuple.setPropagationContext(leftTuple.getBlocker().getPropagationContext()); // we have the righttuple, so use it for the pctx
                            deleteLeftChild(childLeftTuple, trgLeftTuples, stagedLeftTuples);
                        } // else: it's blocked now and no children so blocked before, thus do nothing            
                    } else if (childLeftTuple == null) {
                        // not blocked, with no children, must have been previously blocked so assert
                        ltm.add(leftTuple); // add to memory so other fact handles can attempt to match
                        trgLeftTuples.addInsert(sink.createLeftTuple(leftTuple,
                                                                     sink,
                                                                     leftTuple.getPropagationContext(), true)); // use leftTuple for the pctx here, as the right one is not available
                                                                                                                // this won't cause a problem, as the trigger tuple (to the left) will be more recent anwyay
                    } else {
                        switch (childLeftTuple.getStagedType()) {
                            // handle clash with already staged entries
                            case LeftTuple.INSERT:
                                stagedLeftTuples.removeInsert(childLeftTuple);
                                break;
                            case LeftTuple.UPDATE:
                                stagedLeftTuples.removeUpdate(childLeftTuple);
                                break;
                        }
                        // not blocked, with children, so wasn't previous blocked and still isn't so modify               
                        ltm.add(leftTuple); // add to memory so other fact handles can attempt to match
                        trgLeftTuples.addUpdate(childLeftTuple); // no need to update pctx, as no right available, and pctx will exist on a parent LeftTuple anyway
                        childLeftTuple.reAddLeft();
                    }
                }
                leftTuple.clearStaged();
                leftTuple = next;
            }
            constraints.resetTuple(contextEntry);
        }
View Full Code Here

                                   LeftTupleSets trgLeftTuples,
                                   LeftTupleSets stagedLeftTuples) {
            LeftTupleMemory ltm = bm.getLeftTupleMemory();
            RightTupleMemory rtm = bm.getRightTupleMemory();
            ContextEntry[] contextEntry = bm.getContext();
            BetaConstraints constraints = notNode.getRawConstraints();

            for (RightTuple rightTuple = srcRightTuples.getUpdateFirst(); rightTuple != null; ) {
                RightTuple next = rightTuple.getStagedNext();
                if (ltm == null || (ltm.size() == 0 && rightTuple.getBlocked() == null)) {
                    // do nothing here, as we know there are no left tuples

                    //normally do this at the end, but as we are exiting early, make sure the buckets are still correct.
                    rtm.removeAdd(rightTuple);
                    rightTuple.clearStaged();
                    rightTuple = next;
                    continue;
                }

                PropagationContext context = rightTuple.getPropagationContext();

                constraints.updateFromFactHandle(contextEntry,
                                                 wm,
                                                 rightTuple.getFactHandle());

                FastIterator leftIt = notNode.getLeftIterator(ltm);
                LeftTuple firstLeftTuple = notNode.getFirstLeftTuple(rightTuple, ltm, context, leftIt);

                LeftTuple firstBlocked = rightTuple.getBlocked();
                // we now have  reference to the first Blocked, so null it in the rightTuple itself, so we can rebuild
                rightTuple.nullBlocked();

                // first process non-blocked tuples, as we know only those ones are in the left memory.
                for (LeftTuple leftTuple = firstLeftTuple; leftTuple != null; ) {
                    // preserve next now, in case we remove this leftTuple
                    LeftTuple temp = (LeftTuple) leftIt.next(leftTuple);

                    if (leftTuple.getStagedType() == LeftTuple.UPDATE) {
                        // ignore, as it will get processed via left iteration. Children cannot be processed twice
                        leftTuple = temp;
                        continue;
                    }

                    // we know that only unblocked LeftTuples are  still in the memory
                    if (constraints.isAllowedCachedRight(contextEntry,
                                                         leftTuple)) {
                        leftTuple.setBlocker(rightTuple);
                        rightTuple.addBlocked(leftTuple);

                        // this is now blocked so remove from memory
                        ltm.remove(leftTuple);

                        LeftTuple childLeftTuple = leftTuple.getFirstChild();
                        if ( childLeftTuple != null) {
                            childLeftTuple.setPropagationContext(rightTuple.getPropagationContext());
                            deleteRightChild(childLeftTuple, trgLeftTuples, stagedLeftTuples);
                        }
                    }

                    leftTuple = temp;
                }

                if (firstBlocked != null) {
                    FastIterator rightIt = notNode.getRightIterator(rtm);

                    // now process existing blocks, we only process existing and not new from above loop
                    boolean useComparisonIndex = rtm.getIndexType().isComparison();
                    RightTuple rootBlocker = useComparisonIndex ? null : (RightTuple) rightIt.next(rightTuple);

                    RightTupleList list = rightTuple.getMemory();

                    // we must do this after we have the next in memory
                    // We add to the end to give an opportunity to re-match if in same bucket
                    rtm.removeAdd(rightTuple);

                    if (!useComparisonIndex && rootBlocker == null && list == rightTuple.getMemory()) {
                        // we are at the end of the list, so set to self, to give self a chance to rematch
                        rootBlocker = rightTuple;
                    }

                    // iterate all the existing previous blocked LeftTuples
                    for (LeftTuple leftTuple = firstBlocked; leftTuple != null; ) {
                        LeftTuple temp = leftTuple.getBlockedNext();

                        leftTuple.clearBlocker();

                        if (leftTuple.getStagedType() == LeftTuple.UPDATE) {
                            // ignore, as it will get processed via left iteration. Children cannot be processed twice
                            // but need to add it back into list first
                            leftTuple.setBlocker(rightTuple);
                            rightTuple.addBlocked(leftTuple);

                            leftTuple = temp;
                            continue;
                        }

                        constraints.updateFromTuple(contextEntry,
                                                    wm,
                                                    leftTuple);

                        if (useComparisonIndex) {
                            rootBlocker = notNode.getFirstRightTuple(leftTuple, rtm, null, rightIt);
                        }

                        // we know that older tuples have been checked so continue next
                        for (RightTuple newBlocker = rootBlocker; newBlocker != null; newBlocker = (RightTuple) rightIt.next(newBlocker)) {
                            if (constraints.isAllowedCachedLeft(contextEntry,
                                                                newBlocker.getFactHandle())) {
                                leftTuple.setBlocker(newBlocker);
                                newBlocker.addBlocked(leftTuple);

                                break;
                            }
                        }

                        if (leftTuple.getBlocker() == null) {
                            // was previous blocked and not in memory, so add
                            ltm.add(leftTuple);

                            // subclasses like ForallNotNode might override this propagation
                            trgLeftTuples.addInsert(sink.createLeftTuple(leftTuple,
                                                                         sink,
                                                                         rightTuple.getPropagationContext(), true));
                        }

                        leftTuple = temp;
                    }
                } else {
                    // we had to do this at the end, rather than beginning as this 'if' block needs the next memory tuple
                    rtm.removeAdd(rightTuple);
                }
                rightTuple.clearStaged();
                rightTuple = next;
            }

            constraints.resetFactHandle(contextEntry);
            constraints.resetTuple(contextEntry);
        }
View Full Code Here

                                   RightTupleSets srcRightTuples,
                                   LeftTupleSets trgLeftTuples) {
            LeftTupleMemory ltm = bm.getLeftTupleMemory();
            RightTupleMemory rtm = bm.getRightTupleMemory();
            ContextEntry[] contextEntry = bm.getContext();
            BetaConstraints constraints = notNode.getRawConstraints();

            for (RightTuple rightTuple = srcRightTuples.getDeleteFirst(); rightTuple != null; ) {
                RightTuple next = rightTuple.getStagedNext();

                FastIterator it = notNode.getRightIterator(rtm);

                // assign now, so we can remove from memory before doing any possible propagations
                boolean useComparisonIndex = rtm.getIndexType().isComparison();
                RightTuple rootBlocker = useComparisonIndex ? null : (RightTuple) it.next(rightTuple);

                if (rightTuple.getMemory() != null) {
                    // it may have been staged and never actually added
                    rtm.remove(rightTuple);
                }

                if (rightTuple.getBlocked() != null) {
                    PropagationContext context = rightTuple.getPropagationContext();

                    for (LeftTuple leftTuple = rightTuple.getBlocked(); leftTuple != null; ) {
                        LeftTuple temp = leftTuple.getBlockedNext();

                        leftTuple.clearBlocker();

                        if (leftTuple.getStagedType() == LeftTuple.UPDATE) {
                            // ignore, as it will get processed via left iteration. Children cannot be processed twice
                            leftTuple = temp;
                            continue;
                        }

                        constraints.updateFromTuple(contextEntry,
                                                    wm,
                                                    leftTuple);

                        if (useComparisonIndex) {
                            rootBlocker = rtm.getFirst(leftTuple, null, it);
                        }

                        // we know that older tuples have been checked so continue next
                        for (RightTuple newBlocker = rootBlocker; newBlocker != null; newBlocker = (RightTuple) it.next(newBlocker)) {
                            if (constraints.isAllowedCachedLeft(contextEntry,
                                                                newBlocker.getFactHandle())) {
                                leftTuple.setBlocker(newBlocker);
                                newBlocker.addBlocked(leftTuple);

                                break;
                            }
                        }

                        if (leftTuple.getBlocker() == null) {
                            // was previous blocked and not in memory, so add
                            ltm.add(leftTuple);

                            trgLeftTuples.addInsert(sink.createLeftTuple(leftTuple,
                                                                         sink,
                                                                         rightTuple.getPropagationContext(), true));
                        }

                        leftTuple = temp;
                    }
                }

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

            constraints.resetTuple(contextEntry);
        }
View Full Code Here

                                  LeftTupleSets srcLeftTuples,
                                  LeftTupleSets trgLeftTuples) {
            LeftTupleMemory ltm = bm.getLeftTupleMemory();
            RightTupleMemory rtm = bm.getRightTupleMemory();
            ContextEntry[] contextEntry = bm.getContext();
            BetaConstraints constraints = joinNode.getRawConstraints();

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

                boolean useLeftMemory = useLeftMemory(joinNode, leftTuple);

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

                FastIterator it = joinNode.getRightIterator(rtm);
                PropagationContext context = leftTuple.getPropagationContext();

                constraints.updateFromTuple(contextEntry,
                                            wm,
                                            leftTuple);

                for (RightTuple rightTuple = joinNode.getFirstRightTuple(leftTuple,
                                                                         rtm,
                                                                         null,
                                                                         it); rightTuple != null; rightTuple = (RightTuple) it.next(rightTuple)) {
                    if (constraints.isAllowedCachedLeft(contextEntry,
                                                        rightTuple.getFactHandle())) {
                        trgLeftTuples.addInsert(sink.createLeftTuple(leftTuple,
                                                                     rightTuple,
                                                                     null,
                                                                     null,
                                                                     sink,
                                                                     useLeftMemory));
                    }

                }
                leftTuple.clearStaged();
                leftTuple = next;
            }
            constraints.resetTuple(contextEntry);
        }
View Full Code Here

TOP

Related Classes of org.drools.core.common.BetaConstraints

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.