-
1. Re: Error Handling and Exception Handling Not Working as Desired [JBPM6.1.0.Final]
swiderski.maciej Feb 2, 2015 1:25 AM (in response to sanjay05222)first of all handling technical exceptions within process definition is not really good idea. Better is to always rely on business related exceptions so they can be meaningful to the process itself. Better is to catch technical exception and thrown more business related.
Nevertheless, make sure that the NPE is actually thrown and propagated up to the caller. It will always check the name of the exception (class name) and will search for match in exception handlers - boundary events but not only as event subprocess etc will be taken into consideration as well.
HTH
-
2. Re: Error Handling and Exception Handling Not Working as Desired [JBPM6.1.0.Final]
sanjay05222 Feb 2, 2015 2:27 AM (in response to swiderski.maciej)Maciej Swiderski wrote:
first of all handling technical exceptions within process definition is not really good idea. Better is to always rely on business related exceptions so they can be meaningful to the process itself. Better is to catch technical exception and thrown more business related.
Nevertheless, make sure that the NPE is actually thrown and propagated up to the caller. It will always check the name of the exception (class name) and will search for match in exception handlers - boundary events but not only as event subprocess etc will be taken into consideration as well.
HTH
Thanks for the answer Yes Indeed your first point I also agree to it , but as this is just an experimentation to see how things work I was wondering if there is any reason is to why NPE I am not able to catch while I am able to catch IllegalArgumentException.
I can see that we have handleException in the WebServiceWorkItemHandler parent class/interface I am calling that method , but it is not clear where I have to mention/configure the final handler ?
-
3. Re: Error Handling and Exception Handling Not Working as Desired [JBPM6.1.0.Final]
swiderski.maciej Feb 3, 2015 1:39 AM (in response to sanjay05222)1 of 1 people found this helpfulwhen you look at the handler for web service it does not try catch entire execute method but only part of it so it might be the case that NPE is thrown before that try catch block and thus it's not handled as error with boundary event. Make sure that exception is caught in the try catch or wrap that handler with your custom one that will enclose entire execute method with error handling.
HTH