From 547aa437ab424250dac6b4df3de7a4b1b8af7d98 Mon Sep 17 00:00:00 2001 From: houshitao <33045461+hstdream@users.noreply.github.com> Date: Wed, 26 Oct 2022 16:11:24 +0800 Subject: [PATCH] [Bug] [API] The workflow definition and the tenant in the workflow instance are inconsistent. (#12533) * [Bug] [API] The workflow definition and the tenant in the workflow instance are inconsistent * fix NPE. Co-authored-by: houshitao --- .../api/service/impl/ProcessInstanceServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java index 3d350151aa..05415f899a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java @@ -250,6 +250,10 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce logger.error("Process definition does not exist, projectCode:{}.", projectCode); putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, processId); } else { + Tenant tenant = tenantMapper.queryById(processDefinition.getTenantId()); + if (tenant != null) { + processDefinition.setTenantCode(tenant.getTenantCode()); + } processInstance.setLocations(processDefinition.getLocations()); processInstance.setDagData(processService.genDagData(processDefinition)); result.put(DATA_LIST, processInstance);