use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.
the class TenantIdProviderTest method tenantIdInheritedFromSuperCaseInstance.
@Test
public void tenantIdInheritedFromSuperCaseInstance() {
String tenantId = TENANT_ID;
SetValueOnRootCaseInstanceTenantIdProvider tenantIdProvider = new SetValueOnRootCaseInstanceTenantIdProvider(tenantId);
TestTenantIdProvider.delegate = tenantIdProvider;
testRule.deploy(CMMN_SUBPROCESS_FILE, CMMN_FILE);
// if a case instance is created
engineRule.getCaseService().withCaseDefinitionByKey(CASE_DEFINITION_KEY).create();
// then the tenant id is inherited to the sub case instance even tough it is not set by the provider
CaseInstance caseInstance = engineRule.getCaseService().createCaseInstanceQuery().caseDefinitionKey("oneTaskCase").singleResult();
assertThat(caseInstance.getTenantId(), is(tenantId));
}
use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionTaskTest method testEvaluateDecisionWithLatestBindingSameVersion.
public void testEvaluateDecisionWithLatestBindingSameVersion() {
deploymentForTenant(TENANT_ONE, CMMN_LATEST, DMN_FILE);
deploymentForTenant(TENANT_TWO, CMMN_LATEST, DMN_FILE_VERSION_TWO);
CaseInstance caseInstanceOne = createCaseInstance(CASE_DEFINITION_KEY, TENANT_ONE);
CaseInstance caseInstanceTwo = createCaseInstance(CASE_DEFINITION_KEY, TENANT_TWO);
assertThat((String) caseService.getVariable(caseInstanceOne.getId(), "decisionVar"), is(RESULT_OF_VERSION_ONE));
assertThat((String) caseService.getVariable(caseInstanceTwo.getId(), "decisionVar"), is(RESULT_OF_VERSION_TWO));
}
use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionTaskTest method testEvaluateDecisionWithLatestBindingDifferentVersions.
public void testEvaluateDecisionWithLatestBindingDifferentVersions() {
deploymentForTenant(TENANT_ONE, CMMN_LATEST, DMN_FILE);
deploymentForTenant(TENANT_TWO, CMMN_LATEST, DMN_FILE);
deploymentForTenant(TENANT_TWO, CMMN_LATEST, DMN_FILE_VERSION_TWO);
CaseInstance caseInstanceOne = createCaseInstance(CASE_DEFINITION_KEY, TENANT_ONE);
CaseInstance caseInstanceTwo = createCaseInstance(CASE_DEFINITION_KEY, TENANT_TWO);
assertThat((String) caseService.getVariable(caseInstanceOne.getId(), "decisionVar"), is(RESULT_OF_VERSION_ONE));
assertThat((String) caseService.getVariable(caseInstanceTwo.getId(), "decisionVar"), is(RESULT_OF_VERSION_TWO));
}
use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionTaskTest method testEvaluateDecisionRefWithoutTenantIdConstant.
public void testEvaluateDecisionRefWithoutTenantIdConstant() {
deploymentForTenant(TENANT_ONE, CMMN_WITHOUT_TENANT);
deployment(DMN_FILE);
deploymentForTenant(TENANT_TWO, DMN_FILE_VERSION_TWO);
CaseInstance caseInstance = createCaseInstance(CASE_DEFINITION_KEY);
assertThat((String) caseService.getVariable(caseInstance.getId(), "decisionVar"), is(RESULT_OF_VERSION_ONE));
}
use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionTaskTest method testEvaluateDecisionWithDeploymentBinding.
public void testEvaluateDecisionWithDeploymentBinding() {
deploymentForTenant(TENANT_ONE, CMMN_DEPLOYMENT, DMN_FILE);
deploymentForTenant(TENANT_TWO, CMMN_DEPLOYMENT, DMN_FILE_VERSION_TWO);
CaseInstance caseInstanceOne = createCaseInstance(CASE_DEFINITION_KEY, TENANT_ONE);
CaseInstance caseInstanceTwo = createCaseInstance(CASE_DEFINITION_KEY, TENANT_TWO);
assertThat((String) caseService.getVariable(caseInstanceOne.getId(), "decisionVar"), is(RESULT_OF_VERSION_ONE));
assertThat((String) caseService.getVariable(caseInstanceTwo.getId(), "decisionVar"), is(RESULT_OF_VERSION_TWO));
}
Aggregations