use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class FilterTaskQueryTest method testTaskQueryByBusinessKeyLikeExpressionInAdhocQuery.
public void testTaskQueryByBusinessKeyLikeExpressionInAdhocQuery() {
// given
processEngineConfiguration.setEnableExpressionsInAdhocQueries(true);
String aBusinessKey = "business key";
Mocks.register("aBusinessKeyLike", "%" + aBusinessKey.substring(5));
createDeploymentWithBusinessKey(aBusinessKey);
// when
Filter filter = filterService.newTaskFilter("aFilterName");
filter.setQuery(taskService.createTaskQuery());
filterService.saveFilter(filter);
TaskQueryImpl extendingQuery = (TaskQueryImpl) taskService.createTaskQuery().processInstanceBusinessKeyLikeExpression("${ " + Mocks.getMocks().keySet().toArray()[0] + " }");
// then
assertEquals(extendingQuery.getExpressions().get("processInstanceBusinessKeyLike"), "${ " + Mocks.getMocks().keySet().toArray()[0] + " }");
assertEquals(1, filterService.list(filter.getId(), extendingQuery).size());
}
use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class FilterTaskQueryTest method testTaskQueryCandidateUserExpressionIncludeAssignedTasks.
public void testTaskQueryCandidateUserExpressionIncludeAssignedTasks() {
TaskQueryImpl query = new TaskQueryImpl();
query.taskCandidateUserExpression(testString);
query.includeAssignedTasks();
saveQuery(query);
query = filterService.getFilter(filter.getId()).getQuery();
assertEquals(testString, query.getExpressions().get("taskCandidateUser"));
assertTrue(query.isIncludeAssignedTasks());
}
use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class FilterTaskQueryTest method testTaskQueryCandidateGroupIncludeAssignedTasks.
public void testTaskQueryCandidateGroupIncludeAssignedTasks() {
TaskQueryImpl query = new TaskQueryImpl();
query.taskCandidateGroup(testGroup.getId());
query.includeAssignedTasks();
saveQuery(query);
query = filterService.getFilter(filter.getId()).getQuery();
assertEquals(testGroup.getId(), query.getCandidateGroup());
assertTrue(query.isIncludeAssignedTasks());
}
use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class FilterTaskQueryTest method testTaskQueryCandidateGroupsIncludeAssignedTasks.
public void testTaskQueryCandidateGroupsIncludeAssignedTasks() {
TaskQueryImpl query = new TaskQueryImpl();
query.taskCandidateGroupIn(testCandidateGroups);
query.includeAssignedTasks();
saveQuery(query);
query = filterService.getFilter(filter.getId()).getQuery();
assertEquals(testCandidateGroups, query.getCandidateGroupsInternal());
assertTrue(query.isIncludeAssignedTasks());
}
use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class FilterTaskQueryTest method testTaskQueryByFollowUpBeforeOrNotExistentExtendingQuery.
public void testTaskQueryByFollowUpBeforeOrNotExistentExtendingQuery() {
// create query
TaskQueryImpl query = new TaskQueryImpl();
query.followUpBeforeOrNotExistent(testDate);
// save filter without query
filterService.saveFilter(filter);
// fetch from db
filter = filterService.createTaskFilterQuery().singleResult();
// use query as extending query
List<Task> tasks = filterService.list(filter.getId(), query);
assertEquals(3, tasks.size());
// set as filter query and save filter
filter.setQuery(query);
filterService.saveFilter(filter);
// fetch from db
filter = filterService.createTaskFilterQuery().singleResult();
tasks = filterService.list(filter.getId());
assertEquals(3, tasks.size());
TaskQuery extendingQuery = taskService.createTaskQuery();
extendingQuery.orderByTaskCreateTime().asc();
tasks = filterService.list(filter.getId(), extendingQuery);
assertEquals(3, tasks.size());
}
Aggregations