Browse Source

[2.0.3][Bug-7986] Disable deletion of running workflow (#8065)

Co-authored-by: caishunfeng <534328519@qq.com>
3.0.0/version-upgrade
wind 3 years ago committed by GitHub
parent
commit
c0d69125eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java

9
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java

@ -606,6 +606,12 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce
putMsg(result, Status.PROCESS_INSTANCE_NOT_EXIST, String.valueOf(processInstanceId)); putMsg(result, Status.PROCESS_INSTANCE_NOT_EXIST, String.valueOf(processInstanceId));
return result; return result;
} }
//check process instance status
if (!processInstance.getState().typeIsFinished()) {
putMsg(result, Status.PROCESS_INSTANCE_STATE_OPERATION_ERROR,
processInstance.getName(), processInstance.getState().toString(), "delete");
return result;
}
ProcessDefinition processDefinition = processDefineMapper.queryByCode(processInstance.getProcessDefinitionCode()); ProcessDefinition processDefinition = processDefineMapper.queryByCode(processInstance.getProcessDefinitionCode());
if (processDefinition != null && projectCode != processDefinition.getProjectCode()) { if (processDefinition != null && projectCode != processDefinition.getProjectCode()) {
@ -615,7 +621,8 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce
try { try {
processService.removeTaskLogFile(processInstanceId); processService.removeTaskLogFile(processInstanceId);
} catch (Exception e) { } catch (Exception ignore) {
// ignore
} }
// delete database cascade // delete database cascade

Loading…
Cancel
Save