Search in sources :

Example 86 with CaseInstanceQuery

use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyCaseTaskTest method testCaseRefTenantIdExpression.

public void testCaseRefTenantIdExpression() {
    deployment(CMMN_TENANT_EXPR);
    deploymentForTenant(TENANT_ONE, CMMN_CASE);
    caseService.withCaseDefinitionByKey("caseTaskCase").create();
    CaseInstanceQuery query = caseService.createCaseInstanceQuery().caseDefinitionKey("oneTaskCase");
    assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
}
Also used : CaseInstanceQuery(org.camunda.bpm.engine.runtime.CaseInstanceQuery)

Example 87 with CaseInstanceQuery

use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyCaseTaskTest method testCaseRefTenantIdConstant.

public void testCaseRefTenantIdConstant() {
    deployment(CMMN_TENANT_CONST);
    deploymentForTenant(TENANT_ONE, CMMN_CASE);
    caseService.withCaseDefinitionByKey("caseTaskCase").create();
    CaseInstanceQuery query = caseService.createCaseInstanceQuery().caseDefinitionKey("oneTaskCase");
    assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
}
Also used : CaseInstanceQuery(org.camunda.bpm.engine.runtime.CaseInstanceQuery)

Example 88 with CaseInstanceQuery

use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyCaseInstanceQueryTest method testQueryDisabledTenantCheck.

public void testQueryDisabledTenantCheck() {
    processEngineConfiguration.setTenantCheckEnabled(false);
    identityService.setAuthentication("user", null, null);
    CaseInstanceQuery query = caseService.createCaseInstanceQuery();
    assertThat(query.count(), is(3L));
}
Also used : CaseInstanceQuery(org.camunda.bpm.engine.runtime.CaseInstanceQuery)

Example 89 with CaseInstanceQuery

use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyCaseInstanceQueryTest method testQueryByTenantId.

public void testQueryByTenantId() {
    CaseInstanceQuery query = caseService.createCaseInstanceQuery().tenantIdIn(TENANT_ONE);
    assertThat(query.count(), is(1L));
    query = caseService.createCaseInstanceQuery().tenantIdIn(TENANT_TWO);
    assertThat(query.count(), is(1L));
}
Also used : CaseInstanceQuery(org.camunda.bpm.engine.runtime.CaseInstanceQuery)

Example 90 with CaseInstanceQuery

use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyCaseInstanceQueryTest method testQueryByNonExistingTenantId.

public void testQueryByNonExistingTenantId() {
    CaseInstanceQuery query = caseService.createCaseInstanceQuery().tenantIdIn("nonExisting");
    assertThat(query.count(), is(0L));
}
Also used : CaseInstanceQuery(org.camunda.bpm.engine.runtime.CaseInstanceQuery)

Aggregations

CaseInstanceQuery (org.camunda.bpm.engine.runtime.CaseInstanceQuery)123 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)21 Deployment (org.camunda.bpm.engine.test.Deployment)10 NotValidException (org.camunda.bpm.engine.exception.NotValidException)9 ArrayList (java.util.ArrayList)8 CaseInstance (org.camunda.bpm.engine.runtime.CaseInstance)8 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)7 Date (java.util.Date)6 CaseExecutionQuery (org.camunda.bpm.engine.runtime.CaseExecutionQuery)4 CaseDefinition (org.camunda.bpm.engine.repository.CaseDefinition)3 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)2 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 CaseInstanceDto (org.camunda.bpm.engine.rest.dto.runtime.CaseInstanceDto)1 CaseExecution (org.camunda.bpm.engine.runtime.CaseExecution)1