use of org.camunda.bpm.engine.delegate.BpmnError in project camunda-bpm-platform by camunda.
the class InputOutputTest method FAILING_testBpmnErrorInScriptOutputMapping.
@Deployment(resources = "org/camunda/bpm/engine/test/bpmn/iomapping/InputOutputTest.testThrowErrorInScriptInputOutputMapping.bpmn")
public void FAILING_testBpmnErrorInScriptOutputMapping() {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("throwInMapping", "out");
variables.put("exception", new BpmnError("error"));
runtimeService.startProcessInstanceByKey("testProcess", variables);
// we will only reach the user task if the BPMNError from the script was handled by the boundary event
Task task = taskService.createTaskQuery().singleResult();
assertThat(task.getName(), is("User Task"));
}
use of org.camunda.bpm.engine.delegate.BpmnError in project camunda-bpm-platform by camunda.
the class ConnectProcessEnginePluginTest method testConnectorBpmnErrorThrownInScriptResourceNoAsyncAfterJobIsCreated.
@Deployment(resources = "org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorBpmnErrorThrownInScriptResourceNoAsyncAfterJobIsCreated.bpmn")
public void testConnectorBpmnErrorThrownInScriptResourceNoAsyncAfterJobIsCreated() {
// given
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("throwInMapping", "in");
variables.put("exception", new BpmnError("error"));
// when
runtimeService.startProcessInstanceByKey("testProcess", variables);
// then
// we will only reach the user task if the BPMNError from the script was handled by the boundary event
Task task = taskService.createTaskQuery().singleResult();
assertThat(task.getName(), is("User Task"));
// no job is created
assertThat(Long.valueOf(managementService.createJobQuery().count()), is(0l));
}
use of org.camunda.bpm.engine.delegate.BpmnError in project camunda-bpm-platform by camunda.
the class ConnectProcessEnginePluginTest method testConnectorBpmnErrorThrownInScriptOutputMappingIsHandledByBoundaryEvent.
@Deployment(resources = "org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorWithThrownExceptionInScriptInputOutputMapping.bpmn")
public void testConnectorBpmnErrorThrownInScriptOutputMappingIsHandledByBoundaryEvent() {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("throwInMapping", "out");
variables.put("exception", new BpmnError("error"));
runtimeService.startProcessInstanceByKey("testProcess", variables);
// we will only reach the user task if the BPMNError from the script was handled by the boundary event
Task task = taskService.createTaskQuery().singleResult();
assertThat(task.getName(), is("User Task"));
}
use of org.camunda.bpm.engine.delegate.BpmnError in project camunda-bpm-platform by camunda.
the class BoundaryErrorEventTest method testUncaughtError.
@Deployment(resources = { "org/camunda/bpm/engine/test/bpmn/event/error/BoundaryErrorEventTest.subprocess.bpmn20.xml" })
public void testUncaughtError() {
runtimeService.startProcessInstanceByKey("simpleSubProcess");
Task task = taskService.createTaskQuery().singleResult();
assertEquals("Task in subprocess", task.getName());
try {
// Completing the task will reach the end error event,
// which is never caught in the process
taskService.complete(task.getId());
} catch (BpmnError e) {
assertTextPresent("No catching boundary event found for error with errorCode 'myError', neither in same process nor in parent process", e.getMessage());
}
}
use of org.camunda.bpm.engine.delegate.BpmnError in project camunda-bpm-platform by camunda.
the class InputOutputTest method FAILING_testBpmnErrorInScriptInputMapping.
@Deployment(resources = "org/camunda/bpm/engine/test/bpmn/iomapping/InputOutputTest.testThrowErrorInScriptInputOutputMapping.bpmn")
public void FAILING_testBpmnErrorInScriptInputMapping() {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("throwInMapping", "in");
variables.put("exception", new BpmnError("error"));
runtimeService.startProcessInstanceByKey("testProcess", variables);
// we will only reach the user task if the BPMNError from the script was handled by the boundary event
Task task = taskService.createTaskQuery().singleResult();
assertThat(task.getName(), is("User Task"));
}
Aggregations