mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-05 05:38:30 +08:00
[Fix-7767]Task instance is not deleted while deleting the process instance (#7768)
* fix bug_7767 * fix bug_7767 * fix bug_7767 * fix bug_7767 * fix bug_7767
This commit is contained in:
parent
4d16c24b6e
commit
7395b980d3
@ -632,6 +632,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce
|
|||||||
|
|
||||||
processService.deleteAllSubWorkProcessByParentId(processInstanceId);
|
processService.deleteAllSubWorkProcessByParentId(processInstanceId);
|
||||||
processService.deleteWorkProcessMapByParentId(processInstanceId);
|
processService.deleteWorkProcessMapByParentId(processInstanceId);
|
||||||
|
processService.deleteWorkTaskInstanceByProcessInstanceId(processInstanceId);
|
||||||
|
|
||||||
if (delete > 0) {
|
if (delete > 0) {
|
||||||
putMsg(result, Status.SUCCESS);
|
putMsg(result, Status.SUCCESS);
|
||||||
|
@ -529,6 +529,25 @@ public class ProcessService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* recursive delete all task instance by process instance id
|
||||||
|
* @param processInstanceId
|
||||||
|
*/
|
||||||
|
public void deleteWorkTaskInstanceByProcessInstanceId(int processInstanceId) {
|
||||||
|
List<TaskInstance> taskInstanceList = findValidTaskListByProcessId(processInstanceId);
|
||||||
|
if (CollectionUtils.isEmpty(taskInstanceList)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Integer> taskInstanceIdList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (TaskInstance taskInstance : taskInstanceList) {
|
||||||
|
taskInstanceIdList.add(taskInstance.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
taskInstanceMapper.deleteBatchIds(taskInstanceIdList);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* recursive query sub process definition id by parent id.
|
* recursive query sub process definition id by parent id.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user