1 Reply Latest reply on Aug 18, 2011 12:13 AM by David Ward

    Fault handling in jBPM task handler

    Keith Babo Master

      I was looking at the reply handling logic in SwitchYardServiceTaskHandler and it looks like we don't take the exchange state into account.  Current logic looks like this:



      try {
         Exchange exchangeOut = inOutHandler.waitForOut();
         context = exchangeOut.getContext();
         message = exchangeOut.getMessage();
         content = message.getContent();
         task.setProcessInstanceVariable(getMessageContentName(), content);
         results = new HashMap<String,Object>();
         for (Property property : context.getProperties(Scope.OUT)) {
            results.put(property.getName(), property.getValue());
      } catch (DeliveryException e) {
         problem = e.getMessage();


      Later on in the code, if a 'problem' exists the task is aborted. Seems like the exchange state should come into play here.  Not sure if aborting the task is the right thing to do or not in the case of a fault.  From a BPM standpoint, I would think that we would want to define an error handler that could capture fault activity and deal with it appropriately.  Not sure how that gets wired up behind the scenes in jBPM. ;-)