diff --git a/scheduler/scheduler-api/src/main/java/org/ow2/proactive/scheduler/common/job/factories/StaxJobFactory.java b/scheduler/scheduler-api/src/main/java/org/ow2/proactive/scheduler/common/job/factories/StaxJobFactory.java index 0c7904e122..e439f31be1 100644 --- a/scheduler/scheduler-api/src/main/java/org/ow2/proactive/scheduler/common/job/factories/StaxJobFactory.java +++ b/scheduler/scheduler-api/src/main/java/org/ow2/proactive/scheduler/common/job/factories/StaxJobFactory.java @@ -357,7 +357,7 @@ public JobType getType() { // the final value of the variable can either be overwritten by a value of the replacement map or // use in a pattern such value commonPropertiesHolder.getVariables() - .putAll(createJobVariables(cursorJob, replacementVariables)); + .putAll(createJobVariables(cursorJob)); } else if (XMLTags.COMMON_GENERIC_INFORMATION.matches(current)) { commonPropertiesHolder.setGenericInformation(getGenericInformation(cursorJob, @@ -389,6 +389,9 @@ public JobType getType() { } } + //replace variables + commonPropertiesHolder.getVariables().putAll(replaceVariablesInJobVariablesMap(commonPropertiesHolder.getVariables(),replacementVariables)); + handleJobAttributes(commonPropertiesHolder, delayedJobAttributes); //if this point is reached, fill the real job using the temporary one @@ -468,12 +471,11 @@ private void handleCancelJobOnErrorAttribute(CommonAttribute commonPropertiesHol * Leave the method with the cursor at the end of 'ELEMENT_VARIABLES' tag * * @param cursorVariables the streamReader with the cursor on the 'ELEMENT_VARIABLES' tag. - * @param replacementVariables variables which have precedence over the one defined in the job + //* @param replacementVariables variables which have precedence over the one defined in the job * @return the map in which the variables were added. * @throws JobCreationException */ - private Map createJobVariables(XMLStreamReader cursorVariables, - Map replacementVariables) throws JobCreationException { + private Map createJobVariables(XMLStreamReader cursorVariables) throws JobCreationException { HashMap variablesMap = new LinkedHashMap<>(); try { int eventType; @@ -492,7 +494,7 @@ private Map createJobVariables(XMLStreamReader cursorVariab break; case XMLEvent.END_ELEMENT: if (XMLTags.VARIABLES.matches(cursorVariables.getLocalName())) { - return replaceVariablesInJobVariablesMap(variablesMap, replacementVariables); + return variablesMap; } break; }