-
1. Re: userGroupCallback : getGroupTaskList
roxy1987 Feb 14, 2013 10:00 AM (in response to joploya)Sandra,
The group task thing troubled me a lot too.
I dont know whats wrong with your impl but this is what I do :
//Connect the task handler BlockingTaskSummaryResponseHandler summaryHandler = new BlockingTaskSummaryResponseHandler(); ArrayList<Object> groupTaskDetail = new ArrayList<Object>(); List<TaskSummary> tasks = null; List<String> groups = getGroupsForUser(userId); // Get the group IDs for the target user.. client.getTasksAssignedAsPotentialOwner(userId, groups, "en-UK", summaryHandler); tasks = summaryHandler.getResults();
Regards.
-
2. Re: userGroupCallback : getGroupTaskList
joploya Mar 20, 2013 4:07 AM (in response to roxy1987)Finally, I resolved my problem by adding the userId in the groupList so this list is never empty. (Even if the userId correspond to a groupId)
/**
* Returns list of group ids for specified user id.
*
* @param userId the user id assigned to the task
* @param groupIds list of group ids assigned to the task
* @param allExistingGroupIds list of all currently known group ids
*
* @return List of group ids.
*/
@Override
public List<String> getGroupsForUser(String userId, List<String> groupIds, List<String> allExistingGroupIds) {
logger.debug("Get groups for user "+userId);
List<String> userGroups = new ArrayList<>();
//To avoid an error inside the named request of human task, always add the userId inside group list
userGroups.add(userId);
User user = getLdapUser(userId);
if(user != null){
userGroups.addAll(user.getGroups());
}
return userGroups;
}
Regards.