DirectoryManagerServiceClient dirClient = new DirectoryManagerServiceClient(clientFactory);
PrincipalSearchFilter psf = new PrincipalSearchFilter();
psf.setUserIdAbsolute(user.getUserName());
List<?> principalList = dirClient.findPrincipals(psf);
Iterator<?> pit = principalList.iterator();
User lcUser = null;
if (pit.hasNext())
lcUser = (User) (pit.next());
Set<Group> groupMemberships = lcUser.getGroupMemberships();
TaskSearchFilter taskSearchFilter = new TaskSearchFilter();
taskSearchFilter.addCondition(TaskSearchingConstants.pSTATUS,
new Operator("="), StatusFilter.assigned);
for (Group group : groupMemberships) {
if (!group.getCommonName().equals("Scanning Bureau")) {
taskSearchFilter.addCondition(
TaskSearchingConstants.pCURRENT_ASSIGNMENT_QUEUE_OWNER,
Operator.EQUALS, group.getCommonName(), Connective.OR);
}
}
taskSearchFilter.addSortDesc(TaskSearchingConstants.pPROCESS_START_TIME);
List<TaskRow> result = queryManager.taskSearch(taskSearchFilter);
ArrayList<WorkBasketItem> items = new ArrayList<WorkBasketItem>();
for (TaskRow taskRow : result) {
if (taskRow.getTaskStatus() >= 100)
continue;
if (!lcUser.getCommonName().equals(
taskRow.getCurrentAssignment().getQueueOwner())
// && !taskRow
// .getCurrentAssignment()
// .getQueueOwner()
// .startsWith("WFAG_")