Search in sources :

Example 6 with ExecutionQuery

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

the class ExecutionAuthorizationTest method testQueryWithReadPermissionOnAnyProcessInstance.

public void testQueryWithReadPermissionOnAnyProcessInstance() {
    // given
    startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
    startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
    startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
    startProcessInstanceByKey(MESSAGE_BOUNDARY_PROCESS_KEY);
    startProcessInstanceByKey(MESSAGE_BOUNDARY_PROCESS_KEY);
    startProcessInstanceByKey(MESSAGE_BOUNDARY_PROCESS_KEY);
    startProcessInstanceByKey(MESSAGE_BOUNDARY_PROCESS_KEY);
    createGrantAuthorization(PROCESS_INSTANCE, ANY, userId, READ);
    // when
    ExecutionQuery query = runtimeService.createExecutionQuery();
    // then
    verifyQueryResults(query, 11);
}
Also used : ExecutionQuery(org.camunda.bpm.engine.runtime.ExecutionQuery)

Example 7 with ExecutionQuery

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

the class MultiTenancyExecutionQueryTest method testQueryDisabledTenantCheck.

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

Example 8 with ExecutionQuery

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

the class MultiTenancyExecutionQueryTest method testQueryByTenantIds.

public void testQueryByTenantIds() {
    ExecutionQuery query = runtimeService.createExecutionQuery().tenantIdIn(TENANT_ONE, TENANT_TWO);
    assertThat(query.count(), is(2L));
}
Also used : ExecutionQuery(org.camunda.bpm.engine.runtime.ExecutionQuery)

Example 9 with ExecutionQuery

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

the class MultiTenancyExecutionQueryTest method testQueryNoAuthenticatedTenants.

public void testQueryNoAuthenticatedTenants() {
    identityService.setAuthentication("user", null, null);
    ExecutionQuery query = runtimeService.createExecutionQuery();
    assertThat(query.count(), is(1L));
}
Also used : ExecutionQuery(org.camunda.bpm.engine.runtime.ExecutionQuery)

Example 10 with ExecutionQuery

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

the class ExecutionQueryTest method testQueryByActivityId.

public void testQueryByActivityId() {
    ExecutionQuery query = runtimeService.createExecutionQuery().activityId("receivePayment");
    assertEquals(4, query.list().size());
    assertEquals(4, query.count());
    try {
        assertNull(query.singleResult());
        fail();
    } catch (ProcessEngineException e) {
    }
}
Also used : ExecutionQuery(org.camunda.bpm.engine.runtime.ExecutionQuery) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Aggregations

ExecutionQuery (org.camunda.bpm.engine.runtime.ExecutionQuery)59 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)27 Deployment (org.camunda.bpm.engine.test.Deployment)26 Execution (org.camunda.bpm.engine.runtime.Execution)17 TaskQuery (org.camunda.bpm.engine.task.TaskQuery)17 JobQuery (org.camunda.bpm.engine.runtime.JobQuery)14 ProcessInstanceQuery (org.camunda.bpm.engine.runtime.ProcessInstanceQuery)12 HashMap (java.util.HashMap)10 ArrayList (java.util.ArrayList)7 Job (org.camunda.bpm.engine.runtime.Job)6 Test (org.junit.Test)4 Date (java.util.Date)2 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)2 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)2 SimpleDateFormat (java.text.SimpleDateFormat)1 Calendar (java.util.Calendar)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 ExecutionDto (org.camunda.bpm.engine.rest.dto.runtime.ExecutionDto)1 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)1 CaseExecution (org.camunda.bpm.engine.runtime.CaseExecution)1