njnu-seafish commented on code in PR #18293:
URL: 
https://github.com/apache/dolphinscheduler/pull/18293#discussion_r3307843750


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowDefinitionServiceImpl.java:
##########
@@ -381,6 +389,23 @@ private List<TaskDefinitionLog> 
generateTaskDefinitionList(String taskDefinition
         }
     }
 
+    /**
+     * Validate worker groups in task definitions
+     */
+    private void validateTaskWorkerGroups(long projectCode, 
List<TaskDefinitionLog> taskDefinitionLogs) {
+        if (CollectionUtils.isEmpty(taskDefinitionLogs)) {
+            return;
+        }
+
+        List<String> workerGroups = taskDefinitionLogs.stream()
+                .map(TaskDefinitionLog::getWorkerGroup)
+                .filter(StringUtils::isNotEmpty)
+                .distinct()
+                .collect(Collectors.toList());
+
+        
projectWorkerGroupRelationService.validateWorkerGroupsAssignedToProject(projectCode,
 workerGroups);
+    }

Review Comment:
   > This kind of code should put into `WorkerGroupValidator`
   
   Okay, I will unify the logic.



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