I'm trying to play with the Identity module by assigning tasks to groups in my 
process definition.  I modified the webapp to assign a task to a specific user 
after they click on the link to start the task.  I initially changed the 
getTaskInstances() method to read as follows:
IdentitySession idSession = new IdentitySession(jbpmContext.getSession());
  | User user = idSession.getUserByName(userBean.getUserName());
  | Set memberships = user.getMemberships();
  | ArrayList userAndGroups = new ArrayList();
  | userAndGroups.add(userBean.getUserName());
  | for (Iterator it = memberships.iterator(); it.hasNext(); )
  | {
  |   Membership membership = (Membership)it.next();
  |   Group group = membership.getGroup();
  |   userAndGroups.add(group.getName());
  | }
  | System.out.println("LOOKING FOR TASKS FOR ACTORIDS: " + userAndGroups);
  | return jbpmContext.getGroupTaskList(userAndGroups);
  | 

The javadoc for the getGroupTaskList() method states:
anonymous wrote : Typically, for an actor, his/her personal actorId plus all 
the actorIds representing the groups that person belongs to form the actorIds.

I can see a task assigned to a certain group when logged in as every member of 
that group.  However, when I start the task and assign it to the specific user, 
even that specific user does not get that task in his list (i.e. 
getGroupTaskList() does not appear to return tasks for specific users, contrary 
to the javadoc).  Changing the last line of the above code by adding the 
following lines gives me what I want:
List groupTasks = jbpmContext.getGroupTaskList(userAndGroups);
  | 
groupTasks.addAll(taskMgmtSession.findTaskInstances(userBean.getUserName()));
  | return groupTasks;
  | 
Is the javadoc mistaken in its description of the getGroupTaskList() method?  
Am I misreading it?  Is there a bug? Or is it none of the above?  I did a 
search for getGroupTaskList both here and in JIRA and was not able to find any 
mention of any problems.  Thanks.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3942782#3942782

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3942782


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to