throw new BpmnError(errorCode, "No catching boundary event found for error with errorCode '" + errorCode + "', neither in same process nor in parent process");
@Override public void propagateError(BpmnError bpmnError, DelegateExecution execution) { try { org.activiti.engine.delegate.BpmnError activiti5BpmnError = new org.activiti.engine.delegate.BpmnError(bpmnError.getErrorCode(), bpmnError.getMessage()); ErrorPropagation.propagateError(activiti5BpmnError, (ActivityExecution) execution); } catch (org.activiti.engine.ActivitiException e) { handleActivitiException(e); } }
private static void executeCatchInSuperProcess(String errorCode, ActivityExecution superExecution) { String errorHandlerId = findLocalErrorEventHandler(superExecution, errorCode); if (errorHandlerId != null) { executeCatch(errorHandlerId, superExecution); } else { // no matching catch found, going one level up in process hierarchy ActivityExecution superSuperExecution = getSuperExecution(superExecution); if (superSuperExecution != null) { executeCatchInSuperProcess(errorCode, superSuperExecution); } else { throw new BpmnError(errorCode, "No catching boundary event found for error with errorCode '" + errorCode + "', neither in same process nor in parent process"); } } }
@Override @SuppressWarnings("all") public void executeImpl(DelegateExecution execution) throws Exception { if (activitiHelper.getExpressionVariableAsString(exceptionToThrow, execution) != null) { if (activitiHelper.getExpressionVariableAsString(exceptionToThrow, execution).equals(EXCEPTION_BPMN_ERROR)) { throw new BpmnError(EXCEPTION_BPMN_ERROR); } else if (activitiHelper.getExpressionVariableAsString(exceptionToThrow, execution).equals(EXCEPTION_RUNTIME)) { throw new RuntimeException(EXCEPTION_RUNTIME); } } } }
throw new BpmnError(errorCode, "No catching boundary event found for error with errorCode '" + errorCode + "', neither in same process nor in parent process");
public static void propagateError(String errorCode, ActivityExecution execution) { while (execution != null) { String eventHandlerId = findLocalErrorEventHandler(execution, errorCode); if (eventHandlerId != null) { executeCatch(eventHandlerId, execution, errorCode); break; } if (execution.isProcessInstanceType()) { // dispatch process completed event if (Context.getProcessEngineConfiguration() != null && Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) { Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent( ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.PROCESS_COMPLETED_WITH_ERROR_END_EVENT, execution)); } } execution = getSuperExecution(execution); } if (execution == null) { throw new BpmnError(errorCode, "No catching boundary event found for error with errorCode '" + errorCode + "', neither in same process nor in parent process"); } }