Java Code Examples for org.camunda.bpm.engine.task.TaskQuery#taskDelegationState()

The following examples show how to use org.camunda.bpm.engine.task.TaskQuery#taskDelegationState() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FilterTaskQueryTest.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
public void testExtendingTaskQuerySingleResult() {
  TaskQuery query = taskService.createTaskQuery();
  query.taskDelegationState(DelegationState.PENDING);

  saveQuery(query);

  Task task = filterService.singleResult(filter.getId());
  assertNotNull(task);
  assertEquals("Task 1", task.getName());
  assertEquals("task1", task.getId());

  task = filterService.singleResult(filter.getId(), query);
  assertNotNull(task);
  assertEquals("Task 1", task.getName());
  assertEquals("task1", task.getId());

  TaskQuery extendingQuery = taskService.createTaskQuery();

  extendingQuery.taskId("task1");

  task = filterService.singleResult(filter.getId(), extendingQuery);
  assertNotNull(task);
  assertEquals("Task 1", task.getName());
  assertEquals("task1", task.getId());
}
 
Example 2
Source File: FilterTaskQueryTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public void testExecuteTaskQuerySingleResult() {
  TaskQuery query = taskService.createTaskQuery();
  query.taskDelegationState(DelegationState.PENDING);

  saveQuery(query);

  Task task = filterService.singleResult(filter.getId());
  assertNotNull(task);
  assertEquals("Task 1", task.getName());
}
 
Example 3
Source File: FilterTaskQueryTest.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public void testExtendingTaskQueryList() {
  TaskQuery query = taskService.createTaskQuery();

  saveQuery(query);

  List<Task> tasks = filterService.list(filter.getId());
  assertEquals(3, tasks.size());

  tasks = filterService.list(filter.getId(), query);
  assertEquals(3, tasks.size());

  TaskQuery extendingQuery = taskService.createTaskQuery();

  extendingQuery.taskDelegationState(DelegationState.RESOLVED);

  tasks = filterService.list(filter.getId(), extendingQuery);
  assertEquals(2, tasks.size());

  for (Task task : tasks) {
    assertEquals(DelegationState.RESOLVED, task.getDelegationState());
  }
}
 
Example 4
Source File: FilterTaskQueryTest.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public void testExtendingTaskQueryListPage() {
  TaskQuery query = taskService.createTaskQuery();

  saveQuery(query);

  List<Task> tasks = filterService.listPage(filter.getId(), 1, 2);
  assertEquals(2, tasks.size());

  tasks = filterService.listPage(filter.getId(), query, 1, 2);
  assertEquals(2, tasks.size());

  TaskQuery extendingQuery = taskService.createTaskQuery();

  extendingQuery.taskDelegationState(DelegationState.RESOLVED);

  tasks = filterService.listPage(filter.getId(), extendingQuery, 1, 2);
  assertEquals(1, tasks.size());

  assertEquals(DelegationState.RESOLVED, tasks.get(0).getDelegationState());
}
 
Example 5
Source File: FilterTaskQueryTest.java    From camunda-bpm-platform with Apache License 2.0 3 votes vote down vote up
public void testExecuteTaskQueryCount() {
  TaskQuery query = taskService.createTaskQuery();

  saveQuery(query);

  long count = filterService.count(filter.getId());
  assertEquals(3, count);

  query.taskDelegationState(DelegationState.RESOLVED);

  saveQuery(query);

  count = filterService.count(filter.getId());
  assertEquals(2, count);
}