public void execute(DelegateExecution execution) throws Exception { throw new BpmnError("org.camunda.bpm.qa.upgrade.BuisnessError", "Expected exception"); } }
protected void propagateBpmnError(BpmnError error, ActivityExecution execution) throws Exception { propagateError(error.getErrorCode(), error.getMessage(), null, execution); }
public BpmnError(String errorCode, String message) { super(message + " (errorCode='" + errorCode + "')"); setErrorCode(errorCode); setMessage(message); }
@Deployment(resources = { "org/camunda/bpm/engine/test/bpmn/event/error/BoundaryErrorEventTest.testUncaughtErrorThrownByJavaDelegateOnCallActivity-parent.bpmn20.xml", "org/camunda/bpm/engine/test/bpmn/event/error/BoundaryErrorEventTest.testCatchErrorThrownByJavaDelegateOnCallActivity-child.bpmn20.xml" }) public void testUncaughtErrorThrownByJavaDelegateOnCallActivity() { try { runtimeService.startProcessInstanceByKey("uncaughtErrorThrownByJavaDelegateOnCallActivity-parent"); } catch (BpmnError e) { assertTextPresent("No catching boundary event found for error with errorCode '23', neither in same process nor in parent process", e.getMessage()); } }
public BpmnError(String errorCode) { super(""); setErrorCode(errorCode); }
@Deployment(resources = { "org/camunda/bpm/engine/test/bpmn/event/error/BoundaryErrorEventTest.testCatchErrorThrownByJavaDelegateOnCallActivity-child.bpmn20.xml" }) public void testUncaughtErrorThrownByJavaDelegateOnServiceTask() { try { runtimeService.startProcessInstanceByKey("catchErrorThrownByJavaDelegateOnCallActivity-child"); } catch (BpmnError e) { assertTextPresent("No catching boundary event found for error with errorCode '23', neither in same process nor in parent process", e.getMessage()); } }
public BpmnError(String errorCode) { super(""); setErrorCode(errorCode); }
@Override public void signal(ActivityExecution execution, String signalName, Object signalData) throws Exception { throw new BpmnError("23", "Testing bpmn error in SignallableActivityBehaviour#signal"); } }
protected void propagateBpmnError(BpmnError error, ActivityExecution execution) throws Exception { propagateError(error.getErrorCode(), error.getMessage(), null, execution); }
@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()); } }
public BpmnError(String errorCode, String message) { super(message + " (errorCode='" + errorCode + "')"); setErrorCode(errorCode); setMessage(message); }
public BpmnError(String errorCode) { super(""); setErrorCode(errorCode); }
@Override public void mapOutputVariables(DelegateExecution superExecution, VariableScope subInstance) { throw new BpmnError("1234"); } }
protected void propagateBpmnError(BpmnError error, ActivityExecution execution) throws Exception { propagateError(error.getErrorCode(), error.getMessage(), null, execution); }
@Deployment(resources = { "org/camunda/bpm/engine/test/bpmn/event/error/BoundaryErrorEventTest.testUncaughtErrorOnCallActivity-parent.bpmn20.xml", "org/camunda/bpm/engine/test/bpmn/event/error/BoundaryErrorEventTest.subprocess.bpmn20.xml" }) public void testUncaughtErrorOnCallActivity() { runtimeService.startProcessInstanceByKey("uncaughtErrorOnCallActivity"); 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()); } }
public BpmnError(String errorCode, String message) { super(message + " (errorCode='" + errorCode + "')"); setErrorCode(errorCode); setMessage(message); }
@Override public void execute(DelegateExecution execution) throws Exception { throw new BpmnError("E1"); } }
@Deployment(resources = { "org/camunda/bpm/engine/test/bpmn/event/error/BoundaryErrorEventTest.testCatchErrorThrownByJavaDelegateOnCallActivity-child.bpmn20.xml" }) public void testUncaughtErrorThrownByJavaDelegateOnServiceTask() { try { runtimeService.startProcessInstanceByKey("catchErrorThrownByJavaDelegateOnCallActivity-child"); } catch (BpmnError e) { assertTextPresent("No catching boundary event found for error with errorCode '23', neither in same process nor in parent process", e.getMessage()); } }
public void execute(DelegateExecution execution) throws Exception { if (firstAttempt) { throw new BpmnError("It is supposed to fail."); } }
@Deployment(resources = { "org/camunda/bpm/engine/test/bpmn/event/error/BoundaryErrorEventTest.testUncaughtErrorThrownByJavaDelegateOnCallActivity-parent.bpmn20.xml", "org/camunda/bpm/engine/test/bpmn/event/error/BoundaryErrorEventTest.testCatchErrorThrownByJavaDelegateOnCallActivity-child.bpmn20.xml" }) public void testUncaughtErrorThrownByJavaDelegateOnCallActivity() { try { runtimeService.startProcessInstanceByKey("uncaughtErrorThrownByJavaDelegateOnCallActivity-parent"); } catch (BpmnError e) { assertTextPresent("No catching boundary event found for error with errorCode '23', neither in same process nor in parent process", e.getMessage()); } }