-
1. Re: Exception handling for technical exceptions
swiderski.maciej Jun 22, 2012 12:21 PM (in response to marcomr)Perhaps having this logic inside work item handler that can take this complexity - so you will have a custom work item handler implementation that acts like a wrapper for other work item handlers (service task human task, etc) and can perform exception handling if such a need arise. Wdyt?
HTH
-
2. Re: Exception handling for technical exceptions
marcomr Jun 26, 2012 6:45 AM (in response to swiderski.maciej)Hi Maciej,
thanks for your answer.
That would be my preferred approach. My only doubt is how would I perform the handling from this wrapper.
I've looked into the KnowledgeSessionAware interface solution that Kris suggested in other topic (https://community.jboss.org/thread/168600) and have this implemented in an embedded scenario, but I'm not sure how I'd implement this to work on processes initiated via the jbpm-console without having to fork jBPM code. Also Kris provided an implementation for a work item handler that is session aware (in https://github.com/droolsjbpm/jbpm/blob/master/jbpm-workitems/src/main/java/org/jbpm/process/workitem/AbstractWorkItemHandler.java#L40) but again I couldn't find any integration with a jbpm-console started process.
So is there any preferred approach for this? Is it possible, if we go the signaling route, by configuration, to switch the work item manager used by jbpm-console so that it passes the session to the handlers?
Thanks for your time!
Best regards,
Marco
-
3. Re: Exception handling for technical exceptions
swiderski.maciej Jun 27, 2012 4:06 PM (in response to marcomr)Yeah, I would recommend to use AbstractWorkItemHandler as a base class for all your handlers so you'll get access to session.
As it comes to using that handler in console, you could declare your custom work item handlers inside CustomWorkItemHandlers.conf that is located inside gwt-console-server.war/WEB-INF/classess/META-INF. Just one note, I believe session won't be injected into it. If you don't mind to have a handler that is tightly coupled with console code you could look it up using signleton object StatefulKnowledgeSessionUtil.getStatefulKnowledgeSession().
HTH
-
4. Re: Exception handling for technical exceptions
marcomr Jun 29, 2012 6:52 AM (in response to swiderski.maciej)Hi Maciej,
I've implemented your proposed solution. The tight coupling here isn't really an issue for me, so I went with that approach and it's working great!
Many thanks for your help!
Best regards,
Marco
-
5. Re: Exception handling for technical exceptions
prathap.vs Feb 13, 2013 7:38 AM (in response to marcomr)Hi Marco,
Can i know how you implemented above proposed solution. I am not able to access session in my custom work item handler.
Thanks,
Prathap