1 Reply Latest reply on May 11, 2006 2:58 AM by kukeltje

    getGroupTaskList not returning task for user assigned tasks

    hosierdm

      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:
      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.