Examples of agendaSize()


Examples of org.drools.common.DefaultAgenda.agendaSize()

        agenda.unstageActivations();
        agenda.activateRuleFlowGroup( "rule-flow-group-0" );
        assertEquals( 1,
                      ruleFlowGroup0.size() );
        assertEquals( 1,
                      agenda.agendaSize() );
        assertTrue( ruleFlowGroup0.isActive() );

        // Execute the activation, the RuleFlowGroup should automatically deactivate
        agenda.fireNextItem( null );
        assertEquals( 0,
View Full Code Here

Examples of org.drools.common.DefaultAgenda.agendaSize()

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

        // A new activation should now be added to the RuleFlowGroup but not to the agenda
        final LeftTupleImpl tuple2 = new LeftTupleImpl( new DefaultFactHandle( 1,
View Full Code Here

Examples of org.drools.common.DefaultAgenda.agendaSize()

                               workingMemory );
        agenda.unstageActivations();
        assertEquals( 1,
                      ruleFlowGroup0.size() );
        assertEquals( 0,
                      agenda.agendaSize() );
    }

    /**
     * Test auto-deactivation of empty ruleflow group.
     */
 
View Full Code Here

Examples of org.drools.common.DefaultAgenda.agendaSize()

        // RuleFlowGroup should be empty, as well as the agenda
        assertEquals( 0,
                      ruleFlowGroup0.size() );
        assertEquals( 0,
                      agenda.agendaSize() );

        // Activate the RuleFlowGroup, the activations stay in the group, but
        // should now also be in the Agenda
        agenda.activateRuleFlowGroup( "rule-flow-group-0" );
        assertEquals( 0,
View Full Code Here

Examples of org.drools.common.DefaultAgenda.agendaSize()

        // should now also be in the Agenda
        agenda.activateRuleFlowGroup( "rule-flow-group-0" );
        assertEquals( 0,
                      ruleFlowGroup0.size() );
        assertEquals( 0,
                      agenda.agendaSize() );
        workingMemory.executeQueuedActions();

        assertFalse( ruleFlowGroup0.isActive() );
    }
View Full Code Here

Examples of org.drools.common.DefaultAgenda.agendaSize()

        assertEquals( 1,
                      agendaGroup1.size() );

        // make sure total agenda size reflects this
        assertEquals( 2,
                      agenda.agendaSize() );

        // put another one on agendaGroup 1
        node2.assertLeftTuple( tuple,
                               context2,
                               workingMemory );
View Full Code Here

Examples of org.drools.common.DefaultAgenda.agendaSize()

        assertEquals( 2,
                      agendaGroup1.size() );

        // make sure total agenda size reflects this
        assertEquals( 3,
                      agenda.agendaSize() );

        // set the focus to agendaGroup1, note agendaGroup1 has no activations
        agenda.setFocus( "agendaGroup1" );
        // add agendaGroup2 onto the focus stack
        agenda.setFocus( "agendaGroup2" );
View Full Code Here

Examples of org.drools.common.DefaultAgenda.agendaSize()

        assertEquals( 2,
                      agenda.getFocus().size() );

        // check totalAgendaSize still works
        assertEquals( 5,
                      agenda.agendaSize() );

        // ok now lets check that stacks work with fireNextItem
        agenda.fireNextItem( null );

        // agendaGroup2 should still be the current agendaGroup
View Full Code Here

Examples of org.drools.common.DefaultAgenda.agendaSize()

        // agendaGroup2 has gone from 2 to one activations
        assertEquals( 1,
                      agenda.getFocus().size() );
        // check totalAgendaSize has reduced too
        assertEquals( 4,
                      agenda.agendaSize() );

        // now repeat the process
        agenda.fireNextItem( null );

        // focus is still agendaGroup2, but now its empty
View Full Code Here

Examples of org.drools.common.DefaultAgenda.agendaSize()

        assertEquals( agendaGroup2,
                      agenda.getFocus() );
        assertEquals( 0,
                      agenda.getFocus().size() );
        assertEquals( 3,
                      agenda.agendaSize() );

        // repeat fire again
        agenda.fireNextItem( null );

        // agendaGroup2 is empty so it should be popped from the stack making agendaGroup1 the current agendaGroup
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.