4 Replies Latest reply on Jul 19, 2010 2:16 AM by Maciej Swiderski

    Rejection from task to previous tasks

    Jim Imbrogno Newbie

      Hello,

       

      We are trying to implement an ordering system where there a series of tasks. There is a need for us to be able to allow the current task owner to reject the order to state of any of the previously executed tasks. Is there a way to do this in JBPM without having to create transitions for each permutation and combination? Thanks in advance.

       

      Jim.

        • 1. Re: Rejection from task to previous tasks
          Maciej Swiderski Master

          So how would the user choose the state (which activity execution should go to) without defined transition on the task?

          • 2. Re: Rejection from task to previous tasks
            Jim Imbrogno Newbie

            In this use case, the user would have access to reject to any of the previously completed tasks. E.g. if we have a simple workflow like the following..

             

            Start --> Task A --> Task B --> Task C --> Task D --> Stop

             

            A user who is working on Task C should be given an option to reject to both Task A or Task B for the respective group to re-work the tasks and continue the flow from there.

            • 3. Re: Rejection from task to previous tasks
              HuiSheng Xu Master

              Hi Jim,

               

              The rollback feature is very hard to implement in process engine,  because there would be too many situations to consider about.  If it is necessary in your project, you could achieve this feature by yourself.

               

              First get related task.  cast it from Task to TaskImpl.  invoke taskImpl.setSignalling(false); and completeTask(taskImpl.getId())

               

              Second find the target activity.  you could use processDefinition.getActivity(activityName).

               

              Third move execution to target activity. execution.moveTo(activity);

               

              At last create new task, by invoking activity.getActivityBehaviour().execute(execute);

              • 4. Re: Rejection from task to previous tasks
                Maciej Swiderski Master

                I think using transitions it is not as bad idea as it looks. Since either way you need to define the flows to give user correct options. With transitions you have it by default.

                Of course you can do what HuiSheng described but in general using *Impl classes is not recommended.

                1 of 1 people found this helpful