rickchengx commented on code in PR #15691:
URL:
https://github.com/apache/dolphinscheduler/pull/15691#discussion_r1525951529
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-shell/src/main/java/org/apache/dolphinscheduler/plugin/task/shell/ShellTask.java:
##########
@@ -161,6 +162,19 @@ public AbstractParameters getParameters() {
private String parseScript(String script) {
// combining local and global parameters
Map<String, Property> paramsMap =
taskExecutionContext.getPrepareParamsMap();
- return ParameterUtils.convertParameterPlaceholders(script,
ParamUtils.convert(paramsMap));
+ Map<String, String> paramUtilsMap = ParamUtils.convert(paramsMap);
+ return ParameterUtils.convertParameterPlaceholders(script,
returnShellTaskPlaceHolders(paramUtilsMap));
+ }
+
+ private Map<String, String> returnShellTaskPlaceHolders(Map<String,
String> paramUtilsMap) {
+ Map<String, String> map = new HashMap<>();
+ if(paramUtilsMap != null) {
+ map.putAll(paramUtilsMap);
+ }
+ map.put("WORKFLOW_NAME",
taskExecutionContext.getProcessDefinitionName());
Review Comment:
@baratamavinash225 The built-in parameters should be valid for all tasks, so
I suggest you start a discussion on the mailing list.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]