5 Replies Latest reply on Aug 6, 2007 9:59 AM by tinico

    Assignment mechanism

      Hi all,

      I currently try the jBPM solution for my company !! I've a conceptual question that I can't resolve whereas I've reading all the documentation !!

      1 - If a task assignment depend the task before assignment ?? How can I do ??

      I explain, if a task concist to send demand to the responsable of a user group, the next taskInstance assignment depend to the current task actor...

      Currently, I store the actorID in the contextInstance and I've made a assignmentHendler on the next taskInstance... The handler retreive the user of the task before, and assign the new task to his chef (or responsable)...

      I think this is not the good way to do that... Can you say how do that properly ?? Thank you !!

      2 - A user can have more than one responsable (if he iss in more than 1 group)... So, how can do to create one validation task by responsable ?? (I think it's by an actionHandler but I need confirmation to do that properly !!) THANKS !!! :)

        • 1. Re: Assignment mechanism
          kukeltje

           

          I think this is not the good way to do that... Can you say how do that properly ??
          I would do it this way to.

          I do not get your second question

          • 2. Re: Assignment mechanism
            vtysh

            1 related: You can specify variable in model which will contain name of task from where to get an actor id in your assignment handler.

            <assignment class="your.handler">
             <taskName>myTask</taskName>
            </assignment>
            

            Then in assign method you should process all previous task instances with name equals to taskName variable value.
            executionContext.getTaskMgmtInstance().getTaskInstances();
            //iterate though task instances
            ...
            if(taskInstance.getName().equals(taskName)
            {
             //check whether it is a newer task instance than previous one
             //and store actor to some variable if it is
             ...
            }
            

            In case of usage of this method you will not need any additional contextInstance variables, and imho you will get more flexible handler which can be used for different nodes of various models.

            • 3. Re: Assignment mechanism

              Thank you for your answer !!

              vtysh, your solution is good but we have to process all taskInstance, I'm affraid it take to much time !! But the idea is good I've test it !!

              Is someone have another idea or can answered to my second question ??

              Thanks !! :)

              • 4. Re: Assignment mechanism
                vtysh

                If you afraid about time of performance you can write your own hql query and retrieve only tasks with name equals to taskName for current process instance. But i think performance will be enough for not very large databases.

                • 5. Re: Assignment mechanism

                  if their is 500 tasks created before, it process all this instance, it can be too long... But I try it, and, it work !! :)

                  I've now two solution to do that, is there others ??

                  Thank you very much vtysh !! If there isn't other idea, I think this is yours that I'll used !! :)