use of org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler in project jbpm by kiegroup.
the class GatewayTest method testExclusiveSplitXPathAdvanced.
@Test
@BZ("1071000")
public void testExclusiveSplitXPathAdvanced() throws Exception {
KieSession ksession = createKSession(XPATH_EVALUATION);
ksession.getWorkItemManager().registerWorkItemHandler("Email", new SystemOutWorkItemHandler());
Map<String, Object> params = new HashMap<String, Object>();
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
Element hi = doc.createElement("hi");
Element ho = doc.createElement("ho");
hi.appendChild(ho);
Attr attr = doc.createAttribute("value");
ho.setAttributeNode(attr);
attr.setValue("a");
params.put("x", hi);
params.put("y", "Second");
ProcessInstance processInstance = ksession.startProcess(XPATH_EVALUATION_ID, params);
assertProcessInstanceCompleted(processInstance.getId());
}
use of org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler 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