Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-2854

If exception handlers are defined in multiple nodes, only the first one is triggered during one execution

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jBPM 3.2.10
    • jBPM 3.2.8
    • Runtime Engine
    • None

      If you run a process definition below with ExceptionActionHandler which throws IllegalArgumentException, the first exception will be handled by the first exception handler and the second exception won't be handled — will be thrown as a DelegationException to the client.
      This behavior was introduced by JBPM-1887 to avoid infinite loop. But ExecutionContext.exception can be cleared after handling the exception. Then avoiding loop and using multiple exception handlers will be achieved at a time.

      ==============

      <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="sample">

      <start-state name="start-state1">
      <transition to="node1"></transition>
      </start-state>

      <node name="node1">
      <event type="node-enter">
      <script>
      System.out.println("node1 called.");
      </script>
      <action class="com.test.action.ExceptionActionHandler"></action>
      </event>
      <exception-handler exception-class="java.lang.IllegalArgumentException">
      <script>
      System.out.println("node1 Exception Handler OK.");
      </script>
      </exception-handler>
      <transition to="node2"></transition>
      </node>

      <node name="node2">
      <event type="node-enter">
      <script>
      System.out.println("node2 called.");
      </script>
      <action class="com.test.action.ExceptionActionHandler"></action>
      </event>
      <exception-handler exception-class="java.lang.IllegalArgumentException">
      <script>
      System.out.println("node2 Exception Handler OK.");
      </script>
      </exception-handler>
      <transition to="end-state1"></transition>
      </node>

      <end-state name="end-state1"></end-state>

      </process-definition>

            aguizar_jira Alejandro Guizar (Inactive)
            rhn-support-tkobayas Toshiya Kobayashi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: