private static void addContextData(Map<String, Object> data, Execution execution) { data.putAll(execution.getContexts()); data.put(ExecutionParametersConsts.SYSTEM_CONTEXT, execution.getSystemContext()); data.put(ExecutionParametersConsts.EXECUTION_RUNTIME_SERVICES, execution.getSystemContext()); data.put(ExecutionParametersConsts.EXECUTION, execution); data.put(ExecutionParametersConsts.EXECUTION_CONTEXT, execution.getContexts()); data.put(ExecutionParametersConsts.RUNNING_EXECUTION_PLAN_ID, execution.getRunningExecutionPlanId()); }
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; }
protected ExecutionStep loadExecutionStep(Execution execution) { RunningExecutionPlan runningExecutionPlan; if (execution != null) { // Optimization for external workers - run the content only without loading the execution plan if (execution.getSystemContext().get(TempConstants.CONTENT_EXECUTION_STEP) != null) { return (ExecutionStep) execution.getSystemContext().get(TempConstants.CONTENT_EXECUTION_STEP); } Long position = execution.getPosition(); if (position != null) { runningExecutionPlan = workerDbSupportService .readExecutionPlanById(execution.getRunningExecutionPlanId()); if (runningExecutionPlan != null) { updateMetadata(execution, runningExecutionPlan); ExecutionStep currStep = runningExecutionPlan.getExecutionPlan().getStep(position); if (logger.isDebugEnabled()) { logger.debug("Begin step: " + position + " in flow " + runningExecutionPlan.getExecutionPlan() .getFlowUuid() + " [" + execution.getExecutionId() + "]"); } if (currStep != null) { return currStep; } } } } // If we got here - one of the objects was null throw new RuntimeException("Failed to load ExecutionStep!"); }