Search in sources :

Example 1 with TenantIdProviderProcessInstanceContext

use of org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProviderProcessInstanceContext in project camunda-bpm-platform by camunda.

the class ExecutionEntity method provideTenantId.

protected void provideTenantId(Map<String, Object> variables) {
    if (tenantId == null) {
        TenantIdProvider tenantIdProvider = Context.getProcessEngineConfiguration().getTenantIdProvider();
        if (tenantIdProvider != null) {
            VariableMap variableMap = Variables.fromMap(variables);
            ProcessDefinition processDefinition = getProcessDefinition();
            TenantIdProviderProcessInstanceContext ctx;
            if (superExecutionId != null) {
                ctx = new TenantIdProviderProcessInstanceContext(processDefinition, variableMap, getSuperExecution());
            } else if (superCaseExecutionId != null) {
                ctx = new TenantIdProviderProcessInstanceContext(processDefinition, variableMap, getSuperCaseExecution());
            } else {
                ctx = new TenantIdProviderProcessInstanceContext(processDefinition, variableMap);
            }
            tenantId = tenantIdProvider.provideTenantIdForProcessInstance(ctx);
        }
    }
}
Also used : VariableMap(org.camunda.bpm.engine.variable.VariableMap) TenantIdProvider(org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProvider) PvmProcessDefinition(org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition) ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) TenantIdProviderProcessInstanceContext(org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProviderProcessInstanceContext)

Aggregations

TenantIdProvider (org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProvider)1 TenantIdProviderProcessInstanceContext (org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProviderProcessInstanceContext)1 PvmProcessDefinition (org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition)1 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)1 VariableMap (org.camunda.bpm.engine.variable.VariableMap)1