Examples of fireAllRules()


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

        ProcessInstance processInstance = ksession.startProcess("TimerBoundaryEvent");
        assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
        Thread.sleep(1000);
        ksession = restoreSession(ksession, true);
        System.out.println("Firing timer");
        ksession.fireAllRules();
    assertProcessInstanceCompleted(processInstance.getId(), ksession);
    }

    public void testAdHocSubProcess() throws Exception {
    KnowledgeBuilderConfiguration conf = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
View Full Code Here

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

        assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
        WorkItem workItem = workItemHandler.getWorkItem();
        assertNull(workItem);
        ksession = restoreSession(ksession, true);
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler);
        ksession.fireAllRules();
        System.out.println("Signaling Hello2");
        ksession.signalEvent("Hello2", null, processInstance.getId());
        workItem = workItemHandler.getWorkItem();
        assertNotNull(workItem);
        ksession = restoreSession(ksession, true);
View Full Code Here

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

        assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
        WorkItem workItem = workItemHandler.getWorkItem();
        assertNull(workItem);
        ksession = restoreSession(ksession, true);
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler);
        ksession.fireAllRules();
        workItem = workItemHandler.getWorkItem();
        assertNotNull(workItem);
        ksession = restoreSession(ksession, true);
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler);
        ksession.getWorkItemManager().completeWorkItem(workItem.getId(), null);
View Full Code Here

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

        assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
        // now wait for 1 second for timer to trigger
        Thread.sleep(1000);
        ksession = restoreSession(ksession, true);
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler());
        ksession.fireAllRules();
    assertProcessInstanceCompleted(processInstance.getId(), ksession);
    }

    public void testIntermediateCatchEventTimerCycle1() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-IntermediateCatchEventTimerCycle1.bpmn2");
View Full Code Here

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

        assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
        // now wait for 1 second for timer to trigger
        Thread.sleep(1000);
        ksession = restoreSession(ksession, true);
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler());
        ksession.fireAllRules();
    assertProcessInstanceCompleted(processInstance.getId(), ksession);
    }

    public void testIntermediateCatchEventTimerCycle2() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-IntermediateCatchEventTimerCycle2.bpmn2");
View Full Code Here

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

        KnowledgeBase kbase = createKnowledgeBase("BPMN2-ConditionalStart.bpmn2");
    StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
        Person person = new Person();
        person.setName("jack");
        ksession.insert(person);
        ksession.fireAllRules();
        person = new Person();
        person.setName("john");
        ksession.insert(person);
        ksession.fireAllRules();
    }
View Full Code Here

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

        ksession.insert(person);
        ksession.fireAllRules();
        person = new Person();
        person.setName("john");
        ksession.insert(person);
        ksession.fireAllRules();
    }
   
    public void testTimerStart() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-TimerStart.bpmn2");
    StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
View Full Code Here

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

      }
    });
    Thread.sleep(250);
    assertEquals(0, list.size());
        for (int i = 0; i < 5; i++) {
          ksession.fireAllRules();
          Thread.sleep(500);
        }
        assertEquals(5, list.size());
    }
   
View Full Code Here

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

        list.add(event.getProcessInstance().getId());
      }
    });
    Thread.sleep(500);
        for (int i = 0; i < 5; i++) {
          ksession.fireAllRules();
          Thread.sleep(1000);
        }
        assertEquals(6, list.size());
    }
   
View Full Code Here

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

        ksession.insert( 1 );
        ksession.insert( 2 );
        ksession.insert( 3 );

        ksession.fireAllRules();

        assertEquals( 3,
                      list.size() );

    }
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.