5 Replies Latest reply on Nov 22, 2006 12:18 AM by adsf adsf

    Question regarding jBPM and Actor assignment

    adsf adsf Newbie

      Am I correct by saying that the 'pooledTaskInstanceList' shows all tasks who currently don't have an assigned actor and to which the current actor can be assigned?
      Further the 'taskInstanceList' and the 'taskInstanceListForType' show all tasks to which the current actor is assigned (the later with the additional constraint of a current processing state)?

      If this is correct how am i supposed to assign a certain actor to a certain task (I'm missing a assignTo(String actorId) in the PooledTask class)?

      And can I retire from a process after finishing a task? I.e. - in the context of the DVD store orderManagement3 process - the admin in his role of a reviewer approves the order and then wants to resign to return the task to the pooledTaskInstanceList so a shipper - ~ some other employee - can assign himself to the shipping part of the process. Can I retire from a process by assigning it to null and if i do that is the current process state preserved while it is in the taskpool waiting?

      It would be great if someone could enlighten me.

      Thanks a lot in advance.

        • 1. Re: Question regarding jBPM and Actor assignment
          Gavin King Master

          Correct on both.

          Use the pooledTask component to do assignments (check the DVD store for an example).

          Your use case is actually 2 different tasks. The approving the order ends the task, and a new task is created for the shipment. An EL value binding in the process definition does the assignment of the new task.

          • 2. Re: Question regarding jBPM and Actor assignment
            adsf adsf Newbie

            Thank you for your answer Gavin.

            In the pooledTask component there's only a method to assign the current actor to a task ('assignToCurrentActor()'). Therefore: can we please have a 'assignToActor(String actorId)' method in the pooledTask component - i.e. for a supervisor to assign tasks to his subordinates?!

            The 2nd part I probably didn't express clearly. I know that this are two different tasks. The reason I'm asking is because, when the process starts, I have to 'assign' myself to it to move it from the 'pooledTaskInstanceList' to the 'taskInstanceListForType['approve']' list. But, when i approve the task, it's automatically moved to the taskInstanceListForType['ship'].
            Therefore I'm assuming that this process is still assigned to me, which means that it wont show up in the 'pooledTaskInstanceList' of other people - as far as I understand it, correct me please if this is wrong.

            Now what i want to do is to 'retire' from the process after I finished the 'approve' task so this process shows up in the 'pooledTaskInstanceList' of other people so they can finish the process. How is this 'retiring' possible?

            • 3. Re: Question regarding jBPM and Actor assignment
              adsf adsf Newbie

              Shame on me I mixed it up (perhaps because it's 5am)!

              The 2nd part is perfectly clear now, I have to assign myself too for the shipping task.

              Sorry for wasting your time.




              But i would really love to get a 'PooledTask.assignToActor(String actorId)' method - IMHO it would be very usefull.

              • 4. Re: Question regarding jBPM and Actor assignment
                Gavin King Master

                To assign the new task to yourself, you just do <assignment actor-id="#{actor.id}"/>

                Or, to assign it to someone else, outject subordinateActorId, and use <assignment actor-id="#{subordinateActorId}"/>


                To reassign a task you can use

                @In JbpmContext jbpmContext;
                ...
                jbpmContext.getTaskMgmtSession().loadTaskInstance(taskId).assign(subordinateActorId);



                But, just especially for you, I added a couple of new methods to the PooledTask class, so you can do it that way if you prefer.


                • 5. Re: Question regarding jBPM and Actor assignment
                  adsf adsf Newbie

                  Thank you very much Gavin, much appreciated :)

                  PS: I never thought of the possibility to outject the new actorId. Although I still have to get used to think this way it's just another proof how damn sweet this concept is.