Search in sources :

Example 1 with TenantIdProviderCaseInstanceContext

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

the class CaseExecutionEntity method provideTenantId.

protected void provideTenantId(Map<String, Object> variables) {
    TenantIdProvider tenantIdProvider = Context.getProcessEngineConfiguration().getTenantIdProvider();
    if (tenantIdProvider != null) {
        VariableMap variableMap = Variables.fromMap(variables);
        CaseDefinition caseDefinition = (CaseDefinition) getCaseDefinition();
        TenantIdProviderCaseInstanceContext ctx = null;
        if (superExecutionId != null) {
            ctx = new TenantIdProviderCaseInstanceContext(caseDefinition, variableMap, getSuperExecution());
        } else if (superCaseExecutionId != null) {
            ctx = new TenantIdProviderCaseInstanceContext(caseDefinition, variableMap, getSuperCaseExecution());
        } else {
            ctx = new TenantIdProviderCaseInstanceContext(caseDefinition, variableMap);
        }
        tenantId = tenantIdProvider.provideTenantIdForCaseInstance(ctx);
    }
}
Also used : VariableMap(org.camunda.bpm.engine.variable.VariableMap) TenantIdProvider(org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProvider) CaseDefinition(org.camunda.bpm.engine.repository.CaseDefinition) CmmnCaseDefinition(org.camunda.bpm.engine.impl.cmmn.model.CmmnCaseDefinition) TenantIdProviderCaseInstanceContext(org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProviderCaseInstanceContext)

Aggregations

TenantIdProvider (org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProvider)1 TenantIdProviderCaseInstanceContext (org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProviderCaseInstanceContext)1 CmmnCaseDefinition (org.camunda.bpm.engine.impl.cmmn.model.CmmnCaseDefinition)1 CaseDefinition (org.camunda.bpm.engine.repository.CaseDefinition)1 VariableMap (org.camunda.bpm.engine.variable.VariableMap)1