Hello
My application provides the ability to register custom work item handlers. Users register an instance of the custom handlers and when i create a session i get these handlers and register them against the statefulknowledgesession. The problem is that some of these handlers might need access to the StatefulKnowledgesession however I can't find the best way to inject the session into these handlers. For example I decided to use StatefulKnowledgeSessionAware interface where i set the session if the handler implements the handler. The problem with this is that there is a single instance of the handler and i run the risk that the handler might have a session injected when it is currently already in use by another session.
What would be great is to have some kind of handler with a method signature
public void executeWorkItemWithSession(WorkItem workItem, WorkItemManager workItemManager, StatefulKnowledgeSession)
that way it doesn't matter that there is only one instance of the handler everytime the handler is invoked the session is injected into the method. Is this possible to achieve? Can i do some extension to support this?
Any help would be appreciated.