Commit 6d1c1f20953b30ca81ea1ea199d292b645c5c243
1 parent
315a024c
fix:【bpm】流程抄送时,可能缺少租户上下文的问题,对应 https://gitee.com/zhijiantianya/yudao-cloud/issues/IDEUQ6
Showing
1 changed file
with
4 additions
and
2 deletions
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/listener/BpmCopyTaskDelegate.java
| @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.bpm.framework.flowable.core.listener; | @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.bpm.framework.flowable.core.listener; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCandidateInvoker; | 4 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCandidateInvoker; |
| 5 | +import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils; | ||
| 5 | import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceCopyService; | 6 | import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceCopyService; |
| 6 | import jakarta.annotation.Resource; | 7 | import jakarta.annotation.Resource; |
| 7 | import org.flowable.bpmn.model.FlowElement; | 8 | import org.flowable.bpmn.model.FlowElement; |
| @@ -40,8 +41,9 @@ public class BpmCopyTaskDelegate implements JavaDelegate { | @@ -40,8 +41,9 @@ public class BpmCopyTaskDelegate implements JavaDelegate { | ||
| 40 | } | 41 | } |
| 41 | // 2. 执行抄送 | 42 | // 2. 执行抄送 |
| 42 | FlowElement currentFlowElement = execution.getCurrentFlowElement(); | 43 | FlowElement currentFlowElement = execution.getCurrentFlowElement(); |
| 43 | - processInstanceCopyService.createProcessInstanceCopy(userIds, null, execution.getProcessInstanceId(), | ||
| 44 | - currentFlowElement.getId(), currentFlowElement.getName(), null); | 44 | + FlowableUtils.execute(execution.getTenantId(), () -> |
| 45 | + processInstanceCopyService.createProcessInstanceCopy(userIds, null, execution.getProcessInstanceId(), | ||
| 46 | + currentFlowElement.getId(), currentFlowElement.getName(), null)); | ||
| 45 | } | 47 | } |
| 46 | 48 | ||
| 47 | } | 49 | } |