caishunfeng commented on code in PR #14775:
URL:
https://github.com/apache/dolphinscheduler/pull/14775#discussion_r1308304278
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java:
##########
@@ -504,6 +505,18 @@ public void deleteTaskDefinitionByCode(User loginUser,
long taskCode) {
List<ProcessTaskRelation> relationList =
processTaskRelations.stream()
.filter(r -> r.getPostTaskCode() !=
taskCode).collect(Collectors.toList());
updateDag(loginUser, processDefinitionCode, relationList,
Lists.newArrayList());
+ /**
+ * if relationList is empty,The process_task_relation
corresponding to this task will not be deleted,
+ * which will cause the task to be deleted in the task definition
panel, but the workflow cannot be deleted.
+ */
+ //delete process_task_relation
+ if (relationList.size()==0){
+ LambdaQueryWrapper<ProcessTaskRelation> wrapper = new
LambdaQueryWrapper<>();
Review Comment:
It's better to use sql instead of wrapper.
--
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]