Package org.drools.runtime

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


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


    processInstance = ksession.startProcess("com.sample.test");
    assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
    ksession = restoreSession(ksession, true);
    ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler());
    ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler());
        ksession.signalEvent("No", "NoValue", processInstance.getId());
    assertProcessInstanceCompleted(processInstance.getId(), ksession);
  }
 
  public void testEventBasedSplitBefore() throws Exception {
    // signaling before the split is reached should have no effect
View Full Code Here

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

    processInstance = ksession.startProcess("com.sample.test");
    assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
    ksession = restoreSession(ksession, true);
    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, true);
    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, true);
    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, true);
    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.bpmn2");
    StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
View Full Code Here

    ProcessInstance processInstance = ksession.startProcess("com.sample.test");
    assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
    ksession = restoreSession(ksession, true);
    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, true);
    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, true);
    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, true);
    ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler());
    ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler());
    // No
View Full Code Here

    ksession = restoreSession(ksession, true);
    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.bpmn2");
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, true);
        // now signal process instance
    ksession.signalEvent("MyMessage", "SomeValue", processInstance.getId());
    assertProcessInstanceCompleted(processInstance.getId(), ksession);
  }

    public void testIntermediateCatchEventMessage() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-IntermediateCatchEventMessage.bpmn2");
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.