Search in sources :

Example 1 with TenantIdProvider

use of org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProvider 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)

Example 2 with TenantIdProvider

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

the class DefaultDmnHistoryEventProducer method provideTenantId.

protected String provideTenantId(DecisionDefinition decisionDefinition, HistoricDecisionInstanceEntity event) {
    TenantIdProvider tenantIdProvider = Context.getProcessEngineConfiguration().getTenantIdProvider();
    String tenantId = null;
    if (tenantIdProvider != null) {
        TenantIdProviderHistoricDecisionInstanceContext ctx = null;
        if (event.getExecutionId() != null) {
            ctx = new TenantIdProviderHistoricDecisionInstanceContext(decisionDefinition, getExecution(event));
        } else if (event.getCaseExecutionId() != null) {
            ctx = new TenantIdProviderHistoricDecisionInstanceContext(decisionDefinition, getCaseExecution(event));
        } else {
            ctx = new TenantIdProviderHistoricDecisionInstanceContext(decisionDefinition);
        }
        tenantId = tenantIdProvider.provideTenantIdForHistoricDecisionInstance(ctx);
    }
    return tenantId;
}
Also used : TenantIdProviderHistoricDecisionInstanceContext(org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProviderHistoricDecisionInstanceContext) TenantIdProvider(org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProvider)

Example 3 with TenantIdProvider

use of org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProvider 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)3 VariableMap (org.camunda.bpm.engine.variable.VariableMap)2 TenantIdProviderCaseInstanceContext (org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProviderCaseInstanceContext)1 TenantIdProviderHistoricDecisionInstanceContext (org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProviderHistoricDecisionInstanceContext)1 TenantIdProviderProcessInstanceContext (org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProviderProcessInstanceContext)1 CmmnCaseDefinition (org.camunda.bpm.engine.impl.cmmn.model.CmmnCaseDefinition)1 PvmProcessDefinition (org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition)1 CaseDefinition (org.camunda.bpm.engine.repository.CaseDefinition)1 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)1