Source:
<code>public VariablesMap getStringSerializableMap(SchedulingService service, TaskTerminationData taskToTerminate) throws Exception { VariablesMap variablesMap = new VariablesMap(); RunningTaskData taskData = taskToTerminate.taskData; TaskResultImpl taskResult = taskToTerminate.taskResult; InternalJob internalJob = taskToTerminate.internalJob; variablesMap.setScopeMap(taskData.getTask().getScopeVariables()); if (taskToTerminate.terminationStatus == ABORTED || taskResult == null) { List<InternalTask> iDependences = taskData.getTask().getIDependences(); if (iDependences != null) { Set<TaskId> parentIds = new HashSet<>(iDependences.size()); for (InternalTask parentTask : iDependences) { parentIds.addAll(InternalTaskParentFinder.getInstance() .getFirstNotSkippedParentTaskIds(parentTask)); } Map<TaskId, TaskResult> taskResults = service.getInfrastructure() .getDBManager() .loadTasksResults(taskData.getTask().getJobId(), new ArrayList(parentIds)); getResultsFromListOfTaskResults(variablesMap.getInheritedMap(), taskResults); } else { if (internalJob != null) { for (Map.Entry<String, JobVariable> jobVariableEntry : internalJob.getVariables().entrySet()) { variablesMap.getInheritedMap().put(jobVariableEntry.getKey(), jobVariableEntry.getValue().getValue()); } } } variablesMap.getInheritedMap().put(SchedulerVars.PA_TASK_SUCCESS.toString(), Boolean.toString(false)); } else if (taskResult.hadException()) { variablesMap.setInheritedMap(fillMapWithTaskResult(taskResult, false)); } else { variablesMap.setInheritedMap(fillMapWithTaskResult(taskResult, true)); } <START> variablesMap.setScopeMap(removeInheritedVarsFromScope(variablesMap, taskData.getTask().getVariables())); <END> return variablesMap; }</code><technical_language>line, appearing earlier in code: variablesMap.setScopeMap(taskData.getTask().getScopeVariables()); is overwritten code, removed</technical_language>

Target:
public VariablesMap getStringSerializableMap(SchedulingService service, TaskTerminationData taskToTerminate) throws Exception { VariablesMap variablesMap = new VariablesMap(); RunningTaskData taskData = taskToTerminate.taskData; TaskResultImpl taskResult = taskToTerminate.taskResult; InternalJob internalJob = taskToTerminate.internalJob; if (taskToTerminate.terminationStatus == ABORTED || taskResult == null) { List<InternalTask> iDependences = taskData.getTask().getIDependences(); if (iDependences != null) { Set<TaskId> parentIds = new HashSet<>(iDependences.size()); for (InternalTask parentTask : iDependences) { parentIds.addAll(InternalTaskParentFinder.getInstance() .getFirstNotSkippedParentTaskIds(parentTask)); } Map<TaskId, TaskResult> taskResults = service.getInfrastructure() .getDBManager() .loadTasksResults(taskData.getTask().getJobId(), new ArrayList(parentIds)); getResultsFromListOfTaskResults(variablesMap.getInheritedMap(), taskResults); } else { if (internalJob != null) { for (Map.Entry<String, JobVariable> jobVariableEntry : internalJob.getVariables().entrySet()) { variablesMap.getInheritedMap().put(jobVariableEntry.getKey(), jobVariableEntry.getValue().getValue()); } } } variablesMap.getInheritedMap().put(SchedulerVars.PA_TASK_SUCCESS.toString(), Boolean.toString(false)); } else if (taskResult.hadException()) { variablesMap.setInheritedMap(fillMapWithTaskResult(taskResult, false)); } else { variablesMap.setInheritedMap(fillMapWithTaskResult(taskResult, true)); } variablesMap.setScopeMap(getNonInheritedScopeVariables(variablesMap.getInheritedMap(), taskData.getTask().getScopeVariables(), taskData.getTask().getVariables())); return variablesMap; }