private void failFlowIfSplitStepFailed(Execution execution) throws InterruptedException { if (execution.getSystemContext().hasStepErrorKey()) { String exception = execution.getSystemContext().getStepErrorKey(); execution.getSystemContext().setFlowTerminationType(ExecutionStatus.SYSTEM_FAILURE); execution.setPosition(null); // this ends the flow!!! try { createErrorEvent(exception, "Error occurred during split step ", EventConstants.SCORE_STEP_SPLIT_ERROR, execution.getSystemContext()); } catch (RuntimeException eventEx) { logger.error("Failed to create event: ", eventEx); } throw new RuntimeException(exception); } }
@Override public FinishedBranch convert(Execution execution) { boolean isBranchCancelled = ExecutionStatus.CANCELED.equals(execution.getSystemContext().getFlowTerminationType()); return new FinishedBranch(execution.getExecutionId().toString(), execution.getSystemContext().getBranchId(), execution.getSystemContext().getSplitId(), execution.getSystemContext().getStepErrorKey(), new BranchContexts(isBranchCancelled, execution.getContexts(), execution.getSystemContext())); } };
@Override public FinishedBranch convert(Execution execution) { boolean isBranchCancelled = ExecutionStatus.CANCELED.equals(execution.getSystemContext().getFlowTerminationType()); return new FinishedBranch(execution.getExecutionId().toString(), execution.getSystemContext().getBranchId(), execution.getSystemContext().getSplitId(), execution.getSystemContext().getStepErrorKey(), new BranchContexts(isBranchCancelled, execution.getContexts(), execution.getSystemContext())); } };