Package org.drools.runtime

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


    processInstance = ksession.startProcess("com.sample.test");
    assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
    ksession = restoreSession(ksession);
    ksession.getWorkItemManager().registerWorkItemHandler("Email1", new DoNothingWorkItemHandler());
    ksession.getWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler());
        ksession.signalEvent("No", "NoValue", processInstance.getId());
    assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
  }
 
  public void testEventBasedSplitAfter() throws Exception {
    // signaling the other alternative after one has been selected should have no effect
View Full Code Here


    ProcessInstance processInstance = ksession.startProcess("com.sample.test");
    assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
    ksession = restoreSession(ksession);
    ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler());
    ksession.getWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler());
        ksession.signalEvent("Yes", "YesValue", processInstance.getId());
    assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
    ksession = restoreSession(ksession);
    ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler());
    ksession.getWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler());
        // No
View Full Code Here

    assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
    ksession = restoreSession(ksession);
    ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler());
    ksession.getWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler());
        // No
    ksession.signalEvent("No", "NoValue", processInstance.getId());
  }
 
  public void testEventBasedSplit2() throws Exception {
    KnowledgeBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit2.xml");
    StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
View Full Code Here

    ProcessInstance processInstance = ksession.startProcess("com.sample.test");
    assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
    ksession = restoreSession(ksession);
    ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler());
    ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler());
        ksession.signalEvent("Yes", "YesValue", processInstance.getId());
    assertProcessInstanceCompleted(processInstance.getId(), ksession);
    Thread.sleep(800);
    ksession = restoreSession(ksession);
    ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler());
    ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler());
View Full Code Here

    ProcessInstance processInstance = ksession.startProcess("com.sample.test");
    assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
    ksession = restoreSession(ksession);
    ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler());
    ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler());
        ksession.signalEvent("Yes", "YesValue", processInstance.getId());
    assertProcessInstanceCompleted(processInstance.getId(), ksession);
    // Condition
    processInstance = ksession.startProcess("com.sample.test");
    assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
    ksession = restoreSession(ksession);
View Full Code Here

    ProcessInstance processInstance = ksession.startProcess("com.sample.test");
    assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
    ksession = restoreSession(ksession);
    ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler());
    ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler());
        ksession.signalEvent("Message-YesMessage", "YesValue", processInstance.getId());
    assertProcessInstanceCompleted(processInstance.getId(), ksession);
    ksession = restoreSession(ksession);
    ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler());
    ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler());
    // No
View Full Code Here

    ksession = restoreSession(ksession);
    ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler());
    ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler());
    // No
    processInstance = ksession.startProcess("com.sample.test");
    ksession.signalEvent("Message-NoMessage", "NoValue", processInstance.getId());
    assertProcessInstanceCompleted(processInstance.getId(), ksession);
  }
 
  public void testEventBasedSplit5() throws Exception {
    KnowledgeBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit5.xml");
View Full Code Here

        assertNull(workItem);
        ksession = restoreSession(ksession);
        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);
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler);
        ksession.getWorkItemManager().completeWorkItem(workItem.getId(), null);
View Full Code Here

    ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler());
    ProcessInstance processInstance = ksession.startProcess("IntermediateCatchEvent");
    assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
    ksession = restoreSession(ksession);
        // now signal process instance
    ksession.signalEvent("MyMessage", "SomeValue", processInstance.getId());
    assertProcessInstanceCompleted(processInstance.getId(), ksession);
  }

    public void testIntermediateCatchEventMessage() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-IntermediateCatchEventMessage.xml");
View Full Code Here

        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler());
        ProcessInstance processInstance = ksession.startProcess("IntermediateCatchEvent");
        assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
        ksession = restoreSession(ksession);
        // now signal process instance
        ksession.signalEvent("Message-HelloMessage", "SomeValue", processInstance.getId());
    assertProcessInstanceCompleted(processInstance.getId(), ksession);
    }

    public void testIntermediateCatchEventTimer() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-IntermediateCatchEventTimer.xml");
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.