private static boolean useDefaultGroup(Execution execution) { Boolean useDefaultGroup = (Boolean) execution.getSystemContext().get(TempConstants.USE_DEFAULT_GROUP); if (useDefaultGroup == null) { return false; } return useDefaultGroup; }
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!"); }
protected static void postExecutionSettings(Execution execution) { // Decide on Group String group = (String) execution.getSystemContext().get(TempConstants.ACTUALLY_OPERATION_GROUP); execution.setGroupName(group); if (isDebuggerMode(execution.getSystemContext())) { if (!StringUtils.isEmpty(group) && useDefaultGroup(execution)) { execution.setGroupName(null); } } //if there is a request to change the running execution plan id, we update the execution to the new execution plan ID Long requestForChangingExecutionPlan = execution.getSystemContext().pullRequestForChangingExecutionPlan(); if (requestForChangingExecutionPlan != null) { execution.setRunningExecutionPlanId(requestForChangingExecutionPlan); } }