Package org.drools.runtime

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


        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

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

        ksession.fireAllRules();

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

            StatefulKnowledgeSession session = knowledgeBase.newStatefulKnowledgeSession();
            try {
                session.setGlobal("mavenSession", mavenSession);
                session.setGlobal("mavenProject", project);
                session.insert(bundleList);
                session.fireAllRules();
            } finally {
                session.dispose();
            }
        }
    }
View Full Code Here

            try {
                synchronizeContext();

                handles.add(securityContext.insert(check));

                securityContext.fireAllRules();
            } finally {
                for (FactHandle handle : handles) {
                    securityContext.retract(handle);
                }
            }
View Full Code Here

            try {
                handles.add(securityContext.insert(check));

                // Check if there are any additional requirements
                securityContext.fireAllRules();
                /*
                if (check.hasRequirements())
                {
                   for (String requirement : check.getRequirements())
                   {
View Full Code Here

                synchronizeContext();

                handles.add(securityContext.insert(roleCheck));
                handles.add(securityContext.insert(check));

                securityContext.fireAllRules();
            } finally {
                for (FactHandle handle : handles) {
                    securityContext.retract(handle);
                }
            }
View Full Code Here

        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

       
        FactHandle handle = ksession.insert(new MyObject("obj1"));
        Assert.assertNotNull(handle);
        Assert.assertEquals(true, ((DefaultFactHandle)handle).isDisconnected());
       
        int fired = ksession.fireAllRules();
       
        Assert.assertEquals(fired, 1);
    }
    @Test
    public void hello(){}
View Full Code Here

        MessageProducer producer = MessageFactory.createMessageProducer();

        ksession.setGlobal("messageProducer", producer);
       
       
        ksession.fireAllRules();
       
        producer.stop();
       
        Object object = consumer.receiveMessage();
        Assert.assertNotNull(object);
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.