7 Replies Latest reply on Oct 25, 2012 2:46 AM by Daniel Hernáez

    jBPM 5: how to remove or change a completed task?

    Daniel Hernáez Newbie

      let's see if you can give me a hand. Thanks in advance.

       

       

      I am developing a web application that manage invoices through a workflow with different states. I am using jBPM 5 for that purpose and the way I launch one specific invoice through workflow is next:

       

       

      getTaskService().activate(taskId, userId);

      getTaskService().claim(taskId, userId);

      getTaskService().start(taskId, userId);

      getTaskService().complete(taskId, userId, taskContentData);

      My problem is the fourth instruction and regards with transactionality. I have a utility class that performs operations once the invoice is processing through its workflow, and if this class throws and exception, the jBPM invoice task remains as 'Completed' when it shouldn't.

       

       

      My question is: how do I proceed in this situation? I want that 4 previous instructions go in only one transaction, or at least that task status doesn't change to 'Completed' if one exception arises, but this is controlled by jBPM and it doesn't seem easy. Should I try to change task status from 'Completed' to 'Created' again? Or make a new task with status 'Created'?