rickchengx commented on code in PR #15691:
URL: 
https://github.com/apache/dolphinscheduler/pull/15691#discussion_r1520900305


##########
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:
   If it is a built-in variable, I think it should be the same for all task 
types (not only shell). 
   And I'm not sure about the benefits of these built-in variables, could you 
please give some examples?
   Furthermore, relevant docs and UT should be added.



-- 
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]

Reply via email to