fix: the problem of incorrect sub-workflow state

This commit is contained in:
Echo009 2022-02-10 15:14:31 +08:00
parent 9c30e5ee83
commit d4eb8e3303

View File

@ -238,12 +238,10 @@ public class WorkflowInstanceManager {
} }
if (readyNodes.isEmpty()) { if (readyNodes.isEmpty()) {
// 没有就绪的节点所有节点都被禁用 // 没有就绪的节点所有节点都被禁用
wfInstanceInfo.setStatus(WorkflowInstanceStatus.SUCCEED.getV());
wfInstanceInfo.setResult(SystemInstanceResult.NO_ENABLED_NODES);
wfInstanceInfo.setFinishedTime(System.currentTimeMillis()); wfInstanceInfo.setFinishedTime(System.currentTimeMillis());
wfInstanceInfo.setDag(JSON.toJSONString(dag)); wfInstanceInfo.setDag(JSON.toJSONString(dag));
log.warn("[Workflow-{}|{}] workflowInstance({}) needn't running ", wfInfo.getId(), wfInstanceId, wfInstanceInfo); log.warn("[Workflow-{}|{}] workflowInstance({}) needn't running ", wfInfo.getId(), wfInstanceId, wfInstanceInfo);
workflowInstanceInfoRepository.saveAndFlush(wfInstanceInfo); handleWfInstanceFinalStatus(wfInstanceInfo, SystemInstanceResult.NO_ENABLED_NODES, WorkflowInstanceStatus.SUCCEED);
return; return;
} }
// 需要更新工作流实例状态 // 需要更新工作流实例状态