use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class MultiTenancyFilterServiceTest method testCreateFilterWithNoTenantIdCriteria.
public void testCreateFilterWithNoTenantIdCriteria() {
TaskQuery query = taskService.createTaskQuery().withoutTenantId();
filterId = createFilter(query);
Filter savedFilter = filterService.getFilter(filterId);
TaskQueryImpl savedQuery = savedFilter.getQuery();
assertThat(savedQuery.isTenantIdSet(), is(true));
assertThat(savedQuery.getTenantIds(), is(nullValue()));
}
use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class FilterTaskQueryTest method testTaskQueryByFollowUpBeforeOrNotExistent.
public void testTaskQueryByFollowUpBeforeOrNotExistent() {
// create query
TaskQueryImpl query = new TaskQueryImpl();
query.followUpBeforeOrNotExistent(testDate);
// save filter
filter.setQuery(query);
filterService.saveFilter(filter);
// fetch from db
filter = filterService.createTaskFilterQuery().singleResult();
// test query
query = filter.getQuery();
assertTrue(query.isFollowUpNullAccepted());
assertEquals(testDate, query.getFollowUpBefore());
}
use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class FilterTaskQueryTest method testTaskQueryCandidateGroupsExpressionIncludeAssignedTasks.
public void testTaskQueryCandidateGroupsExpressionIncludeAssignedTasks() {
TaskQueryImpl query = new TaskQueryImpl();
query.taskCandidateGroupInExpression(testString);
query.includeAssignedTasks();
saveQuery(query);
query = filterService.getFilter(filter.getId()).getQuery();
assertEquals(testString, query.getExpressions().get("taskCandidateGroupIn"));
assertTrue(query.isIncludeAssignedTasks());
}
use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class FilterTaskQueryTest method testOrderByVariables.
public void testOrderByVariables() {
// given
TaskQueryImpl query = (TaskQueryImpl) taskService.createTaskQuery().orderByProcessVariable("foo", ValueType.STRING).asc().orderByExecutionVariable("foo", ValueType.STRING).asc().orderByCaseInstanceVariable("foo", ValueType.STRING).asc().orderByCaseExecutionVariable("foo", ValueType.STRING).asc().orderByTaskVariable("foo", ValueType.STRING).asc();
Filter filter = filterService.newTaskFilter("extendedOrFilter");
filter.setQuery(query);
filterService.saveFilter(filter);
// when
filter = filterService.getFilter(filter.getId());
// then
List<QueryOrderingProperty> expectedOrderingProperties = new ArrayList<QueryOrderingProperty>(query.getOrderingProperties());
verifyOrderingProperties(expectedOrderingProperties, ((TaskQueryImpl) filter.getQuery()).getOrderingProperties());
for (QueryOrderingProperty prop : ((TaskQueryImpl) filter.getQuery()).getOrderingProperties()) {
assertTrue(prop instanceof VariableOrderProperty);
}
}
use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class FilterTaskQueryTest method testTaskQueryByFollowUpBeforeOrNotExistentExpressionExtendingQuery.
public void testTaskQueryByFollowUpBeforeOrNotExistentExpressionExtendingQuery() {
// create query
TaskQueryImpl query = new TaskQueryImpl();
query.followUpBeforeOrNotExistentExpression("${dateTime().withMillis(0)}");
// 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