【缺陷修复】 延迟器 trigger 时,租户 id 丢失的问题

This commit is contained in:
jason 2025-01-04 15:13:54 +08:00
parent 686a64ccda
commit 6a7e7e3e44
1 changed files with 5 additions and 3 deletions

View File

@ -1192,9 +1192,11 @@ public class BpmTaskServiceImpl implements BpmTaskService {
} }
} }
} }
// 注意需要基于 instance 设置租户编号避免 Flowable 内部异步时丢失租户编号
AdminUserRespDTO startUser = adminUserApi.getUser(Long.valueOf(processInstance.getStartUserId())); FlowableUtils.execute(processInstance.getTenantId(),()-> {
messageService.sendMessageWhenTaskAssigned(BpmTaskConvert.INSTANCE.convert(processInstance, startUser, task)); AdminUserRespDTO startUser = adminUserApi.getUser(Long.valueOf(processInstance.getStartUserId()));
messageService.sendMessageWhenTaskAssigned(BpmTaskConvert.INSTANCE.convert(processInstance, startUser, task));
});
} }
}); });