1 2 Previous Next 15 Replies Latest reply on Apr 13, 2010 1:03 AM by rebody

    How to assignee this tasks?

      Hi,

       

       

         My problem is:

       

         I have an application form (in jsp) and where ever it is submitted to the server, a new processInstance is generated.

         After processInstance is generated, there are two tasks 1) Assignee to & 2) Cancellation of generated ProcessInstance.

       

        I am using jbpm4.3 with tomcat 6.0  and Oracle as database

       

         Based upon user type, his task list should show like:

       

         If usertype is MEMBER then whenever he submits application, he should be able to cancel the generated ProcessInstance for his application. and at      same time ADMIN user should get a task like Assignee to that application some body.

       

        if User type is ADMIN then whenever he submits application, he should be able to cancel the generated ProcessInstance for his application. and at      same time, he should get a task like Assignee to that application some body.

       

        How to assignee this tasks?

       

        i am able to perform only one thing i.e a user submits application, he is able to cancel the generated ProcessInstance for his application. but unable to assignee the task for Admin at the same time with name Assignee to

       

       

        Can any provide me some pointers on how to proceed further in this problem.

       

        Thanks in advance

        • 1. Re: How to assignee this tasks?

          Hello,

          taskList = taskService.findPersonalTasks(userId);
          taking into account that userId is registered in the user type that you want and the task jPDL is assigned to a group candidate-groups="USERTYPE"
          check out the taskService API for more info.
          regards,
          Rudolf Michael
          • 2. Re: How to assignee this tasks?
            rebody

            Hi Anand,

              I make a simple process defintion, and upload it into attach, you could download and have a look at whether it is what you want.

            cheers

            • 3. Re: How to assignee this tasks?

              Thank you for your reply

               

              As you said Rudolf Michael, i can create candidate-groups but when more than one user submit the application then for each processInstance user will have only cancellation as task list but admin should have all the the processInstances for all submitted application.. how should i have to do this?

               

              But at the same time user may have some other tasks also then how ?

              as well Admin can also have some other task too then ...

               

              But here i have display the same Task in the Admin User list as well as for User list also for he same processInstance that was started by submitting the application by normal user but with different name as:

              in Admin ------ Assignee To and in the User ----- Cancellation , at same point of time.

              • 4. Re: How to assignee this tasks?

                Thank you for your reply and simple process defintion  Huisheng Xu

                 

                  but this does not suit as per my requirements here: As you are creating a fork at the starting, there might be a case where a user submits application   but before it gets assigned to anybody by Admin, he can withdraw the application then both the User as well as Admin task should be get deleted.

                  Then how to do this ?

                 

                  Here i have created rough a process defintion file which is more over what i need and this might help you to understand my problem much better.

                But here i am able to assignee one task only.

                • 5. Re: How to assignee this tasks?
                  rebody

                  Hi Anand,

                    Do you mean that if one of forked execution being removed, the processInstance can not be removed?

                   

                    If you use default configuration and do not change ends attribute of  end activity to 'execution', the end activity will terminal the whole process instance.

                  • 6. Re: How to assignee this tasks?

                    Thank you once again for your reply Huisheng Xu  ,

                      Do you mean that if one of forked execution being removed, the processInstance can not be removed?

                        I could not get you, as you created a fork, then there will be two processInstance and when User who applys want to cancel his application before being it get assigned to any other user by Admin, the two processInstance should get deleted and if it gets assigned the there should only one processInstance

                      If you use default configuration and do not change ends attribute of  end activity to 'execution', the end activity will terminal the whole process instance.

                      I really could not get you, can you explain more on this also.

                    • 7. Re: How to assignee this tasks?
                      rebody

                      Hi Anand,

                        I think what you want to do is sending message between different branches of process instance. If ADMIN have not assign the task to a employee, the starter of process instance could have a chance to end the process instance. But if ADMIN is already assign the task to a emloyee, the starter of process instance could not cancel the process instance any more. Do you mean that?

                       

                        Actually there is no way to send message from a branch of process instance to another one. If you use my process sample showing above, No matter what the ADMIN do, the starter could always terminal the whole process instance.

                       

                      I think you should find a way to create a task to the starter dynamicly and listening the ADMIN's assigning behaviour, if ADMIN already assign the task to other person, you have delete the starter's task.

                       

                        Execute me, If I can't make it more clearly. I am keeping practising.

                      • 8. Re: How to assignee this tasks?
                        swiderski.maciej

                        Perhaps you could extend your sample with additional join at the end. Join should continue flow as soon as one of the actors complete the task. If admin will assign task to a employee flow will move on and cancellation will not be possible any more (in other words will not affect the flow).

                         

                        /Maciej

                        • 9. Re: How to assignee this tasks?

                          Thank you once again for your reply Huisheng Xu,

                            I think what you want to do is sending message between different branches of process instance. If ADMIN have not assign the task to a employee, the starter of process instance could have a chance to end the process instance. But if ADMIN is already assign the task to a emloyee, the starter of process instance could not cancel the process instance any more. Do you mean that?

                          Yes i mean what you said above..

                           

                          Then how should i can proceed further ??

                          • 10. Re: How to assignee this tasks?
                            rebody

                            Hi Anand,

                              There is truely no way to implement this feature using jBPM directly. You have to make some extension.

                            • 11. Re: How to assignee this tasks?
                              swiderski.maciej

                              One way could be to use process/task variables as kind of messaging between branches of the process. If admin assigned a task to an employee then process or task variables can prevent of canceling the process by the starter actor.

                              • 12. Re: How to assignee this tasks?

                                Thanks you Once again for your reply Huisheng Xu ,

                                 

                                   As you said there is no way to send message from a branch of ProcessInstance to another one then

                                 

                                   How can the starter could always terminate the whole processInstance even after it is forked?

                                 

                                  How can i keep track of the child processInstance which are created by fork?

                                • 13. Re: How to assignee this tasks?
                                  rebody

                                  Hi Anand,

                                    If you have a look at the source of EndActivity, you will find out the default behaviour of EndActivity will terminate the whole processInstance. So the forked executions of process instance will be deleted cascade.

                                   

                                    I think you could try what Maciej said, using variable to decide whether starter could cancel the process instance.

                                   

                                    At this moment, I am studying BPEL, the different between BPEL and jPDL is jPDL hasn't a scope for activities, so we will find it is hard to do something should be done in a scope by jPDL. Maybe we could use sub-process to emulate a scope.

                                  • 14. Re: How to assignee this tasks?

                                    Thank you once again

                                     

                                      Last thing i would like to ask is how to keep track of child processInstance which are created by the fork?

                                     

                                      How can i get parent PID from the child process here and what are the active child processes of a parent ??

                                    1 2 Previous Next