Examples of executeQueuedActions()


Examples of org.drools.core.common.AbstractWorkingMemory.executeQueuedActions()

        node.retractLeftTuple( tuple1,
                               context1,
                               workingMemory );

        workingMemory.executeQueuedActions();

        assertLength( 2,
                      sink.getRetracted() );

        values = (Object[]) sink.getRetracted().get( 1 );
View Full Code Here

Examples of org.drools.core.common.AbstractWorkingMemory.executeQueuedActions()

        // Now lets cancel the first activation
        node2.retractLeftTuple( tuple2,
                                context2,
                                workingMemory );

        workingMemory.executeQueuedActions();

        // because this logical fact has two relationships it shouldn't retract yet
        assertLength( 0,
                      sink.getRetracted() );
View Full Code Here

Examples of org.drools.core.common.AbstractWorkingMemory.executeQueuedActions()

        // now remove that final justification
        node.retractLeftTuple( tuple1,
                               context1,
                               workingMemory );

        workingMemory.executeQueuedActions();

        // Should cause the logical fact to be retracted
        assertLength( 1,
                      sink.getRetracted() );
View Full Code Here

Examples of org.drools.core.common.AbstractWorkingMemory.executeQueuedActions()

    public void testExecuteQueueActions() {
        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        final AbstractWorkingMemory wm = (AbstractWorkingMemory) ruleBase.newStatefulSession();
        final ReentrantAction action = new ReentrantAction();
        wm.queueWorkingMemoryAction( action );
        wm.executeQueuedActions();
        assertEquals( 2, action.counter.get() );
    }
   
    @Test
    public void testDifferentEntryPointsOnSameFact() {
View Full Code Here

Examples of org.drools.core.common.InternalWorkingMemory.executeQueuedActions()

        // Execute the activation, the RuleFlowGroup should automatically deactivate
        agenda.fireNextItem(null, 0, -1);
        assertEquals(0,
                     ruleFlowGroup0.size());
        workingMemory.executeQueuedActions();
        assertEquals(0, ruleFlowGroup0.size());
        agenda.fireNextItem(null, 0, -1);
        assertFalse(ruleFlowGroup0.isActive());

        // A new activation should now be added to the RuleFlowGroup but not to the agenda
View Full Code Here

Examples of org.drools.core.impl.StatefulKnowledgeSessionImpl.executeQueuedActions()

        // Retract the tuple and test the logically asserted fact was also deleted
        node.retractLeftTuple( tuple1,
                               context1,
                               ksession );

        ksession.executeQueuedActions();

        assertLength( 1,
                      sink.getRetracted() );

        Object[] values = (Object[]) sink.getRetracted().get( 0 );
View Full Code Here

Examples of org.drools.core.impl.StatefulKnowledgeSessionImpl.executeQueuedActions()

        node.retractLeftTuple( tuple1,
                               context1,
                               ksession );

        ksession.executeQueuedActions();

        assertLength( 2,
                      sink.getRetracted() );

        values = (Object[]) sink.getRetracted().get( 1 );
View Full Code Here

Examples of org.drools.core.impl.StatefulKnowledgeSessionImpl.executeQueuedActions()

        // Now lets cancel the first activation
        node2.retractLeftTuple( tuple2,
                                context2,
                                ksession );

        ksession.executeQueuedActions();

        // because this logical fact has two relationships it shouldn't retract yet
        assertLength( 0,
                      sink.getRetracted() );
View Full Code Here

Examples of org.drools.core.impl.StatefulKnowledgeSessionImpl.executeQueuedActions()

        // now remove that final justification
        node.retractLeftTuple( tuple1,
                               context1,
                               ksession );

        ksession.executeQueuedActions();

        // Should cause the logical fact to be deleted
        assertLength( 1,
                      sink.getRetracted() );
View Full Code Here

Examples of org.drools.core.impl.StatefulKnowledgeSessionImpl.executeQueuedActions()

    public void testExecuteQueueActions() {
        InternalKnowledgeBase kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase();
        StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl)kBase.newStatefulKnowledgeSession();
        final ReentrantAction action = new ReentrantAction();
        ksession.queueWorkingMemoryAction( action );
        ksession.executeQueuedActions();
        assertEquals( 2, action.counter.get() );
    }
   
    @Test
    public void testDifferentEntryPointsOnSameFact() {
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.