ruanwenjun commented on code in PR #15947:
URL: 
https://github.com/apache/dolphinscheduler/pull/15947#discussion_r1594970882


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-dinky/src/main/java/org/apache/dolphinscheduler/plugin/task/dinky/DinkyTask.java:
##########
@@ -343,15 +344,30 @@ private Map<String, String> generateVariables() {
             }
         }
         List<Property> localParams = this.dinkyParameters.getLocalParams();
+        Map<String, Property> prepareParamsMap = 
taskExecutionContext.getPrepareParamsMap();
         if (localParams == null || localParams.isEmpty()) {
             return variables;
         }
+        Map<String, String> convertMap = convert(prepareParamsMap);
         for (Property property : localParams) {
-            variables.put(property.getProp(), property.getValue());
+            String propertyValue = property.getValue();
+            String value = PlaceholderUtils.replacePlaceholders(propertyValue, 
convertMap, true);
+            variables.put(property.getProp(), value);
         }
         return variables;
     }
 
+    public static Map<String, String> convert(Map<String, Property> paramsMap) 
{
+        if (paramsMap == null) {
+            return null;
+        }
+        Map<String, String> map = new HashMap<>();
+        for (Map.Entry<String, Property> en : paramsMap.entrySet()) {
+            map.put(en.getKey(), en.getValue().getValue());
+        }
+        return map;
+    }
+

Review Comment:
   ```suggestion
   
   ```



##########
dolphinscheduler-task-plugin/dolphinscheduler-task-dinky/src/main/java/org/apache/dolphinscheduler/plugin/task/dinky/DinkyTask.java:
##########
@@ -343,15 +344,30 @@ private Map<String, String> generateVariables() {
             }
         }
         List<Property> localParams = this.dinkyParameters.getLocalParams();
+        Map<String, Property> prepareParamsMap = 
taskExecutionContext.getPrepareParamsMap();
         if (localParams == null || localParams.isEmpty()) {
             return variables;
         }
+        Map<String, String> convertMap = convert(prepareParamsMap);

Review Comment:
   ```suggestion
           Map<String, String> convertMap = 
ParameterUtils.convert(prepareParamsMap);
   ```



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