public List<BpmTask> findFilteredTasks(ProcessInstanceFilter filter, ProcessToolContext ctx, int resultOffset, int maxResults) {
return findProcessTasksHelper(filter, ctx, new Page(resultOffset, maxResults));
}
private List<BpmTask> findProcessTasksHelper(ProcessInstanceFilter filter, ProcessToolContext ctx, final Page page) {
final TaskQueryImplEnhanced q = new TaskQueryImplEnhanced();
for (UserData u : filter.getOwners()) {
q.addOwner(u.getLogin());
}
for (UserData u : filter.getCreators()) {
q.addCreator(u.getLogin());
}
// TODO
// for (UserData u : filter.getNotOwners()) {
// q.addNotOwner(u.getLogin());
// }
for (String qn : filter.getQueues()) {
q.addGroup(qn);
}
ActivitiContextFactoryImpl.CustomStandaloneProcessEngineConfiguration processEngineConfiguration = getProcessEngineConfiguration();
CommandExecutor commandExecutorTxRequired = processEngineConfiguration.getCommandExecutorTxRequired();
List<Task> tasks = commandExecutorTxRequired.execute(new Command<List<Task>>() {