This is an automated email from the ASF dual-hosted git repository.
kerwin pushed a commit to branch 3.1.1-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/3.1.1-prepare by this push:
new ab675dcf4b [Bug] [API] The workflow definition and the tenant in the
workflow instance are inconsistent. (#12533)
ab675dcf4b is described below
commit ab675dcf4be751c94a31c7025e96c87678e08749
Author: houshitao <[email protected]>
AuthorDate: Wed Oct 26 16:11:24 2022 +0800
[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 <[email protected]>
---
.../dolphinscheduler/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 22b91317bd..2dcba5473b 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
@@ -237,6 +237,10 @@ public class ProcessInstanceServiceImpl extends
BaseServiceImpl implements Proce
if (processDefinition == null || projectCode !=
processDefinition.getProjectCode()) {
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);