Search in sources :

Example 21 with TaskQuery

use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.

the class FilterTaskQueryTest method testEmptyQuery.

public void testEmptyQuery() {
    TaskQuery emptyQuery = taskService.createTaskQuery();
    String emptyQueryJson = "{}";
    filter.setQuery(emptyQuery);
    assertEquals(emptyQueryJson, ((FilterEntity) filter).getQueryInternal());
    assertNotNull(filter.getQuery());
}
Also used : TaskQuery(org.camunda.bpm.engine.task.TaskQuery)

Example 22 with TaskQuery

use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.

the class FilterTaskQueryTest method testExecuteTaskQueryList.

public void testExecuteTaskQueryList() {
    TaskQuery query = taskService.createTaskQuery();
    query.taskNameLike("Task%");
    saveQuery(query);
    List<Task> tasks = filterService.list(filter.getId());
    assertEquals(3, tasks.size());
    for (Task task : tasks) {
        assertEquals(testUser.getId(), task.getOwner());
    }
}
Also used : Task(org.camunda.bpm.engine.task.Task) TaskQuery(org.camunda.bpm.engine.task.TaskQuery)

Example 23 with TaskQuery

use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.

the class FilterTaskQueryTest method testExtendingTaskQueryListWithIncludeAssignedTasks.

public void testExtendingTaskQueryListWithIncludeAssignedTasks() {
    TaskQuery query = taskService.createTaskQuery();
    query.taskCandidateGroup("accounting");
    saveQuery(query);
    List<Task> tasks = filterService.list(filter.getId());
    assertEquals(1, tasks.size());
    TaskQuery extendingQuery = taskService.createTaskQuery();
    extendingQuery.taskCandidateGroup("accounting").includeAssignedTasks();
    tasks = filterService.list(filter.getId(), extendingQuery);
    assertEquals(2, tasks.size());
}
Also used : Task(org.camunda.bpm.engine.task.Task) TaskQuery(org.camunda.bpm.engine.task.TaskQuery)

Example 24 with TaskQuery

use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.

the class FilterTaskQueryTest method testExtendingTaskQueryListWithCandidateGroups.

public void testExtendingTaskQueryListWithCandidateGroups() {
    TaskQuery query = taskService.createTaskQuery();
    List<String> candidateGroups = new ArrayList<String>();
    candidateGroups.add("accounting");
    query.taskCandidateGroupIn(candidateGroups);
    saveQuery(query);
    List<Task> tasks = filterService.list(filter.getId());
    assertEquals(1, tasks.size());
    tasks = filterService.list(filter.getId(), query);
    assertEquals(1, tasks.size());
    TaskQuery extendingQuery = taskService.createTaskQuery();
    extendingQuery.orderByTaskCreateTime().asc();
    tasks = filterService.list(filter.getId(), extendingQuery);
    assertEquals(1, tasks.size());
}
Also used : Task(org.camunda.bpm.engine.task.Task) TaskQuery(org.camunda.bpm.engine.task.TaskQuery) ArrayList(java.util.ArrayList)

Example 25 with TaskQuery

use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyFilterServiceTest method testFilterTasksByTenantIdNoAuthenticatedTenants.

public void testFilterTasksByTenantIdNoAuthenticatedTenants() {
    TaskQuery query = taskService.createTaskQuery().tenantIdIn(TENANT_ONE);
    filterId = createFilter(query);
    identityService.setAuthentication("user", null, null);
    assertThat(filterService.count(filterId), is(0L));
}
Also used : TaskQuery(org.camunda.bpm.engine.task.TaskQuery)

Aggregations

TaskQuery (org.camunda.bpm.engine.task.TaskQuery)517 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)230 Task (org.camunda.bpm.engine.task.Task)227 Test (org.junit.Test)224 Deployment (org.camunda.bpm.engine.test.Deployment)195 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)124 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)86 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)55 Filter (org.camunda.bpm.engine.filter.Filter)26 TaskQueryImpl (org.camunda.bpm.engine.impl.TaskQueryImpl)24 JobQuery (org.camunda.bpm.engine.runtime.JobQuery)23 HistoricProcessInstance (org.camunda.bpm.engine.history.HistoricProcessInstance)22 Execution (org.camunda.bpm.engine.runtime.Execution)22 Job (org.camunda.bpm.engine.runtime.Job)20 ExecutionQuery (org.camunda.bpm.engine.runtime.ExecutionQuery)17 ProcessInstanceQuery (org.camunda.bpm.engine.runtime.ProcessInstanceQuery)15 Date (java.util.Date)12 HashMap (java.util.HashMap)12 SequenceFlow (org.camunda.bpm.model.bpmn.instance.SequenceFlow)12 CamundaExecutionListener (org.camunda.bpm.model.bpmn.instance.camunda.CamundaExecutionListener)12