7 Replies Latest reply: Feb 21, 2013 1:51 AM by arp.java6 RSS

    jBPM5 Exception Handling

    dme Newbie



      I have created a flow to test the Fault/Exception Handling provided by jBPM, but the fault is never handled. I have attached the Process File and the correspondign Java Driver Below.


      The Exception is raised correctly, and within the sub-process I add an exception handler which maps to the Fault Code. In this Excetpion Handler I am printing a message stating that the fault was handled, but the code never reaches the exception handler. When I look at the "XML" behind the process, it does not contain the code for exception handling. Now if I close the process file and re-open it, the exception handling code does not show in Eclipse as well.


      I looked at the Example "ErrorBoundaryEventInterrupting.bpmn2" and see that even in this case the Exception Handler code is not in the XML for the process. Where is this code kept and how do I fix my process to handle the fault/exceptions generated?



        • 1. Re: jBPM5 Exception Handling
          Maciej Swiderski Master

          After looking at the bpmn file it looks like you're missing escalation catch event. You have throwing escalation end event in the sub process but there is no boundary catch event on the sub process so there is no element to catch the escalation event.



          • 2. Re: jBPM5 Exception Handling
            dme Newbie

            Hi Maciej,


            Thanks for the response. I now understand that for handling Errors and Escalations a corresponding catch event (event handler) must be provided and the Exception Handler maps the Error/Escalation to the event handler automatically. I was trying to handcode the exception handler using the "Textual Editor" provided for the Exception handler which was causing my confusion. I am able to make the process work by coding the corresponding handler.




            • 3. Re: jBPM5 Exception Handling
              Sridhar J Newbie



              Can you upload the fixed / modified Handler and BPMN file. I need to understand the Exception Handler mechanism. Thanks

              • 4. Re: jBPM5 Exception Handling
                dme Newbie



                I have attached the Exception handling code to my post above, it was tested with jBPM v5.1 and shows a very basic exception handling case.

                • 5. Re: jBPM5 Exception Handling
                  Sridhar J Newbie

                  Thanks DME for uploading the Example.

                  • 6. Re: jBPM5 Exception Handling
                    sebb Newbie

                    I cant get your example to work with my process. How did you map the signal to the error event with the editor? Is the sub process needed for exception handling?


                    edit: Ok now it works. But I had to create an embedded subprocess and copy all the meta attributes of your signalEvent into mine (and customize them). But that cant be the way it is meant to be? That is very complicated and not user friendly. So how did you initially map the errorEvent to the signalEvent?

                    edit2: And i get the following warnings in my console:


                    (null: 19, 61): cvc-id.2: There are multiple occurrences of ID value 'TestException'.

                    (null: 19, 61): cvc-attribute.3: The value 'TestException' of attribute 'id' on element 'error' is not valid with respect to its type, 'ID'.

                    • 7. Re: jBPM5 Exception Handling
                      arp.java6 Newbie

                      Hi dme,

                            Thank you very much for uploading the example for error handler. It helped me to work on similar problem in my project.