1 Reply Latest reply on Aug 1, 2008 7:27 AM by kukeltje

    tasks lost in flight when exception occurs

    gnagy

      In the process of getting rid of the seemingly deprecated gravel and j4j dependency, we moved task transitions to seam component action methods, like this:


      public String transit(TaskInstance taskInstance, String transitionName) {

      JbpmContext context = ManagedJbpmContext.instance();
      // without this, LazyInitializationException occurs
      taskInstance = context.getTaskInstanceForUpdate(taskInstance.getId());
      taskInstance.end(transitionName);

      return "success";
      }


      Before we used:

      <h:commandLink>
      <4j:loadTask id="#{taskInstance.id}" target="#{j4jtask}"/>
      <j4j:completeTask task="#{j4jtask}" transition="#{transition.name}"/>
      <h:outputText value="#{transition.name}"/>
      </h:commandLink>


      We have some event actions on tasks (calling methods on seam components), and when an exception occurs there, the task is lost from our task list.

      The task list is rendered as follows:
      <ui:repeat var="taskInstance" value="#{taskInstanceList}">...

      Looking at the db, the exceptional transition cleared the isopen and issignaling flag in the jbmp_taskinstance table.

      I'm pretty sure this worked with the j4j action handlers, but it's really hard to revert now. How can we keep the task in "open" state, even if an exception occurs?

      Thanks,
      Greg