use of org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler in project jbpm by kiegroup.
the class IntermediateEventTest method testEventBasedSplitBefore.
@Test
public void testEventBasedSplitBefore() throws Exception {
// signaling before the split is reached should have no effect
KieBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit.bpmn2");
ksession = createKnowledgeSession(kbase);
ksession.getWorkItemManager().registerWorkItemHandler("Email1", new DoNothingWorkItemHandler());
ksession.getWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler());
// Yes
ProcessInstance processInstance = ksession.startProcess("com.sample.test");
assertProcessInstanceActive(processInstance);
ksession = restoreSession(ksession, true);
ksession.getWorkItemManager().registerWorkItemHandler("Email1", new DoNothingWorkItemHandler());
ksession.getWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler());
ksession.signalEvent("Yes", "YesValue", processInstance.getId());
assertProcessInstanceActive(processInstance);
// No
processInstance = ksession.startProcess("com.sample.test");
assertProcessInstanceActive(processInstance);
ksession = restoreSession(ksession, true);
ksession.getWorkItemManager().registerWorkItemHandler("Email1", new DoNothingWorkItemHandler());
ksession.getWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler());
ksession.signalEvent("No", "NoValue", processInstance.getId());
assertProcessInstanceActive(processInstance);
}
use of org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler in project jbpm by kiegroup.
the class StandaloneBPMNProcessTest method testTimerBoundaryEvent.
@Test(timeout = 10000)
public void testTimerBoundaryEvent() throws Exception {
NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("TimerEvent", 1);
KieBase kbase = createKnowledgeBase("BPMN2-TimerBoundaryEventDuration.bpmn2");
KieSession ksession = createKnowledgeSession(kbase);
ksession.addEventListener(countDownListener);
ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler());
ProcessInstance processInstance = ksession.startProcess("TimerBoundaryEvent");
assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_ACTIVE);
countDownListener.waitTillCompleted();
assertProcessInstanceCompleted(processInstance.getId(), ksession);
}
use of org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler in project jbpm by kiegroup.
the class StandaloneBPMNProcessTest method testTimerBoundaryEventInterrupting.
@Test(timeout = 10000)
public void testTimerBoundaryEventInterrupting() throws Exception {
NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("TimerEvent", 1);
KieBase kbase = createKnowledgeBase("BPMN2-TimerBoundaryEventInterrupting.bpmn2");
KieSession ksession = createKnowledgeSession(kbase);
ksession.addEventListener(countDownListener);
ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler());
ProcessInstance processInstance = ksession.startProcess("TimerBoundaryEvent");
assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_ACTIVE);
countDownListener.waitTillCompleted();
assertProcessInstanceCompleted(processInstance.getId(), ksession);
}
use of org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler in project jbpm by kiegroup.
the class StandaloneBPMNProcessTest method testEventBasedSplitBefore.
@Test
public void testEventBasedSplitBefore() throws Exception {
// signaling before the split is reached should have no effect
KieBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit.bpmn2");
KieSession ksession = createKnowledgeSession(kbase);
ksession.getWorkItemManager().registerWorkItemHandler("Email1", new DoNothingWorkItemHandler());
ksession.getWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler());
// Yes
ProcessInstance processInstance = ksession.startProcess("com.sample.test");
assertThat(processInstance.getState()).isEqualTo(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());
assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_ACTIVE);
// No
processInstance = ksession.startProcess("com.sample.test");
assertThat(processInstance.getState()).isEqualTo(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());
assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_ACTIVE);
}
use of org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler in project jbpm by kiegroup.
the class ErrorEventTest method testErrorBoundaryEvent.
@Test
public void testErrorBoundaryEvent() throws Exception {
KieBase kbase = createKnowledgeBase("BPMN2-ErrorBoundaryEventInterrupting.bpmn2");
ksession = createKnowledgeSession(kbase);
ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler());
ProcessInstance processInstance = ksession.startProcess("ErrorBoundaryEvent");
assertProcessInstanceFinished(processInstance, ksession);
}
Aggregations