Examples of fireAllRules()


Examples of org.drools.runtime.StatefulKnowledgeSession.fireAllRules()

        ut.rollback();

        // check we rolled back the state changes from the 3rd insert
        ut = (UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );
        ut.begin();       
        ksession.fireAllRules();
        ut.commit();
        assertEquals( 2,
                      list.size() );

//        // insert and commit
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.fireAllRules()

        ut.begin();
        ksession.insert( 5 );
        ksession.insert( 6 );
        ut.rollback();

        ksession.fireAllRules();

        assertEquals( 4,
                      list.size() );
       
        // now load the ksession
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.fireAllRules()

        ut.begin();
        ksession.insert( 7 );
        ksession.insert( 8 );
        ut.commit();

        ksession.fireAllRules();

        assertEquals( 6,
                      list.size() );
    }
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.fireAllRules()

        ksession = JPAKnowledgeService.loadStatefulKnowledgeSession( id, kbase, null, env );
        processInstance = ksession.getProcessInstance( processInstance.getId() );
        assertNotNull( processInstance );

        ksession = JPAKnowledgeService.loadStatefulKnowledgeSession( id, kbase, null, env );
        ksession.fireAllRules();
        processInstance = ksession.getProcessInstance( processInstance.getId() );
        assertNull( processInstance );
    }
   
    public void testPersistenceEvents() {
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.fireAllRules()

        ksession.insert( 1 );
        ksession.insert( 2 );
        ksession.insert( 3 );
        ksession.getAgenda().getAgendaGroup("badfocus").setFocus();

        ksession.fireAllRules();

        assertEquals( 3,
                      list.size() );
    }
View Full Code Here

Examples of org.drools.runtime.StatelessKnowledgeSession.fireAllRules()

        if (false) {
            StatefulKnowledgeSession s = createStatefulSession(packageNames);
//      List facts=new ArrayList();
//      facts.add("ping");
            org.drools.runtime.rule.FactHandle fact1 = s.insert("ping");
            s.fireAllRules();
            System.out.println(fact1.toString());
//      for (Object x : facts) {
//        System.out.println(x);
//      }
            s.dispose();
View Full Code Here

Examples of org.jbpm.simulation.impl.WorkingMemorySimulationRepository.fireAllRules()

       
        SimulationRepository repo = SimulationRunner.runSimulation("BPMN2-TwoUserTasks", out, 10, 2000, "default.simulation.rules.drl");
        assertNotNull(repo);
       
        WorkingMemorySimulationRepository wmRepo = (WorkingMemorySimulationRepository) repo;
        wmRepo.fireAllRules();
       
        assertEquals(4, wmRepo.getAggregatedEvents().size());
        assertEquals(50, wmRepo.getEvents().size());
       
        AggregatedSimulationEvent event = wmRepo.getAggregatedEvents().get(0);
View Full Code Here

Examples of org.kie.api.runtime.KieSession.fireAllRules()

    @Override
    public int evaluateInSharedSession(Message message) {
        final KieSession kieSession = session.get();
        if (kieSession != null) {
            kieSession.insert(message);
            return kieSession.fireAllRules();
        }
        return 0;
    }

    @Override
View Full Code Here

Examples of org.kie.internal.runtime.StatefulKnowledgeSession.fireAllRules()

                "    };\n" +
                "end";

        KnowledgeBase kbase = loadKnowledgeBaseFromString(str);
        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
        ksession.fireAllRules();
    }

    @Test
    public void testDynamicAddRule() {
        // DROOLS-17
View Full Code Here

Examples of org.kie.runtime.KieSession.fireAllRules()

        KieSession kSession = kContainer.newKieSession( "ksession1" );
        kSession.setGlobal( "out", out );
       
        Object msg1 = createMessage( kContainer,"Dave", "Hello, HAL. Do you read me, HAL?" );       
        kSession.insert( msg1 );
        kSession.fireAllRules();           
    }
   
    public static void main( String[] args ) {
        new KieContainerFromKieRepoExample().go( System.out );
    }
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.