use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCallActivityTest method testCaseRefTenantIdConstant.
public void testCaseRefTenantIdConstant() {
BpmnModelInstance callingProcess = Bpmn.createExecutableProcess("callingProcess").startEvent().callActivity().camundaCaseRef("Case_1").camundaCaseTenantId(TENANT_ONE).endEvent().done();
deploymentForTenant(TENANT_ONE, CMMN);
deployment(callingProcess);
runtimeService.startProcessInstanceByKey("callingProcess");
CaseInstanceQuery query = caseService.createCaseInstanceQuery().caseDefinitionKey("Case_1");
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCallActivityTest method testStartCaseInstanceWithLatestBindingDifferentVersion.
public void testStartCaseInstanceWithLatestBindingDifferentVersion() {
BpmnModelInstance callingProcess = Bpmn.createExecutableProcess("callingProcess").startEvent().callActivity().camundaCaseRef("Case_1").camundaCaseBinding("latest").endEvent().done();
deploymentForTenant(TENANT_ONE, CMMN, callingProcess);
deploymentForTenant(TENANT_TWO, CMMN, callingProcess);
deploymentForTenant(TENANT_TWO, CMMN);
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));
CaseDefinition latestCaseDefinitionTenantTwo = repositoryService.createCaseDefinitionQuery().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 MultiTenancyCallActivityTest method testCaseRefTenantIdCompositeExpression.
public void testCaseRefTenantIdCompositeExpression() {
// given
BpmnModelInstance callingProcess = Bpmn.createExecutableProcess("callingProcess").startEvent().callActivity().camundaCaseRef("Case_1").camundaCaseTenantId("tenant${'1'}").endEvent().done();
deploymentForTenant(TENANT_ONE, CMMN);
deployment(callingProcess);
// when
runtimeService.startProcessInstanceByKey("callingProcess");
// then
CaseInstanceQuery query = caseService.createCaseInstanceQuery().caseDefinitionKey("Case_1");
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCallActivityTest method testStartCaseInstanceWithDeploymentBinding.
public void testStartCaseInstanceWithDeploymentBinding() {
BpmnModelInstance callingProcess = Bpmn.createExecutableProcess("callingProcess").startEvent().callActivity().camundaCaseRef("Case_1").camundaCaseBinding("deployment").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));
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByDoubleVariableValueGreaterThan.
public void testQueryByDoubleVariableValueGreaterThan() {
caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aDoubleValue", 1.5).create();
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
query.variableValueGreaterThan("aDoubleValue", 1.4);
verifyQueryResults(query, 1);
}
Aggregations