5 Replies Latest reply on Jul 6, 2008 3:39 PM by kukeltje

    special task assignment

    twiceknightly

      Hi,

      I need to define a process such that when I first enter a certain node it gets assigned to a group. Every time I enter it after that I wan't to assign it to whoever was assigned to the previous node (where it transitioned from to get to this node).

      Thanks!

        • 1. Re: special task assignment
          kukeltje

          where is something 'reassigned' to an individual?

          • 2. Re: special task assignment
            twiceknightly

            Imagine a process with a single node that transitions back into itself.

            Initially you want it assigned to a group so someone in that group can claim it (pull).

            When someone claims it in the UI you will reassign it to that individual outside of the process e.g. with calls to jbpm like

            getTaskForPooled ...
            taskInstance.setActorId
            (sorry cant remember the exact names of the API calls)

            That task will now be assigned to the individual. The problem is that once a transition is signalled in that task node the new task created will no longer be owned by that individual. Hence the need for a node to be assigned to a group initially and then assigned to "previous" afer that.

            • 3. Re: special task assignment
              kukeltje

              ok... clear... not sure what a swimlane will do in this case..... hmmm nice exercise for myself later on...

              You might split it up in two... one 'start task' and a loop... both with the same functionality.... keep the first task as is and you can assign the second task to the one that had the previous task with a specific assignmenthandler....

              now I think of it... you can also do this with a one task and a taskhandler. Just put the actor-id that picked the task up in a processvariable and have your assignment handler check for that. If it is there, assign to group AND individual (to later be able to reassign back in case of e.g. illness), if not, assign just to group

              • 4. Re: special task assignment
                twiceknightly

                Good idea kukeltje!

                I tried the following but it didn't work.

                1. A taskNode "A" assigned to a group with a transition to taskNode "B".
                2. A tasknode "B" with the assignment expression "previous".

                when the token got to taskNode "B" previous seemed to evaluate to NULL and fell over.

                • 5. Re: special task assignment
                  kukeltje

                  previous should be a processcvariable... is it?