use of org.jbpm.bpmn2.handler.SignallingTaskHandlerDecorator in project jbpm by kiegroup.
the class EventSubprocessTest method testErrorCodeException.
@Test
@BZ("1082111")
public void testErrorCodeException() {
KieSession ksession = createKSession(ERROR_CODE_EXCEPTION);
ksession.getWorkItemManager().registerWorkItemHandler("Request Handler", new SignallingTaskHandlerDecorator(ExceptionOnPurposeHandler.class, "Error-90277"));
ksession.getWorkItemManager().registerWorkItemHandler("Error Handler", new SystemOutWorkItemHandler());
try {
ProcessInstance processInstance = ksession.startProcess(ERROR_CODE_EXCEPTION_ID);
assertProcessInstanceNotActive(processInstance.getId(), ksession);
Assertions.assertThat(((WorkflowProcessInstance) processInstance).getOutcome()).isEqualTo("90277");
} catch (WorkflowRuntimeException e) {
fail("Error code exceptions in subprocess does not work.");
}
}
Aggregations