Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@ public Map<String, Object> deleteProcessInstanceById(User loginUser, long projec

processService.deleteAllSubWorkProcessByParentId(processInstanceId);
processService.deleteWorkProcessMapByParentId(processInstanceId);
processService.deleteWorkTaskInstanceByProcessInstanceId(processInstanceId);

if (delete > 0) {
putMsg(result, Status.SUCCESS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,25 @@ public void removeTaskLogFile(Integer processInstanceId) {
}
}

/**
* 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.
*
Expand Down