You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "ruanwenjun (via GitHub)" <gi...@apache.org> on 2023/12/07 14:04:16 UTC

Re: [PR] [improvement-#15268][subprocess] subprocess task cannot pass parameters which come from sub process instance [dolphinscheduler]

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


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/subworkflow/SubWorkflowLogicTask.java:
##########
@@ -133,6 +147,43 @@ public void kill() {
         }
     }
 
+    @Override
+    public List<Property> getVarPool() {
+        List<Property> taskInstanceProps = getTaskParameters().getVarPool();
+        ProcessInstanceMap processInstanceMap = processInstanceMapDao.queryWorkProcessMapByParent(
+                taskExecutionContext.getProcessInstanceId(), taskExecutionContext.getTaskInstanceId());
+        ProcessInstance childProcessInstance = processInstanceDao.queryById(processInstanceMap.getProcessInstanceId());
+        if (!StringUtils.isBlank(childProcessInstance.getVarPool())) {

Review Comment:
   ```suggestion
           if (StringUtils.isBlank(childProcessInstance.getVarPool())) {
               return taskInstanceProps
           }
   ```
   
   Please directly return if there is not varpool in sub workflow?



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org