5 Replies Latest reply on Sep 15, 2006 10:23 AM by appendix

    Task assignment via pooled actor

      Hi,

      I do have an issue while trying to assign a task to an actor via the pooledTaskInstanceList.
      I'm facing a short process definition holding only a single task node and the usual start/end nodes. The definition is correctly deployed to the database. The task-node definition is straight forward:

       <task-node name="register patient" end-tasks="true">
       <task name="register patient" description="register patient">
       <assignment pooled-actors="admin" />
       </task>
       <transition name="done" to="goal reached"></transition>
       </task-node>
      

      Just for testing, I've implemented a form with a button for generating a processInstance from the definition and a <h:dataTable value="#{pooledTaskInstanceList}" var="task"/> showing all pooledTasks for the logged in user (set as actor).

      The user "admin" never sees the pooled task in the list, despite the database holds the correct entries:
      1) the task in the table jbpm_taskinstance
      2) jbpm_pooledactor is correctly set to "admin"
      3) jbpm_taskactorpool table links the two entries

      If the assignment is done without the pool with:
      <assignment actor-id="admin"/>
      the task shows up in the <h:dataTable value="#{taskInstanceList}" var="task"/> output.

      Am I missing something here or why is the task never in the list of pooledTasks?

      Thank you for the help in advance.

      Kurt



        • 1. Re: Task assignment via pooled actor

          Here's a follow-up to my previous post....
          I've started the debugger to look into PooledTaskInstanceList.getPooledTaskInstanceList() to see why the task is never assigned if the actorId is used instead of a group of the actor.

           public List<TaskInstance> getPooledTaskInstanceList()
           {
           List<TaskInstance> pooledTaskInstanceList = new ArrayList<TaskInstance>();
           Set<String> actorIds = Actor.instance().getGroupActorIds();
           for (String actorId: actorIds )
           {
           pooledTaskInstanceList.addAll( ManagedJbpmContext.instance().getTaskMgmtSession().findPooledTaskInstances(actorId) );
           }
           return pooledTaskInstanceList;
           }
          


          Please correct me if I'm wrong, but with this code there seems to be no assignment via the actorId itself. Just the groupIds of the actor are used, despite the userguide documentation (Chapter 16.4.26 assignment) states a different fact.

          Is the userguide outdated or do I miss something here? I'm using Seam 1.0.1.GA

          Thanks for any help.


          • 2. Re: Task assignment via pooled actor
            gavin.king

            Look at the DVD store example to see how to do this.

            • 3. Re: Task assignment via pooled actor

              Thank you Gavin for your answer.

              Looking at the process definitions in the DVD store example there are two different ways of assignment:
              1) pooled-actors="#{shipperAssignment.pooledActors}"
              2) pooled-actors="reviewers"

              As far as I understood both ways work via groups assigned to the actor (in LoginAction) and not the actorId itself as stated as possible in the documentation. Because I've tried this, this has been the initial question of my post.

              Ad 1)
              shipperAssignment.pooledActors returns a comma separated list of Ids, which I do understand as groupId's (because they match the groups assigned to the actor after login) and not the actorIds ("manager")

              Ad 2)
              "reviewers" is not an actorId, it's a groupId

              Maybe I'm missing a point, but I don't see any example of assigning a pooled task through an actorId.

              Again, thank you for sticking to the topic.

              Regards, Kurt

              • 4. Re: Task assignment via pooled actor
                gavin.king

                By *definition*, a pooled task is assigned to an actor id, not a group id!

                You assign a pooled task to a particular actor via the pooled task list.


                You can of course assign a task immediately to an actor id, but then it appears in the task list, not the pooled task list.

                • 5. Re: Task assignment via pooled actor

                  Hi Gavin,

                  thanks again for trying to clearify this issue.
                  I've read in the documentation that a pooled task is assigned to an actorId as well, but I've tried it with the very plain example (my initial post). Also the DVD store example is using a groupId [1] to get the task on the pooledTaskInstanceList.

                  Please don't get me wrong, I don't want to be picky! I just would like to understand, why the code from my initial post wouldn't get the task to the pooledTaskInstanceList (for the currently logged in user=actor="admin").

                  Have a great weekend!

                  Regards, Kurt


                  [1] snippet in LoginAction.login():

                  (actor.getGroupActorIds().add("reviewers");