lenboo commented on code in PR #10704:
URL: https://github.com/apache/dolphinscheduler/pull/10704#discussion_r910945103


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parser/ParamUtils.java:
##########
@@ -43,77 +33,81 @@ public class ParamUtils {
     /**
      * parameter conversion
      * Warning:
-     *  When you first invoke the function of convert, the variables of 
localParams and varPool in the ShellParameters will be modified.
+     *  1.When you first invoke the function of convert, the variables of 
localParams and varPool in the ShellParameters will be modified.
      *  But in the whole system the variables of localParams and varPool have 
been used in other functions. I'm not sure if this current
      *  situation is wrong. So I cannot modify the original logic.
      *
+     *  2.Change time: 2022-06-30
+     *  The purpose is for external expansion of local parameters.
+     *  now the method is replaced by the paramParsingPreparation() method of 
DolphinSchedulerCuringGlobalParams.
+     *
      * @param taskExecutionContext the context of this task instance
      * @param parameters the parameters
      * @return global params
      *
      */
-    public static Map<String, Property> convert(TaskExecutionContext 
taskExecutionContext, AbstractParameters parameters) {
-        Preconditions.checkNotNull(taskExecutionContext);
-        Preconditions.checkNotNull(parameters);
-        Map<String, Property> globalParams = 
getUserDefParamsMap(taskExecutionContext.getDefinedParams());
-        Map<String,String> globalParamsMap = 
taskExecutionContext.getDefinedParams();
-        CommandType commandType = 
CommandType.of(taskExecutionContext.getCmdTypeIfComplement());
-        Date scheduleTime = taskExecutionContext.getScheduleTime();
-
-        // combining local and global parameters
-        Map<String, Property> localParams = 
parameters.getInputLocalParametersMap();
-
-        //stream pass params
-        Map<String, Property> varParams = parameters.getVarPoolMap();
-
-        if (globalParams.size() == 0 && localParams.size() == 0 && 
varParams.size() == 0) {
-            return null;
-        }
-        // if it is a complement,
-        // you need to pass in the task instance id to locate the time
-        // of the process instance complement
-        Map<String,String> params = BusinessTimeUtils
-                .getBusinessTime(commandType,
-                        scheduleTime);
-
-        if (globalParamsMap != null) {
-
-            params.putAll(globalParamsMap);
-        }
-
-        if (StringUtils.isNotBlank(taskExecutionContext.getExecutePath())) {
-            params.put(PARAMETER_TASK_EXECUTE_PATH, 
taskExecutionContext.getExecutePath());
-        }
-        params.put(PARAMETER_TASK_INSTANCE_ID, 
Integer.toString(taskExecutionContext.getTaskInstanceId()));
-
-        if (varParams.size() != 0) {
-            globalParams.putAll(varParams);
-        }
-        if (localParams.size() != 0) {
-            globalParams.putAll(localParams);
-        }
-
-        Iterator<Map.Entry<String, Property>> iter = 
globalParams.entrySet().iterator();
-        while (iter.hasNext()) {
-            Map.Entry<String, Property> en = iter.next();
-            Property property = en.getValue();
-
-            if (StringUtils.isNotEmpty(property.getValue())
-                    && property.getValue().startsWith("$")) {
-                /**
-                 *  local parameter refers to global parameter with the same 
name
-                 *  note: the global parameters of the process instance here 
are solidified parameters,
-                 *  and there are no variables in them.
-                 */
-                String val = property.getValue();
-
-                val  = ParameterUtils.convertParameterPlaceholders(val, 
params);
-                property.setValue(val);
-            }
-        }
-
-        return globalParams;
-    }
+//    public static Map<String, Property> convert(TaskExecutionContext 
taskExecutionContext, AbstractParameters parameters) {

Review Comment:
   You can delete unused code.



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