0 Replies Latest reply on Dec 14, 2009 6:37 PM by Jason E

    dvdstore example app does not rollback jbpm task

    Jason E Newbie
      I have made a simple change to the ShipAction.java class in the dvdstore example that ships with Seam.  Here is the change

      //@EndTask
      public String ship() {
          order.ship(track);

          TaskInstance ti = ManagedJbpmContext.instance().getTaskInstance(taskInstance.getId());
          taskInstance.end();

          if(true) throw new RuntimeException("TESTING");

          return "admin";
      }

      I commented out the end task annotation and I am ending the task via the TaskInstance API.  When I throw the Runtime exception the changes to the ORDERS entity bean (i.e. updating the tracking number) rolls back.  The problem is that the task instance change (i.e. ending the task) does not rollback.  It appears that jBPM is flushing its changes in the db transaction associated with the RENDER_VIEW phase of the JSF lifecycle.  Thus, the first transaction associated with Seam's global transaction rolls back, but the second transaction in the RENDER_VIEW phase does the jBPM flushing and does not know about the rollback.  What I want is for the ending of the jBPM task to rollback.

      Thanks!

      Jason