6 Replies Latest reply on Aug 9, 2011 1:39 PM by swiderski.maciej

    how to reject a task to the previous task instance?

    trh3037

      In a sequence of user tasks, a user may reject a task at node #2 to node #1 .

      I need  the same  #1 task instance executed again and allowing the person to modify the information that was created there,not create a new  task instance.

      Does jBPM5 support the following scenarios?

        • 1. Re: how to reject a task to the previous task instance?
          trh3037

          the process like this: start-> node1->node2->end;

           

          not start->node1->node2->gateway->end;

                                                            ->node1;

          I need the previous task instance,not the new node1 instance.

           

          Does anyone tell me how to resolve the question?

          • 2. Re: how to reject a task to the previous task instance?
            mariemm

            Do you really need the same task instance?

            Or just task which has same data as node1? I would you gateway and loop afterward to node1 which creates another instance of it.

            • 3. Re: how to reject a task to the previous task instance?
              trh3037

              If i create another instance , when query the history task instance for the user, the results will contain multiple same task.

              • 4. Re: how to reject a task to the previous task instance?
                mariemm

                That's right.

                We are also thinking how to do this kind of processes, but we also want to keep log what was changes, so we don't mind multiple same task.

                 

                Eg. node1 set to value A, then rejected, node1 set to value B, again rejected, node1 set to C and accepted. Process finished.

                Then the history show what was changed when, which is ok for us:

                user X set value A on 1.1.2011

                reject by Z on 1.1.2011

                user X set value B on 2.1.2011

                rejected by Z on 2.1.2011

                user X set value C on 3.1.2011

                accepted by Z on 3.1.2011

                 

                I think there is no posibility to open same instance of task - which would mean change of status from Completed to Ready.

                 

                Let us know if you find some nice solution.

                • 5. Re: how to reject a task to the previous task instance?
                  calca

                  I think Marie is right, according to the task life cycle, http://docs.jboss.org/jbpm/v5.1/userguide/ch.Human_Tasks.html#d0e3368, you won't be able to make this. When a human task is completed, you can't go to uncomplete it, you have to complete a new task instance. You could make some hack, changing manually the task in the db?, and something with the task work item, but in my opinion it would not make sense.

                   

                  Would not filtering the history query for multiple instances?

                   

                  Regards,

                   

                  Demian

                  • 6. Re: how to reject a task to the previous task instance?
                    swiderski.maciej

                    You could make use of human task life cycle operations - other than the most common. Depending on your scenario you could either user forward or delegate. That of course would change you process a bit, meaning you will have only one task node that once it is done by the first actor, it could be delegated to the other actor for review instead of completing it if you want to operate on the same task instance. The other person could either approve it and move on with the process flow or return it back to the previous assignee.

                    For more details take a look at task service section of the documentation, especially task client api.

                     

                    Unfortunately you will not be able to utilize console for that, it does not cover all the task life cycle operations, afaik.

                     

                    Would that make your case?