use of org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler in project jbpm by kiegroup.
the class IntermediateEventTest method testConditionalBoundaryEventInterrupting.
@Test
public void testConditionalBoundaryEventInterrupting() throws Exception {
KieBase kbase = createKnowledgeBase("BPMN2-ConditionalBoundaryEventInterrupting.bpmn2");
ksession = createKnowledgeSession(kbase);
ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler());
ProcessInstance processInstance = ksession.startProcess("ConditionalBoundaryEvent");
assertProcessInstanceActive(processInstance);
ksession = restoreSession(ksession, true);
Person person = new Person();
person.setName("john");
ksession.insert(person);
assertProcessInstanceFinished(processInstance, ksession);
assertNodeTriggered(processInstance.getId(), "StartProcess", "Hello", "StartSubProcess", "Task", "BoundaryEvent", "Goodbye", "EndProcess");
}
use of org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler in project jbpm by kiegroup.
the class IntermediateEventTest method testSignalBoundaryEventInterrupting.
@Test
public void testSignalBoundaryEventInterrupting() throws Exception {
KieBase kbase = createKnowledgeBase("BPMN2-SignalBoundaryEventInterrupting.bpmn2");
ksession = createKnowledgeSession(kbase);
ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler());
ProcessInstance processInstance = ksession.startProcess("SignalBoundaryEvent");
assertProcessInstanceActive(processInstance);
ksession = restoreSession(ksession, true);
ksession.signalEvent("MyMessage", null);
assertProcessInstanceFinished(processInstance, ksession);
}
use of org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler in project jbpm by kiegroup.
the class IntermediateEventTest method testTimerBoundaryEventCycle1.
@Test(timeout = 10000)
public void testTimerBoundaryEventCycle1() throws Exception {
NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("TimerEvent", 1);
KieBase kbase = createKnowledgeBase("BPMN2-TimerBoundaryEventCycle1.bpmn2");
ksession = createKnowledgeSession(kbase);
ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler());
ksession.addEventListener(countDownListener);
ProcessInstance processInstance = ksession.startProcess("TimerBoundaryEvent");
assertProcessInstanceActive(processInstance);
countDownListener.waitTillCompleted();
ksession = restoreSession(ksession, true);
assertProcessInstanceFinished(processInstance, ksession);
}
use of org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler in project jbpm by kiegroup.
the class IntermediateEventTest method testTimerBoundaryEventCycle2.
@Test(timeout = 10000)
public void testTimerBoundaryEventCycle2() throws Exception {
NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("TimerEvent", 3);
KieBase kbase = createKnowledgeBase("BPMN2-TimerBoundaryEventCycle2.bpmn2");
ksession = createKnowledgeSession(kbase);
ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler());
ksession.addEventListener(countDownListener);
ProcessInstance processInstance = ksession.startProcess("TimerBoundaryEvent");
assertProcessInstanceActive(processInstance);
countDownListener.waitTillCompleted();
assertProcessInstanceActive(processInstance);
ksession.abortProcessInstance(processInstance.getId());
}
use of org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler in project jbpm by kiegroup.
the class IntermediateEventTest method testTimerBoundaryEventCycleISO.
@Test(timeout = 10000)
@RequirePersistence(false)
public void testTimerBoundaryEventCycleISO() throws Exception {
NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("TimerEvent", 2);
KieBase kbase = createKnowledgeBase("BPMN2-TimerBoundaryEventCycleISO.bpmn2");
ksession = createKnowledgeSession(kbase);
ksession.addEventListener(countDownListener);
ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler());
ProcessInstance processInstance = ksession.startProcess("TimerBoundaryEvent");
assertProcessInstanceActive(processInstance);
countDownListener.waitTillCompleted();
assertProcessInstanceActive(processInstance);
ksession.abortProcessInstance(processInstance.getId());
}
Aggregations