Package org.drools.core.common

Examples of org.drools.core.common.PropagationContextImpl


    }
    public LeftBuilder insert(Object... objects) {
        for ( Object object : objects ) {
            InternalFactHandle fh = (InternalFactHandle) wm.insert( object );
            LeftTuple leftTuple = sink.createLeftTuple( fh, sink, true );
            leftTuple.setPropagationContext( new PropagationContextImpl() );
            leftTuples.addInsert( leftTuple );
        }
        return this;
    }
View Full Code Here


    public LeftBuilder update(Object... objects) {
        for ( Object object : objects ) {
            InternalFactHandle fh = (InternalFactHandle) wm.getFactHandle( object );
            LeftTuple leftTuple = fh.getFirstLeftTuple();
            leftTuple.setPropagationContext( new PropagationContextImpl() );
            leftTuples.addUpdate( leftTuple );
        }
        return this;
    }
View Full Code Here

    public LeftBuilder delete(Object... objects) {
        for ( Object object : objects ) {
            InternalFactHandle fh = (InternalFactHandle) wm.getFactHandle( object );
            LeftTuple leftTuple = fh.getFirstLeftTuple();
            leftTuple.setPropagationContext( new PropagationContextImpl() );
            leftTuples.addDelete( leftTuple );
        }
        return this;
    }
View Full Code Here

       
        List<RightTuple> rightTuples = new ArrayList<RightTuple>();
        for ( Object object : objects ) {
            InternalFactHandle fh = (InternalFactHandle) wm.insert( object );
            RightTuple expectedRightTuple = new RightTuple( fh, node ); //node.createLeftTuple( fh, node, true );
            expectedRightTuple.setPropagationContext( new PropagationContextImpl() );
            rightTuples.add( expectedRightTuple );
        }
       
        scenario.setTestRightMemory( true );
       
View Full Code Here

        List<LeftTuple> list = new ArrayList<LeftTuple>();
        for ( Object object : objects ) {
            InternalFactHandle fh = (InternalFactHandle) wm.insert( object );
            LeftTuple expectedLeftTuple = node.createLeftTuple( fh, node, true );
            expectedLeftTuple.setPropagationContext( new PropagationContextImpl() );
            list.add( expectedLeftTuple );
          
        }
       
        scenario.setTestLeftMemory( true );
View Full Code Here

            return;
        }

        for ( InternalWorkingMemory workingMemory : context.getWorkingMemories() ) {
            workingMemory.updateEntryPointsCache();
            final PropagationContext propagationContext = new PropagationContextImpl( workingMemory.getNextPropagationIdCounter(),
                                                                                      PropagationContext.RULE_ADDITION,
                                                                                      null,
                                                                                      null,
                                                                                      null );
            this.source.updateSink( this,
View Full Code Here

         return counter;
     }

    private static void insertLiaFacts(LeftTupleSource startNode, InternalWorkingMemory wm) {
        // rule added with no sharing
        final PropagationContext pctx = new PropagationContextImpl(wm.getNextPropagationIdCounter(),
                                                                   PropagationContext.RULE_ADDITION,
                                                                   null,
                                                                   null,
                                                                   null);
        LeftInputAdapterNode lian = (LeftInputAdapterNode) startNode;
View Full Code Here

        LeftTupleSink lts =  startNode;
        while (!NodeTypeEnums.isTerminalNode(lts) && lts.getLeftTupleSource().getType() != NodeTypeEnums.RightInputAdaterNode ) {
            if (NodeTypeEnums.isBetaNode(lts)) {
                BetaNode bn = (BetaNode) lts;
                if (!bn.isRightInputIsRiaNode() ) {
                    final PropagationContext pctx = new PropagationContextImpl(wm.getNextPropagationIdCounter(),
                                                                               PropagationContext.RULE_ADDITION,
                                                                               null,
                                                                               null,
                                                                               null);
                    bn.getRightInput().updateSink(bn,
View Full Code Here

        if (context == null || context.getRuleBase().getConfiguration().isPhreakEnabled() ) {
            return;
        }

        for ( InternalWorkingMemory workingMemory : context.getWorkingMemories() ) {
            final PropagationContext propagationContext = new PropagationContextImpl(workingMemory.getNextPropagationIdCounter(),
                    PropagationContext.RULE_ADDITION,
                    null,
                    null,
                    null);
View Full Code Here

                }
            } else {
                // retract
                // we can't use the expiration context here, because it wouldn't cancel existing activations
                // however, isAllowed is false so activations should not fire
                PropagationContext cancelContext = new PropagationContextImpl( workingMemory.getNextPropagationIdCounter(),
                                                                               org.kie.api.runtime.rule.PropagationContext.DELETION,
                                                                               (Rule) context.getRule(),
                                                                               context.getLeftTupleOrigin(),
                                                                               (InternalFactHandle) context.getFactHandle() );
                this.sink.propagateRetractLeftTuple( leftTuple,
View Full Code Here

TOP

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

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.