AnsweredAssumed Answered

Handling exceptions of Spring ServiceTasks

Question asked by gunnar1 on Nov 16, 2011
Latest reply on Dec 1, 2011 by gunnar1
Hi folks,
in the Userguide you're going to find a sample on how to implement dedicated Exception handling for java services.
More precisely there is a chapter Handling exceptions describing how to route process execution through another path in case some exception occurs: we just have to implement ActivityBehavior and do something like the following:

public class ThrowsExceptionBehavior implements ActivityBehavior {

  public void execute(ActivityExecution execution) throws Exception {
    String var = (String) execution.getVariable("var");

    PvmTransition transition = null;
    try {
      transition = execution.getActivity().findOutgoingTransition("no-exception");
    } catch (Exception e) {
      transition = execution.getActivity().findOutgoingTransition("exception");

So far so good. The point is, I want to do the same with Spring Services…

  • Is there a sample on how to do this when calling Spring Beans?

  • Is there some kind of involved superclass when calling a Spring Bean so that I can have a look at the standard logic and provide a custom subclass?

  • What about an annotation defining the outgoing transition (better: an error event) in case of a specific exception…?

  • The best solution would be to have the BPMN intermediate error event available as boundary event with service tasks (and not only on subprocesses) as well.
I think you guys have a cool solution or at least an idea?

Thanks in advance