use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseTaskTest method testStartCaseInstanceWithDeploymentBinding.
public void testStartCaseInstanceWithDeploymentBinding() {
deploymentForTenant(TENANT_ONE, CMMN_DEPLOYMENT, CMMN_CASE);
deploymentForTenant(TENANT_TWO, CMMN_DEPLOYMENT, CMMN_CASE);
createCaseInstance("caseTaskCaseDeployment", TENANT_ONE);
createCaseInstance("caseTaskCaseDeployment", TENANT_TWO);
CaseInstanceQuery query = caseService.createCaseInstanceQuery().caseDefinitionKey("oneTaskCase");
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseTaskTest method testStartCaseInstanceWithLatestBindingSameVersion.
public void testStartCaseInstanceWithLatestBindingSameVersion() {
deploymentForTenant(TENANT_ONE, CMMN_LATEST_WITH_MANUAL_ACTIVATION, CMMN_CASE);
deploymentForTenant(TENANT_TWO, CMMN_LATEST_WITH_MANUAL_ACTIVATION, CMMN_CASE);
createCaseInstance("caseTaskCase", TENANT_ONE);
createCaseInstance("caseTaskCase", TENANT_TWO);
CaseInstanceQuery query = caseService.createCaseInstanceQuery().caseDefinitionKey("oneTaskCase");
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseTaskTest method testStartCaseInstanceWithLatestBindingDifferentVersion.
public void testStartCaseInstanceWithLatestBindingDifferentVersion() {
deploymentForTenant(TENANT_ONE, CMMN_LATEST_WITH_MANUAL_ACTIVATION, CMMN_CASE);
deploymentForTenant(TENANT_TWO, CMMN_LATEST_WITH_MANUAL_ACTIVATION, CMMN_CASE);
deploymentForTenant(TENANT_TWO, CMMN_CASE);
createCaseInstance("caseTaskCase", TENANT_ONE);
createCaseInstance("caseTaskCase", TENANT_TWO);
CaseInstanceQuery query = caseService.createCaseInstanceQuery().caseDefinitionKey("oneTaskCase");
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
CaseDefinition latestCaseDefinitionTenantTwo = repositoryService.createCaseDefinitionQuery().caseDefinitionKey("oneTaskCase").tenantIdIn(TENANT_TWO).latestVersion().singleResult();
query = caseService.createCaseInstanceQuery().caseDefinitionId(latestCaseDefinitionTenantTwo.getId());
assertThat(query.count(), is(1L));
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseTaskTest method testStartCaseInstanceWithVersionBinding.
public void testStartCaseInstanceWithVersionBinding() {
deploymentForTenant(TENANT_ONE, CMMN_VERSION, CMMN_CASE);
deploymentForTenant(TENANT_TWO, CMMN_VERSION, CMMN_CASE);
createCaseInstance("caseTaskCaseVersion", TENANT_ONE);
createCaseInstance("caseTaskCaseVersion", TENANT_TWO);
CaseInstanceQuery query = caseService.createCaseInstanceQuery().caseDefinitionKey("oneTaskCase");
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCallActivityTest method testStartCaseInstanceWithLatestBindingSameVersion.
public void testStartCaseInstanceWithLatestBindingSameVersion() {
BpmnModelInstance callingProcess = Bpmn.createExecutableProcess("callingProcess").startEvent().callActivity().camundaCaseRef("Case_1").camundaCaseBinding("latest").endEvent().done();
deploymentForTenant(TENANT_ONE, CMMN, callingProcess);
deploymentForTenant(TENANT_TWO, CMMN, callingProcess);
runtimeService.createProcessInstanceByKey("callingProcess").processDefinitionTenantId(TENANT_ONE).execute();
runtimeService.createProcessInstanceByKey("callingProcess").processDefinitionTenantId(TENANT_TWO).execute();
CaseInstanceQuery query = caseService.createCaseInstanceQuery().caseDefinitionKey("Case_1");
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
}
Aggregations