1 2 Previous Next 17 Replies Latest reply on Nov 8, 2006 8:21 AM by coolfish007

    Assign Task - 2 users

    send2shriram

      Hi,

      I want a task to be created to two users. I am unable to find any
      JBPM API's for this. Any help would be useful.

      Thanks
      Shriram

        • 1. Re: Assign Task - 2 users
          hannes

          keyword: PooledActor

          • 2. Re: Assign Task - 2 users
            send2shriram

            Hi ,

            Using PooledActor also doesn;t seems to solve the problem as
            it first assigns to a pool of actors ,and then only one user (from the pool) can reassign the task.

            Any workaround/information/suggestion/help from the JBPM authors and others would be helpful.


            Thanks
            Shriram

            • 3. Re: Assign Task - 2 users
              saviola

              Hi, send2shiraram!
              If pooledActor doesn't work then why don't you create two tasks - one for each user?

              Saviola

              • 4. Re: Assign Task - 2 users
                send2shriram

                Hi Saviola,

                Thanks for your reply.

                I want one task to be created, and both the users must be assigned to it.
                So that, any of the two can take on the task and act upon it.

                I tried with PooledActor, as follows; Please correct me if iam wrong.

                assignable.setPooledActor("User1","User2","User3")
                It initially set the task's ActorID to null but the JBPM_POOLEDACTOR table has reference to the 3 users assigned above.

                From here, i can do reAssign the task to either of the User1,User2,User3.
                by assignable.setActorId("User1");
                will update the task's ActorID to User1.

                This doesn;t solve my problem of assigning two users to same task.
                Is there a way in PooledActor where we can assign to two users a same task. Is my understanding of PooledActor is correct ?


                Thanks Again !!!!
                Shriram

                • 5. Re: Assign Task - 2 users
                  saviola

                  Hi, again Shiraram!
                  Here what the jBPM documentation says about the sense of pooled actors:

                  To assign a TaskInstance to a pool of candidate actors, call Assignable.setPooledActors(String[] actorIds).

                  According to what i've seen in the forum about this concept pooled actors are the
                  "future possible"
                  actors who would have been performing particular task or assigned to a particular swimlane instance.(Was that clear enough :( ?) When it comes to the moment when the actual actor is clear it is set through
                  setActorId(String actorId)
                  method.
                  I think that it is rather not possible to actually assign one task to more than one actor simultaneously.
                  What do you think, jBPM team members?

                  Regards,
                  Saviola

                  • 6. Re: Assign Task - 2 users
                    send2shriram

                    Hi Saviola,

                    Thanks Again :)- for your reply.

                    Can anybody from the JBPM team can clarify about this
                    assigning task to two actors simultaneously...

                    Please !!!!.


                    Thanks
                    Shriram

                    • 7. Re: Assign Task - 2 users
                      kukeltje

                      Shiram,

                      You want:

                      I want one task to be created, and both the users must be assigned to it.
                      So that, any of the two can take on the task and act upon it.


                      You say pooled actors does:
                      Using PooledActor also doesn;t seems to solve the problem as
                      it first assigns to a pool of actors ,and then only one user (from the pool) can reassign the task.


                      reassign here meaning to himself, so acting upon it.

                      I do not realy see the difference between what you want and what pooled actors does.

                      If I miss something, please clarify.

                      Ronald




                      • 8. Re: Assign Task - 2 users
                        send2shriram

                        Hi ronald,

                        Thanks for the reply.

                        ok... i will refrain my question as follows;

                        I want a task to be assigned to two actors.

                        Q1. how can i implement this?
                        Q2. you would have seen my implementation of PooledActors in
                        the previous mails. Was that correct ?
                        Q3. Please clarify PooledActors concept if my previos mail understanding
                        about it was wrong?
                        Q4. will PooledActors will be able to solve the problem, if so
                        could u please explain it?

                        Thanks in Adv
                        Shriram

                        • 9. Re: Assign Task - 2 users
                          lucianovc1

                          hi Shriram and others,
                          I've been trying to do the same thing: to assign the same task instance to more than one user, and up to now i do not succeed either.

                          What I did:
                          1- created a group 'g1' whose members are 'user1' and 'user2'.
                          2- I put in the task definition the element


                          In this way it should assign the task instances to the pooledactors defined by the statement below, but it does not work.

                          I also tried to put the same statement in the swimlane element of process definition.

                          if anyone get this done, let us to know.

                          thanks
                          Luciano

                          • 10. Re: Assign Task - 2 users
                            send2shriram

                            Hi all,

                            if anyone know how to assign a task to 2 users , please let us all know.

                            I would lik to hear atleast some answers from JBPM team...

                            Thanks
                            Shriram

                            • 11. Re: Assign Task - 2 users
                              kukeltje

                               

                              "send2shriram" wrote:

                              Q1. how can i implement this?

                              Look at the org.jbpm.taskmgmt.TaskAssignmentTest.java. Lots of examples there

                              "send2shriram" wrote:

                              Q2. you would have seen my implementation of PooledActors in
                              the previous mails. Was that correct ?

                              There was not a full implementation in the post, just some lines. From that I cannot see if it is good or wrong.

                              "send2shriram" wrote:

                              Q3. Please clarify PooledActors concept if my previos mail understanding
                              about it was wrong?

                              See the test code above.

                              "send2shriram" wrote:

                              Q4. will PooledActors will be able to solve the problem, if so
                              could u please explain it?

                              See the test code above

                              Ronald

                              • 12. Re: Assign Task - 2 users
                                kukeltje

                                 

                                "send2shriram" wrote:
                                Hi all,

                                if anyone know how to assign a task to 2 users , please let us all know.

                                I would lik to hear atleast some answers from JBPM team...

                                Thanks
                                Shriram


                                I am 'part' of the jBPM team, see http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmTeam

                                • 13. Re: Assign Task - 2 users
                                  tmarafon

                                  If I want to assign a task for only 2 people, do I have to create a group for them? Do I need to create an Assignment class for this??

                                  Isn't there an easier way like:

                                  <swimlane name="Swimlane1">
                                   <assignment expression="user(John)"></assignment>
                                   <assignment expression="user(Mary)"></assignment>
                                  </swimlane>


                                  or

                                  <swimlane name="Swimlane1">
                                   <assignment expression=pooledActors("John","Mary")></assignment>
                                  </swimlane>


                                  Using something like this, would become easier to create an GUI to edit task assignments.


                                  • 14. Re: Assign Task - 2 users
                                    jainer

                                     

                                    <swimlane name="revisor">
                                     <assignment class="com.factura.handler.Asigna"></assignment>
                                     </swimlane>
                                    


                                     <task-node name="proyecto">
                                     <task name="revision proyecto" swimlane="revisor">...
                                    


                                    package com.factura.handler;
                                    
                                    
                                    import org.jbpm.graph.exe.ExecutionContext;
                                    import org.jbpm.taskmgmt.def.AssignmentHandler;
                                    import org.jbpm.taskmgmt.exe.Assignable;
                                    
                                    public class Asigna implements AssignmentHandler{
                                    
                                     final static long serialVersionUID = 1L;
                                    
                                     public void assign(Assignable assignable, ExecutionContext executionContext){
                                     assignable.setPooledActors(new String[]{"faber aristizabal", "luis mantilla"});
                                     }
                                    }
                                    


                                    I'M SURE THAT IT WORKS!!!!!!!

                                    jainer e.

                                    1 2 Previous Next