@Override public PoolTask findByWorkflowIdAndEPerson(Context context, XmlWorkflowItem workflowItem, EPerson ePerson) throws SQLException, AuthorizeException, IOException { PoolTask poolTask = poolTaskDAO.findByWorkflowItemAndEPerson(context, workflowItem, ePerson); //If there is a pooltask for this eperson, return it if (poolTask != null) { return poolTask; } else { //If the user has a is processing or has finished the step for a workflowitem, there is no need to look // for pooltasks for one of his //groups because the user already has the task claimed if (inProgressUserService.findByWorkflowItemAndEPerson(context, workflowItem, ePerson) != null) { return null; } else { //If the user does not have a claimedtask yet, see whether one of the groups of the user has pooltasks //for this workflow item Set<Group> groups = groupService.allMemberGroupsSet(context, ePerson); for (Group group : groups) { poolTask = poolTaskDAO.findByWorkflowItemAndGroup(context, group, workflowItem); if (poolTask != null) { return poolTask; } } } } return null; }
Set<Group> groups = groupService.allMemberGroupsSet(context, currentUser); for (Group group : groups) { resourceQuery.append(" OR g").append(group.getID());