historyService.deleteHistoricTaskInstance(assigneeToKermit.getId());
}
}
public void testQueryByCandidateOrAssignedOr() {
TaskQuery query = taskService.createTaskQuery()
.or()
.taskId("invalid")
.taskCandidateOrAssigned("kermit");
assertEquals(11, query.count());
List<Task> tasks = query.list();
assertEquals(11, tasks.size());
// if dbIdentityUsed set false in process engine configuration of using custom session factory of GroupIdentityManager
ArrayList<String> candidateGroups = new ArrayList<String>();
candidateGroups.add("management");
candidateGroups.add("accountancy");
candidateGroups.add("noexist");
query = taskService.createTaskQuery()
.or()
.taskId("invalid")
.taskCandidateGroupIn(candidateGroups)
.taskCandidateOrAssigned("kermit");
assertEquals(11, query.count());
tasks = query.list();
assertEquals(11, tasks.size());
query = taskService.createTaskQuery()
.or()
.taskId("invalid")
.taskCandidateOrAssigned("fozzie");
assertEquals(3, query.count());
assertEquals(3, query.list().size());
// create a new task that no identity link and assignee to kermit
Task task = taskService.newTask();
task.setName("assigneeToKermit");
task.setDescription("testTask description");
task.setPriority(3);
task.setAssignee("kermit");
taskService.saveTask(task);
query = taskService.createTaskQuery()
.or()
.taskId("invalid")
.taskCandidateOrAssigned("kermit");
assertEquals(12, query.count());
tasks = query.list();
assertEquals(12, tasks.size());
Task assigneeToKermit = taskService.createTaskQuery()
.or()
.taskId("invalid")