Package org.drools.core.common

Examples of org.drools.core.common.LeftTupleSets


        }

        assertNotNull(liaNode);
        InternalWorkingMemory wm = (InternalWorkingMemory)ksession;
        LeftInputAdapterNode.LiaNodeMemory memory = (LeftInputAdapterNode.LiaNodeMemory) wm.getNodeMemory( liaNode );
        LeftTupleSets stagedLeftTuples = memory.getSegmentMemory().getStagedLeftTuples();
        assertEquals(0, stagedLeftTuples.deleteSize());
        assertNull(stagedLeftTuples.getDeleteFirst());
        assertEquals(0, stagedLeftTuples.insertSize());
        assertNull(stagedLeftTuples.getInsertFirst());
    }
View Full Code Here


        }

        assertNotNull(liaNode);
        InternalWorkingMemory wm = (InternalWorkingMemory)ksession;
        LeftInputAdapterNode.LiaNodeMemory memory = (LeftInputAdapterNode.LiaNodeMemory) wm.getNodeMemory( liaNode );
        LeftTupleSets stagedLeftTuples = memory.getSegmentMemory().getStagedLeftTuples();
        assertEquals(0, stagedLeftTuples.deleteSize());
        assertNull(stagedLeftTuples.getDeleteFirst());
        assertEquals(0, stagedLeftTuples.insertSize());
        assertNull(stagedLeftTuples.getInsertFirst());
    }
View Full Code Here

        }

        assertNotNull(liaNode);
        InternalWorkingMemory wm = ((StatefulKnowledgeSessionImpl)ksession).session;
        LeftInputAdapterNode.LiaNodeMemory memory = (LeftInputAdapterNode.LiaNodeMemory) wm.getNodeMemory( liaNode );
        LeftTupleSets stagedLeftTuples = memory.getSegmentMemory().getStagedLeftTuples();
        assertEquals(0, stagedLeftTuples.deleteSize());
        assertNull(stagedLeftTuples.getDeleteFirst());
        assertEquals(0, stagedLeftTuples.insertSize());
        assertNull(stagedLeftTuples.getInsertFirst());
    }
View Full Code Here

        }

        assertNotNull(liaNode);
        InternalWorkingMemory wm = (InternalWorkingMemory)ksession;
        LeftInputAdapterNode.LiaNodeMemory memory = (LeftInputAdapterNode.LiaNodeMemory) wm.getNodeMemory( liaNode );
        LeftTupleSets stagedLeftTuples = memory.getSegmentMemory().getStagedLeftTuples();
        assertEquals(0, stagedLeftTuples.deleteSize());
        assertNull(stagedLeftTuples.getDeleteFirst());
        assertEquals(0, stagedLeftTuples.insertSize());
        assertNull(stagedLeftTuples.getInsertFirst());
    }
View Full Code Here

        }

        assertNotNull(liaNode);
        InternalWorkingMemory wm = (InternalWorkingMemory)ksession;
        LeftInputAdapterNode.LiaNodeMemory memory = (LeftInputAdapterNode.LiaNodeMemory) wm.getNodeMemory( liaNode );
        LeftTupleSets stagedLeftTuples = memory.getSegmentMemory().getStagedLeftTuples();
        assertEquals(0, stagedLeftTuples.deleteSize());
        assertNull(stagedLeftTuples.getDeleteFirst());
        assertEquals(0, stagedLeftTuples.insertSize());
        assertNull(stagedLeftTuples.getInsertFirst());
    }
View Full Code Here

            RightTuple rightTuple = (RightTuple) resultLeftTuple.getObject();
            rightTuple.setLeftTuple( null );
            resultLeftTuple.setObject( null );

            DroolsQuery query = (DroolsQuery) this.factHandle.getObject();
            LeftTupleSets leftTuples = query.getResultLeftTupleSets();
            LeftTuple childLeftTuple = rightTuple.getFirstChild();

            switch ( childLeftTuple.getStagedType() ) {
                // handle clash with already staged entries
                case LeftTuple.INSERT :
                    leftTuples.removeInsert( childLeftTuple );
                    break;
                case LeftTuple.UPDATE :
                    leftTuples.removeUpdate( childLeftTuple );
                    break;
            }
            leftTuples.addDelete( childLeftTuple  );
            childLeftTuple.unlinkFromRightParent();
            childLeftTuple.unlinkFromLeftParent();
        }
View Full Code Here

            if ( dquery.isOpen() ) {
                rightTuple.setLeftTuple( resultLeftTuple );
                resultLeftTuple.setObject( rightTuple );
            }

            LeftTupleSets leftTuples = dquery.getResultLeftTupleSets();
            LeftTuple childLeftTuple = rightTuple.getFirstChild();
            switch ( childLeftTuple.getStagedType() ) {
                // handle clash with already staged entries
                case LeftTuple.INSERT :
                    leftTuples.removeInsert( childLeftTuple );
                    break;
                case LeftTuple.UPDATE :
                    leftTuples.removeUpdate( childLeftTuple );
                    break;
            }
            leftTuples.addUpdate( childLeftTuple  );
        }
View Full Code Here

        }
    }

    private static void doDeleteSegmentMemory(LeftTuple leftTuple, PropagationContext pctx, final LiaNodeMemory lm,
                                              SegmentMemory sm, InternalWorkingMemory wm, boolean linkOrNotify) {
        LeftTupleSets leftTuples = sm.getStagedLeftTuples();
        leftTuple.setPropagationContext( pctx );

        boolean stagedDeleteWasEmpty = false;
        if ( ((BaseNode)sm.getRootNode()).isStreamMode() && sm.getTupleQueue() != null ) {
            stagedDeleteWasEmpty = sm.getTupleQueue().isEmpty();
            int propagationType = pctx.getType() == PropagationContext.MODIFICATION ? PropagationContext.DELETION : pctx.getType();
            sm.getTupleQueue().add(new LeftTupleEntry(leftTuple, pctx, sm.getNodeMemories().getFirst(), propagationType));
            if ( log.isTraceEnabled() ) {
                log.trace( "LeftInputAdapterNode delete size={}  queue={} pctx={} lt={}", System.identityHashCode( sm.getTupleQueue() ), sm.getTupleQueue().size(), PhreakPropagationContext.intEnumToString(pctx), leftTuple );
            }
        } else {
            stagedDeleteWasEmpty = leftTuples.addDelete(leftTuple);
        }

        if stagedDeleteWasEmpty && linkOrNotify ) {
            // staged is empty, so notify rule, to force re-evaluation
            lm.setNodeDirty(wm);
View Full Code Here

                                                      liaNode.getSinkPropagator() );
            }
            sm = sm.getFirst(); // repoint to the child sm
        }

        LeftTupleSets leftTuples = sm.getStagedLeftTuples();

        LeftTupleSink sink = liaNode.getSinkPropagator().getFirstLeftTupleSink() ;

        doUpdateSegmentMemory(leftTuple, context, wm, linkOrNotify, lm, sm, leftTuples, sink);
View Full Code Here

            for (NetworkNode node = sm.getRootNode(); node != sink; node = ((LeftTupleSource)node).getSinkPropagator().getFirstLeftTupleSink() ) {
                //update the bit to the correct node position.
                bit = bit << 1;
            }

            LeftTupleSets trgLeftTuples = new LeftTupleSetsImpl();
            doPropagateChildLeftTuples(null, tm, sink, wm,
                                       null, trgLeftTuples, sm.getStagedLeftTuples());

            RuleNetworkEvaluator rne = new RuleNetworkEvaluator();
            LinkedList<StackEntry> outerStack = new LinkedList<StackEntry>();
View Full Code Here

TOP

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

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.