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


##########
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:
   I have found useful for my use case. We are integrating the flows with the 
Splunk logs. While logging for the splunk events we are mapping this variable 
so that we can filter the logs in splunk at the workflow instance level.
   
   Hence, we are using this. Reason we are pushing to splunk is we are not 
giving the dolphin UI to Users, instead we are giving a utility to run/schedule 
the jobs in the scheduler.



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