salaboy wrote:
> 
> Ed, feel free to contribute with documentation about how you implement
> your
> own mechanisms to handle exceptions.
> 
I'm a newbie, I've never written a WorkItemHandler, I've just read the doc
and tried to understand.
I came away from the "Exceptions" section of the doc with no idea of whether
or how it related to Java Exceptions, and they're not covered elsewhere. 
All I'm looking for (for now) is to simply throw into the docs (maybe in
"8.2.4. Executing work items") what Kris said here, which I think boils down
to:

   "WorkItemHandlers should not throw exceptions of any kind.  If an
exception is to be handled at the business process level, convert it into a
Fault.  The WorkItemHandler should also provide whatever other handling
(logging, etc.) is desired."

I'd also suggest renaming section 3.8 from "Exceptions" to "Faults", and
talk about "Fault Handlers", not "Exception Handlers".  

It might make sense to provide an AbstractWorkItemHandler which wraps
executeWorkItem() with sensible default behavior of some kind.  But this is
less important, IMHO.  I agree that the mapping from Java exception to
business-process semantics is fundamentally the responsibility of the
WorkItemHandler.  The framework can help, and can make clear that the
responsibility exists -that's all.

-Ed

-- 
View this message in context: 
http://n3.nabble.com/How-to-do-Exception-Handling-tp689387p708851.html
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to