use of org.activiti.engine.task.TaskQuery in project Activiti by Activiti.
the class MultiInstanceTest method testSequentialSubProcessEndEvent.
@Deployment
public void testSequentialSubProcessEndEvent() {
// ACT-1185: end-event in subprocess causes inactivated execution
String procId = runtimeService.startProcessInstanceByKey("miSequentialSubprocess").getId();
TaskQuery query = taskService.createTaskQuery().orderByTaskName().asc();
for (int i = 0; i < 4; i++) {
List<Task> tasks = query.list();
assertEquals(1, tasks.size());
assertEquals("task one", tasks.get(0).getName());
taskService.complete(tasks.get(0).getId());
// Last run, the execution no longer exists
if (i != 3) {
List<String> activities = runtimeService.getActiveActivityIds(procId);
assertNotNull(activities);
assertEquals(1, activities.size());
}
}
assertProcessEnded(procId);
}
use of org.activiti.engine.task.TaskQuery in project midpoint by Evolveum.
the class WorkItemProvider method searchWorkItems.
public SearchResultList<WorkItemType> searchWorkItems(ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> options, OperationResult result) throws SchemaException {
TaskQuery taskQuery = createTaskQuery(query, true, options, result);
if (taskQuery == null) {
return new SearchResultList<>(Collections.emptyList());
}
Integer offset = query != null ? query.getOffset() : null;
Integer maxSize = query != null ? query.getMaxSize() : null;
List<Task> tasks;
if (offset == null && maxSize == null) {
tasks = taskQuery.list();
} else {
tasks = taskQuery.listPage(defaultIfNull(offset, 0), defaultIfNull(maxSize, Integer.MAX_VALUE));
}
// TODO implement based on options
boolean getAllVariables = true;
// there's no need to fill-in assignee details ; but candidates are necessary to fill-in; TODO implement based on options (resolve)
return tasksToWorkItems(tasks, null, false, false, true, getAllVariables, result);
}
Aggregations