JackIllkid commented on code in PR #16911:
URL: 
https://github.com/apache/dolphinscheduler/pull/16911#discussion_r1896298847


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowDefinitionServiceImpl.java:
##########
@@ -2122,6 +2124,19 @@ protected void doBatchOperateWorkflowDefinition(User 
loginUser,
                         long taskCode = CodeGenerateUtils.genCode();
                         taskCodeMap.put(taskDefinitionLog.getCode(), taskCode);
                         taskDefinitionLog.setCode(taskCode);
+                        if 
(TaskTypeUtils.isSwitchTask(taskDefinitionLog.getTaskType())){
+                            final String taskParams = 
taskDefinitionLog.getTaskParams();
+                            final SwitchParameters switchParameters = 
JSONUtils.parseObject(taskParams, SwitchParameters.class);
+                            if (switchParameters == null) {
+                                throw new IllegalArgumentException("Switch 
task params: " + taskParams + " is invalid.");
+                            }
+                            List<SwitchResultVo> dependTaskList = 
switchParameters.getSwitchResult().getDependTaskList();
+                            dependTaskList.forEach(switchResultVo -> {
+                                
switchResultVo.setNextNode(taskCodeMap.get(switchResultVo.getNextNode()));

Review Comment:
   > 我们还需要更改默认分支`SwitchResult`。
   
   done



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