/** * Decides how to propagate the exception properly, e.g. as bpmn error or "normal" error. * @param execution the current execution * @param ex the exception to propagate * @throws Exception if no error handler could be found */ protected void propagateException(ActivityExecution execution, Exception ex) throws Exception { BpmnError bpmnError = checkIfCauseOfExceptionIsBpmnError(ex); if (bpmnError != null) { propagateBpmnError(bpmnError, execution); } else { propagateExceptionAsError(ex, execution); } }
@Override public void doLeave(ActivityExecution execution) { CompensationUtil.createEventScopeExecution((ExecutionEntity) execution); super.doLeave(execution); }
protected void propagateExceptionAsError(Exception exception, ActivityExecution execution) throws Exception { if (isProcessEngineExceptionWithoutCause(exception) || isTransactionNotActive()) { throw exception; } else { propagateError(null, exception.getMessage(),exception, execution); } }
/** * Subclasses that call leave() will first pass through this method, before * the regular {@link FlowNodeActivityBehavior#leave(ActivityExecution)} is * called. */ @Override public void doLeave(ActivityExecution execution) { PvmActivity currentActivity = execution.getActivity(); ActivityImpl compensationHandler = ((ActivityImpl) currentActivity).findCompensationHandler(); // subscription for compensation event subprocess is already created if(compensationHandler != null && !isCompensationEventSubprocess(compensationHandler)) { createCompensateEventSubscription(execution, compensationHandler); } super.doLeave(execution); }
/** * Overrides the propagateBpmnError method to made it public. * Is used to propagate the bpmn error from an external task. * @param error the error which should be propagated * @param execution the current activity execution * @throws Exception throwsn an exception if no handler was found */ @Override public void propagateBpmnError(BpmnError error, ActivityExecution execution) throws Exception { super.propagateBpmnError(error, execution); }
protected void propagateBpmnError(BpmnError error, ActivityExecution execution) throws Exception { propagateError(error.getErrorCode(), error.getMessage(), null, execution); }
/** * Searches recursively through the exception to see if the exception itself * or one of its causes is a {@link BpmnError}. * * @param e * the exception to check * @return the BpmnError that was the cause of this exception or null if no * BpmnError was found */ protected BpmnError checkIfCauseOfExceptionIsBpmnError(Throwable e) { if (e instanceof BpmnError) { return (BpmnError) e; } else if (e.getCause() == null) { return null; } return checkIfCauseOfExceptionIsBpmnError(e.getCause()); }
propagateException(execution, ex);
/** * Subclasses that call leave() will first pass through this method, before * the regular {@link FlowNodeActivityBehavior#leave(ActivityExecution)} is * called. */ @Override public void doLeave(ActivityExecution execution) { PvmActivity currentActivity = execution.getActivity(); ActivityImpl compensationHandler = ((ActivityImpl) currentActivity).findCompensationHandler(); // subscription for compensation event subprocess is already created if(compensationHandler != null && !isCompensationEventSubprocess(compensationHandler)) { createCompensateEventSubscription(execution, compensationHandler); } super.doLeave(execution); }
/** * Overrides the propagateBpmnError method to made it public. * Is used to propagate the bpmn error from an external task. * @param error the error which should be propagated * @param execution the current activity execution * @throws Exception throwsn an exception if no handler was found */ @Override public void propagateBpmnError(BpmnError error, ActivityExecution execution) throws Exception { super.propagateBpmnError(error, execution); }
protected void propagateBpmnError(BpmnError error, ActivityExecution execution) throws Exception { propagateError(error.getErrorCode(), error.getMessage(), null, execution); }
/** * Searches recursively through the exception to see if the exception itself * or one of its causes is a {@link BpmnError}. * * @param e * the exception to check * @return the BpmnError that was the cause of this exception or null if no * BpmnError was found */ protected BpmnError checkIfCauseOfExceptionIsBpmnError(Throwable e) { if (e instanceof BpmnError) { return (BpmnError) e; } else if (e.getCause() == null) { return null; } return checkIfCauseOfExceptionIsBpmnError(e.getCause()); }
propagateException(execution, ex);
protected void propagateExceptionAsError(Exception exception, ActivityExecution execution) throws Exception { if (isProcessEngineExceptionWithoutCause(exception) || isTransactionNotActive()) { throw exception; } else { propagateError(null, exception.getMessage(),exception, execution); } }
/** * Decides how to propagate the exception properly, e.g. as bpmn error or "normal" error. * @param execution the current execution * @param ex the exception to propagate * @throws Exception if no error handler could be found */ protected void propagateException(ActivityExecution execution, Exception ex) throws Exception { BpmnError bpmnError = checkIfCauseOfExceptionIsBpmnError(ex); if (bpmnError != null) { propagateBpmnError(bpmnError, execution); } else { propagateExceptionAsError(ex, execution); } }
/** * Subclasses that call leave() will first pass through this method, before * the regular {@link FlowNodeActivityBehavior#leave(ActivityExecution)} is * called. */ @Override public void doLeave(ActivityExecution execution) { PvmActivity currentActivity = execution.getActivity(); ActivityImpl compensationHandler = ((ActivityImpl) currentActivity).findCompensationHandler(); // subscription for compensation event subprocess is already created if(compensationHandler != null && !isCompensationEventSubprocess(compensationHandler)) { createCompensateEventSubscription(execution, compensationHandler); } super.doLeave(execution); }
@Override public void doLeave(ActivityExecution execution) { CompensationUtil.createEventScopeExecution((ExecutionEntity) execution); super.doLeave(execution); }
/** * Overrides the propagateBpmnError method to made it public. * Is used to propagate the bpmn error from an external task. * @param error the error which should be propagated * @param execution the current activity execution * @throws Exception throwsn an exception if no handler was found */ @Override public void propagateBpmnError(BpmnError error, ActivityExecution execution) throws Exception { super.propagateBpmnError(error, execution); }
protected void propagateBpmnError(BpmnError error, ActivityExecution execution) throws Exception { propagateError(error.getErrorCode(), error.getMessage(), null, execution); }
/** * Searches recursively through the exception to see if the exception itself * or one of its causes is a {@link BpmnError}. * * @param e * the exception to check * @return the BpmnError that was the cause of this exception or null if no * BpmnError was found */ protected BpmnError checkIfCauseOfExceptionIsBpmnError(Throwable e) { if (e instanceof BpmnError) { return (BpmnError) e; } else if (e.getCause() == null) { return null; } return checkIfCauseOfExceptionIsBpmnError(e.getCause()); }