|
@@ -5,6 +5,7 @@ import cn.hutool.extra.spring.SpringUtil;
|
|
|
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
|
|
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
|
|
|
import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmnVariableConstants;
|
|
|
+import lombok.SneakyThrows;
|
|
|
import org.flowable.common.engine.api.delegate.Expression;
|
|
|
import org.flowable.common.engine.api.variable.VariableContainer;
|
|
|
import org.flowable.common.engine.impl.el.ExpressionManager;
|
|
@@ -67,6 +68,17 @@ public class FlowableUtils {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @SneakyThrows
|
|
|
+ public static <V> V execute(String tenantIdStr, Callable<V> callable) {
|
|
|
+ if (ObjectUtil.isEmpty(tenantIdStr)
|
|
|
+ || Objects.equals(tenantIdStr, ProcessEngineConfiguration.NO_TENANT_ID)) {
|
|
|
+ return callable.call();
|
|
|
+ } else {
|
|
|
+ Long tenantId = Long.valueOf(tenantIdStr);
|
|
|
+ return TenantUtils.execute(tenantId, callable);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// ========== Execution 相关的工具方法 ==========
|
|
|
|
|
|
/**
|