use of org.camunda.bpm.engine.rest.dto.task.TaskQueryDto in project camunda-bpm-platform by camunda.
the class TaskRestServiceImpl method getHalTasks.
public HalTaskList getHalTasks(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
TaskQueryDto queryDto = new TaskQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
ProcessEngine engine = getProcessEngine();
TaskQuery query = queryDto.toQuery(engine);
// get list of tasks
List<Task> matchingTasks = executeTaskQuery(firstResult, maxResults, query);
// get total count
long count = query.count();
return HalTaskList.generate(matchingTasks, count, engine);
}
use of org.camunda.bpm.engine.rest.dto.task.TaskQueryDto in project camunda-bpm-platform by camunda.
the class TaskRestServiceQueryTest method testOrQuery.
@Test
public void testOrQuery() {
TaskQueryDto queryDto = TaskQueryDto.fromQuery(new TaskQueryImpl().or().taskName(MockProvider.EXAMPLE_TASK_NAME).taskDescription(MockProvider.EXAMPLE_TASK_DESCRIPTION).endOr());
given().contentType(POST_JSON_CONTENT_TYPE).header(ACCEPT_JSON_HEADER).body(queryDto).then().expect().statusCode(Status.OK.getStatusCode()).when().post(TASK_QUERY_URL);
ArgumentCaptor<TaskQueryImpl> argument = ArgumentCaptor.forClass(TaskQueryImpl.class);
verify(((TaskQueryImpl) mockQuery)).addOrQuery(argument.capture());
assertEquals(MockProvider.EXAMPLE_TASK_NAME, argument.getValue().getName());
assertEquals(MockProvider.EXAMPLE_TASK_DESCRIPTION, argument.getValue().getDescription());
}
Aggregations