修复工作流创建流程时,流程名可能不存在的问题

This commit is contained in:
YunaiV 2023-04-09 10:22:38 +08:00
parent f106afc0f9
commit 79228bd947

View File

@ -289,7 +289,12 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
} }
// 创建流程实例 // 创建流程实例
ProcessInstance instance = runtimeService.startProcessInstanceById(definition.getId(), businessKey, variables); ProcessInstance instance = runtimeService.createProcessInstanceBuilder()
.processDefinitionId(definition.getId())
.businessKey(businessKey)
.name(definition.getName().trim())
.variables(variables)
.start();
// 设置流程名字 // 设置流程名字
runtimeService.setProcessInstanceName(instance.getId(), definition.getName()); runtimeService.setProcessInstanceName(instance.getId(), definition.getName());