Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext;
import org.apache.dolphinscheduler.plugin.task.api.model.Property;
import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters;
import org.apache.dolphinscheduler.plugin.task.api.parser.PlaceholderUtils;
import org.apache.dolphinscheduler.plugin.task.api.utils.GlobalParameterUtils;
import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils;

import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -339,24 +337,22 @@ public void cancelApplication() throws TaskException {

private Map<String, String> generateVariables() {
Map<String, String> variables = new ConcurrentHashMap<>();
List<Property> propertyList =
GlobalParameterUtils.deserializeGlobalParameter(taskExecutionContext.getGlobalParams());
if (propertyList != null && !propertyList.isEmpty()) {
for (Property property : propertyList) {
variables.put(property.getProp(), property.getValue());
Map<String, Property> prepareParamsMap = taskExecutionContext.getPrepareParamsMap();
prepareParamsMap.forEach((key, property) -> {
if (property != null && property.getValue() != null) {
variables.put(key, property.getValue().trim());
}
}
});
List<Property> localParams = this.dinkyParameters.getLocalParams();
Map<String, Property> prepareParamsMap = taskExecutionContext.getPrepareParamsMap();
if (localParams == null || localParams.isEmpty()) {
return variables;
}
Map<String, String> convertMap = ParameterUtils.convert(prepareParamsMap);
for (Property property : localParams) {
String propertyValue = property.getValue();
String value = PlaceholderUtils.replacePlaceholders(propertyValue, convertMap, true);
variables.put(property.getProp(), value);
if (localParams != null) {
for (Property property : localParams) {
String value = ParameterUtils.convertParameterPlaceholders(property.getValue(), variables);
if (value != null && !value.isEmpty()) {
variables.put(property.getProp(), value.trim());
}
}
}
log.info("sending variables to dinky: {}", variables);
Comment on lines +340 to +355
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe directly use taskExecutionContext.getPrepareParamsMap() is enough?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe directly use taskExecutionContext.getPrepareParamsMap() is enough?

No,it is not enough. The time function is not converted.

Copy link
Member

@ruanwenjun ruanwenjun Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? please test it on dev branch, this should be handled at master server.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes,I am sure

return variables;
}

Expand Down Expand Up @@ -471,4 +467,4 @@ private String sendJsonStr(String url, String params) {
return result;
}

}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert unnessnary chanage.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert unnessnary chanage.

ok

Loading