[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 <shitaohou@163.com>
This commit is contained in:
houshitao 2022-10-26 16:11:24 +08:00 committed by zhuangchong
parent 344293102d
commit ab675dcf4b
1 changed files with 4 additions and 0 deletions

View File

@ -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);