6 Replies Latest reply on Nov 9, 2010 3:10 AM by Michał Minicki

    Exception Handler support in jBPM 4.4

    Andrew Dunn Newbie

      Hi,
      I'm looking to use jBPM 4.4 and I want to be able to configure Exception Handlers on my process definitions, however the documentation for this isn't complete (http://docs.jboss.com/jbpm/v4/devguide/html_single/#d0e4127) and there is even a statement that it is still to be done (http://docs.jboss.com/jbpm/v4/devguide/html_single/#d0e2799). However if it is possible I can't find any documentation about it in version 4 of jBPM, all docs and blogs that mention it are related to version 3.
      So my questions are:
      1. Can I configure an exception handler/handlers for an activity?
      2. Can I configure an exception handler/handlers for a process?
      3. Can I configure a default exception handler for all processes?
      3. If I can configure any of the above exception handlers how do I do it?
      Thanks

      Hi,

       

      I'm looking to use jBPM 4.4 and I want to be able to configure Exception Handlers on my process definitions, however the documentation for this isn't complete and there is even a statement that it is still to be done here. However if it is possible I can't find any documentation about it in version 4 of jBPM, all docs and blogs that mention it are related to version 3.

       

      So my questions are:

       

      1. Can I configure an exception handler/handlers for an activity?

      2. Can I configure an exception handler/handlers for a process?

      3. Can I configure a default exception handler for all processes?

      4. If I can configure any of the above exception handlers how do I do it?

      5. Can this be done using Spring?

       

      Thanks

        • 1. Re: Exception Handler support in jBPM 4.4
          Michael Wohlfart Expert

          exception handling for jBPM4 comes up every other month it seems, please check out this thread:

          http://community.jboss.org/thread/146114

           

          The legendary Ronald van Kuijk pointed out that "handling low level exceptions like java exceptions should normally not 'bubble up' to the processlevel"

          and I agree with that.

          • 2. Re: Exception Handler support in jBPM 4.4
            Michał Minicki Newbie

            So, basically, are you saying Process Engine shouldn't help you with "no managed connections" or deadlock transaction kills in any way? That's one of the major reasons I would use a BPM engine for. I mean to be able to configure a "retry" behavior at the process global level instead of doing it in every atomic node that touches the database.

            • 3. Re: Exception Handler support in jBPM 4.4
              Michael Wohlfart Expert

              Hi Michal,

              There is a retry interceptor in jBPM4 that might do what you are looking for,

              did you check out this thread: http://community.jboss.org/thread/154856

               

              I am not sure what you mean by "no managed connections", running out of connections in your pool?

              • 4. Re: Exception Handler support in jBPM 4.4
                Artur Wójcik Newbie

                It seems to me that Michal had in mind discussed problem in http://community.jboss.org/thread/146114,
                I' m new in jbpm and I was expecting something to handle errors, something automatic and intelligent, something out of the box,

                which repeat operations.

                 

                Now in ths level of my knowledge, Now I don't see hint given by Ronald

                 

                "What I do not get is why you would not want to wrap them in another java class but do want to handle the exeption in a certain node where you most likely need to create custom java classes per class you have.
                How many classes are we talking about? 4? 6? 100?
                If there are many, you can always look at the implementation of JavaActivity and JavaBehaviour and create ONE custom node that does waht you want AND can direct/steer the process.... So... be creative, be patient, be polite...."

                 

                I feel in here a lot of repeated xml elements in every jpdl, and maybe repeated code(smells bad practices),
                I mean a lot of processes with a lot of activites, component nodes, custom nodes, java nodes in
                enterprise,heterogenous environment where is communication beetween different EIS
                it was nice to no attention about Connection refused, marshalexception, or any remote exception,or any technical error ...

                knowing that is mechanism to repeat operation...

                 

                 

                It is something pattern in jpdl+java to create handler error which can use transparently and
                resolve above problems ?

                 


                Best regards

                 

                Artur

                • 5. Re: Exception Handler support in jBPM 4.4
                  Michael Wohlfart Expert

                  What I had in mind was something like a NPE because one of your process variables is not initialized, for example a programming error in your form validation.

                  I don't think low level exceptions like this should be handled in a higher level context like the Process Engine, you could probably initialize a transition into an "error" state but this would violate the "Crash, Don't Trash" principle.

                  Having said that, I also think it makes sense in some cases to have an exception handling in your process definition. As far as I know this is implemented in jBPM3, see:  http://docs.jboss.org/jbpm/v3/userguide/jpdl.html#exceptionhandler.element, unfortunately jBoss stopped development on jBPM4 before this was implemented in jBPM4.

                  • 6. Re: Exception Handler support in jBPM 4.4
                    Michał Minicki Newbie

                    So, the bottom line is, there is no way to do this in jBPM4 for now.

                     

                    I don't exactly know who's making all the design decisions here so I'll just ask.

                     

                    Are you planning to implement something like this in the future? I'm asking b/c in all the threads concerning exception handling I see lots of deflecting answers and lots of explanations of why there shouldn't be one in jBPM4.

                     

                    If you are going to implement it in the end, are you guys willing to accept any patches with possible solutions?

                     

                    Kind regards,

                    Michał