Examples of fireAllRules()


Examples of org.drools.common.AbstractWorkingMemory.fireAllRules()

                                              9 );
        final int sum = stilton.getPrice() + muzzarella.getPrice();
        final FactHandle stiltonHandle = workingMemory.insert( stilton );
        final FactHandle muzzarellaHandle = workingMemory.insert( muzzarella );

        workingMemory.fireAllRules();

        assertEquals( sum,
                      stilton.getPrice() );
        assertEquals( 1,
                      workingMemory.getFactHandleMap().size() );
View Full Code Here

Examples of org.drools.common.InternalWorkingMemory.fireAllRules()

    public void execute(Object object) {
        InternalWorkingMemory wm = newWorkingMemory();

        wm.insert( object );
        wm.fireAllRules( this.agendaFilter );
    }

    public void execute(Object[] array) {
        InternalWorkingMemory wm = newWorkingMemory();
View Full Code Here

Examples of org.drools.core.StatefulSession.fireAllRules()

        p.setAge( 2 );
        FactHandle h = workingMemory.insert( p );
        assertEquals( 1,
                      IteratorToList.convert( workingMemory.iterateObjects() ).size() );

        workingMemory.fireAllRules();
        workingMemory = getSerialisedStatefulSession( workingMemory );        
        assertEquals( 2,
                      IteratorToList.convert( workingMemory.iterateObjects() ).size() );

        l = IteratorToList.convert( workingMemory.iterateObjects( new ClassObjectFilter( CheeseEqual.class ) ) );
View Full Code Here

Examples of org.drools.core.WorkingMemory.fireAllRules()

        ruleBase.addPackage( pkg );

        final WorkingMemory workingMemory = ruleBase.newStatefulSession();
        workingMemory.insert( new TestBean() );
        workingMemory.fireAllRules();

        assertTrue( ((MockConsequence) rule1.getConsequence()).fired );
        assertFalse( ((MockConsequence) ruleOtherwise.getConsequence()).fired );

    }
View Full Code Here

Examples of org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.fireAllRules()

    List<String> list = new ArrayList<String>();
    list.add("Test");
   
    ksession.insert(list);
    ksession.execute(new ActivateRuleFlowCommand("ruleflow-group"));
    assertEquals(1, ksession.fireAllRules());
   
    try {
      ksession.execute(new ExceptionCommand());
      fail("Process must throw an exception");
    } catch (Exception e) {
View Full Code Here

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

                             context1,
                             workingMemory);

        assertEquals(0,
                     data.size());
        workingMemory.fireAllRules();

        // sleep for 2 seconds
        Thread.sleep(2000);

        // now check for update
View Full Code Here

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

    public void execute(Object object) {
        InternalWorkingMemory wm = newWorkingMemory();

        wm.insert( object );
        wm.fireAllRules( this.agendaFilter );
    }

    public void execute(Object[] array) {
        InternalWorkingMemory wm = newWorkingMemory();
View Full Code Here

Examples of org.drools.core.common.InternalWorkingMemoryActions.fireAllRules()

        final Person p3 = new Person( "p3" );
        p3.setCheese( stilton );
        wm.insert( p3 );
       
        wm.fireAllRules();

        assertEquals( 3, created.size() );
        assertEquals( 0, cancelled.size() );

        final Activation item = ((ActivationCreatedEvent) created.get( 2 ))
View Full Code Here

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

        assertTrue( handle3.isEvent() );
        assertTrue( handle4.isEvent() );

        assertEquals( 10000,
                      session.getIdleTime() );
        session.fireAllRules();
        assertEquals( 0,
                      session.getIdleTime() );

        assertEquals( 2,
                      ((List) session.getGlobal( "results" )).size() );
View Full Code Here

Examples of org.drools.core.reteoo.ReteooWorkingMemoryInterface.fireAllRules()

        str += "end  \n";        
       
        KnowledgeBase kbase = loadKnowledgeBaseFromString( str );
       
        ReteooWorkingMemoryInterface wm = ((StatefulKnowledgeSessionImpl)kbase.newStatefulKnowledgeSession()).session;
        wm.fireAllRules();
       
       
        ObjectTypeNode otnInit = getObjectTypeNode(kbase, "InitialFactImpl" );
       
        LeftInputAdapterNode liaNode = ( LeftInputAdapterNode ) otnInit.getSinkPropagator().getSinks()[0];
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.