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

This commit is contained in:
jason
2025-01-04 15:13:54 +08:00
parent 686a64ccda
commit 6a7e7e3e44

View File

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