Hi,
in the HTML WorkflowUI it done this way.
IQueryResult queryResult = ivy.session.findWorkTasks(null, PropertyOrder.create(TaskProperty.ID, OrderDirection.DESCENDING),
0, 25, true, EnumSet.of(TaskState.SUSPENDED, TaskState.RESUMED, TaskState.PARKED));
List<ITask> tasks = queryResult.getResultList();
out.tasks = tasks;
may be this helps.
regards
Roland