private static void handleStepExecutionException(Execution execution, RuntimeException ex) { logger.error("Error occurred during operation execution. Execution id: " + execution.getExecutionId(), ex); execution.getSystemContext().setStepErrorKey(ex.getMessage()); }
@Override public ExecutionMessage convert(Execution execution) { return new ExecutionMessage(execution.getExecutionId().toString(), converter.createPayload(execution)); } };
@Override public ExecutionMessage convert(Execution execution) { return new ExecutionMessage(execution.getExecutionId().toString(), converter.createPayload(execution)); } };
private ExecutionMessage createExecutionMessage(Execution execution) { Payload payload = executionMessageConverter.createPayload(execution); return new ExecutionMessage(ExecutionMessage.EMPTY_EXEC_STATE_ID, ExecutionMessage.EMPTY_WORKER, WorkerNode.DEFAULT_WORKER_GROUPS[0], String.valueOf(execution.getExecutionId()), ExecStatus.PENDING, //start new run also in PENDING payload, 0); } }
private Serializable createBranchFailureEventData(Execution execution) { Map<String, Serializable> eventData = new HashMap<>(); eventData.put(ExecutionParametersConsts.SYSTEM_CONTEXT, execution.getSystemContext()); eventData.put(EventConstants.EXECUTION_ID_CONTEXT, execution.getExecutionId()); eventData.put(EventConstants.BRANCH_ID, execution.getSystemContext().getBranchId()); return (Serializable) eventData; }
private Long findExecutionId(List<Execution> executions, String splitId) { for (Execution execution : executions) { if (execution.getSystemContext().getSplitId().equals(splitId)) { return execution.getExecutionId(); } } return null; }
private ExecutionMessage createExecutionMessage(Execution execution) { Payload payload = executionMessageConverter.createPayload(execution); return new ExecutionMessage(ExecutionMessage.EMPTY_EXEC_STATE_ID, ExecutionMessage.EMPTY_WORKER, WorkerNode.DEFAULT_WORKER_GROUPS[0], String.valueOf(execution.getExecutionId()), ExecStatus.PENDING, //start new flow also in PENDING payload, 0); } }
private ExecutionMessage createExecutionMessage(Execution execution) { Payload payload = executionMessageConverter.createPayload(execution); return new ExecutionMessage(ExecutionMessage.EMPTY_EXEC_STATE_ID, ExecutionMessage.EMPTY_WORKER, WorkerNode.DEFAULT_WORKER_GROUPS[0], String.valueOf(execution.getExecutionId()), ExecStatus.PENDING, //start new flow also in PENDING payload, 0); } }
private Long findExecutionId(List<Execution> executions, String splitId) { for (Execution execution : executions) { if (execution.getSystemContext().getSplitId().equals(splitId)) { return execution.getExecutionId(); } } return null; }
private ExecutionMessage createExecutionMessage(Execution execution) { Payload payload = executionMessageConverter.createPayload(execution); return new ExecutionMessage(ExecutionMessage.EMPTY_EXEC_STATE_ID, ExecutionMessage.EMPTY_WORKER, WorkerNode.DEFAULT_WORKER_GROUPS[0], String.valueOf(execution.getExecutionId()), ExecStatus.PENDING, //start new run also in PENDING payload, 0); } }
@Override public String getId() { return parent.getExecutionId().toString() + parent.getSystemContext().getBranchId(); }
@Override public String getId() { return parent.getExecutionId().toString() + parent.getSystemContext().getBranchId(); }
private Serializable createFailureEventData(Execution execution) { Map<String, Serializable> eventData = new HashMap<>(); eventData.put(ExecutionParametersConsts.SYSTEM_CONTEXT, execution.getSystemContext()); eventData.put(EventConstants.EXECUTION_ID_CONTEXT, execution.getExecutionId()); eventData.put(EventConstants.BRANCH_ID, execution.getSystemContext().getBranchId()); eventData.put(ExecutionParametersConsts.RUNNING_EXECUTION_PLAN_ID, execution.getRunningExecutionPlanId()); return (Serializable) eventData; }
private Serializable createNoWorkerFailureEventData(Execution execution, Long pauseId) { String flowUuid = extractFlowUuid(execution.getRunningExecutionPlanId()); Map<String, Serializable> eventData = new HashMap<>(); eventData.put(ExecutionParametersConsts.SYSTEM_CONTEXT, execution.getSystemContext()); eventData.put(EventConstants.EXECUTION_ID_CONTEXT, execution.getExecutionId()); eventData.put(EventConstants.BRANCH_ID, execution.getSystemContext().getBranchId()); eventData.put(EventConstants.FLOW_UUID, flowUuid); eventData.put(EventConstants.PAUSE_ID, pauseId); return (Serializable) eventData; }
private Serializable createFinishedEventData(Execution execution) { Map<String, Serializable> eventData = new HashMap<>(); ExecutionRuntimeServices runtimeServices = execution.getSystemContext(); //if nothing went wrong flow is completed if (runtimeServices.getFlowTerminationType() == null) { runtimeServices.setFlowTerminationType(ExecutionStatus.COMPLETED); } eventData.put(ExecutionParametersConsts.SYSTEM_CONTEXT, runtimeServices); eventData.put(EventConstants.EXECUTION_ID_CONTEXT, execution.getExecutionId()); eventData.put(EventConstants.EXECUTION_CONTEXT, (Serializable) execution.getContexts()); eventData.put(EventConstants.IS_BRANCH, !StringUtils.isEmpty(runtimeServices.getBranchId())); return (Serializable) eventData; }
protected boolean handlePausedFlow(Execution execution) throws InterruptedException { String branchId = execution.getSystemContext().getBranchId(); PauseReason reason = findPauseReason(execution.getExecutionId(), branchId); if (reason != null) { // need to pause the execution pauseFlow(reason, execution); return true; } return false; }
private boolean isCancelledExecution(Execution execution) { if(execution==null) return false; boolean executionIsCancelled = workerConfigurationService.isExecutionCancelled(execution.getExecutionId()); // in this case - just check if need to cancel. It will set as cancelled later on QueueEventListener // Another scenario of getting canceled - it was cancelled from the SplitJoinService (the configuration can still be not updated). Defect #:22060 if(ExecutionStatus.CANCELED.equals(execution.getSystemContext().getFlowTerminationType())) { executionIsCancelled = true; } return executionIsCancelled; }
private boolean handlePausedFlowAfterStep(Execution execution) throws InterruptedException { String branchId = execution.getSystemContext().getBranchId(); PauseReason reason = null; ExecutionSummary execSummary = pauseService.readPausedExecution(execution.getExecutionId(), branchId); if (execSummary != null && execSummary.getStatus().equals(ExecutionStatus.PENDING_PAUSE)) { reason = execSummary.getPauseReason(); } if (reason != null) { // need to pause the execution pauseFlow(reason, execution); return true; } return false; }
@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())); } };