Commit 6a7e7e3e442fa7ead4324659a79adc3c4d9e886e
1 parent
686a64cc
【缺陷修复】 延迟器 trigger 时,租户 id 丢失的问题
Showing
1 changed file
with
5 additions
and
3 deletions
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java
| ... | ... | @@ -1192,9 +1192,11 @@ public class BpmTaskServiceImpl implements BpmTaskService { |
| 1192 | 1192 | } |
| 1193 | 1193 | } |
| 1194 | 1194 | } |
| 1195 | - | |
| 1196 | - AdminUserRespDTO startUser = adminUserApi.getUser(Long.valueOf(processInstance.getStartUserId())); | |
| 1197 | - messageService.sendMessageWhenTaskAssigned(BpmTaskConvert.INSTANCE.convert(processInstance, startUser, task)); | |
| 1195 | + // 注意:需要基于 instance 设置租户编号,避免 Flowable 内部异步时,丢失租户编号 | |
| 1196 | + FlowableUtils.execute(processInstance.getTenantId(),()-> { | |
| 1197 | + AdminUserRespDTO startUser = adminUserApi.getUser(Long.valueOf(processInstance.getStartUserId())); | |
| 1198 | + messageService.sendMessageWhenTaskAssigned(BpmTaskConvert.INSTANCE.convert(processInstance, startUser, task)); | |
| 1199 | + }); | |
| 1198 | 1200 | } |
| 1199 | 1201 | |
| 1200 | 1202 | }); | ... | ... |