fix: issue with nested workflow node state updates,#465

This commit is contained in:
Echo009 2022-10-31 14:01:12 +08:00
parent 39eb79de54
commit 5ba4ce5457

View File

@ -19,6 +19,7 @@ import tech.powerjob.common.model.PEWorkflowDAG;
import tech.powerjob.common.serialize.JsonUtils; import tech.powerjob.common.serialize.JsonUtils;
import tech.powerjob.common.utils.CommonUtils; import tech.powerjob.common.utils.CommonUtils;
import tech.powerjob.server.common.constants.SwitchableStatus; import tech.powerjob.server.common.constants.SwitchableStatus;
import tech.powerjob.server.common.utils.SpringUtils;
import tech.powerjob.server.core.helper.StatusMappingHelper; import tech.powerjob.server.core.helper.StatusMappingHelper;
import tech.powerjob.server.core.lock.UseCacheLock; import tech.powerjob.server.core.lock.UseCacheLock;
import tech.powerjob.server.core.service.UserService; import tech.powerjob.server.core.service.UserService;
@ -440,10 +441,10 @@ public class WorkflowInstanceManager {
if (workflowInstanceStatus == WorkflowInstanceStatus.SUCCEED){ if (workflowInstanceStatus == WorkflowInstanceStatus.SUCCEED){
HashMap<String, String> wfContext = JSON.parseObject(wfInstance.getWfContext(), new TypeReference<HashMap<String, String>>() { HashMap<String, String> wfContext = JSON.parseObject(wfInstance.getWfContext(), new TypeReference<HashMap<String, String>>() {
}); });
updateWorkflowContext(wfInstance.getParentWfInstanceId(),wfContext); SpringUtils.getBean(this.getClass()).updateWorkflowContext(wfInstance.getParentWfInstanceId(), wfContext);
} }
// 处理父工作流 // 处理父工作流, fix https://github.com/PowerJob/PowerJob/issues/465
move(wfInstance.getParentWfInstanceId(), wfInstance.getWfInstanceId(), StatusMappingHelper.toInstanceStatus(workflowInstanceStatus), result); SpringUtils.getBean(this.getClass()).move(wfInstance.getParentWfInstanceId(), wfInstance.getWfInstanceId(), StatusMappingHelper.toInstanceStatus(workflowInstanceStatus), result);
} }
// 报警 // 报警