3 Replies Latest reply on Nov 28, 2014 1:41 AM by swiderski.maciej

    Advanced Abort policies

    lauradp

      Hello everybody,

      I'm wirting a jBpm process where some task only write logs and are very generic. I don't know what to do if an abort is required while these tasks are running, only the following tasks knows that.

      I'd like to know If I can write an abortWorkItem(WorkItem workItem, WorkItemManager manager) method that delegates abort job to the same method of the task that follows the current one in the process.

       

      Can anyone help me?

       

      Laura

        • 1. Re: Advanced Abort policies
          swiderski.maciej

          not really understand what you're trying to achieve. Could you please give an example.

          • 2. Re: Advanced Abort policies
            lauradp

            Hi,

            Maciej.

            Suppose you have such a flow:

            Start -> A(1) -> B -> A(2) -> C -> A(3)-> End

             

             

            If an abort is requested while process is running workitems B or C the method abortWorkItem of these methods knows how to roll-back what have been done in the process. Task A is used three times, and I don't know how to rollback process, because it depends by when abort is requested, i.e. if ana bort is requested when process is in A(2) the abortWorkItem method of C-workItemHnadler is good for A(2) too.

            In other words I need to suspend abort request until process reachs a step such as B or C.

             

            Laura

            • 3. Re: Advanced Abort policies
              swiderski.maciej

              alright, then why you split that logic across work items? Would it be better to use boundary events or even subprocess that would listen for given type of errors and then handle it? That way you could have event subprocess to handle different types of errors instead of work item B and C that do special logic to rollback.

               

              HTH