[jboss-user] [jBPM] - Re: How to get current node instance in a workitem handler?

Kris Verlaenen do-not-reply at jboss.com
Fri Apr 13 12:13:47 EDT 2012

Kris Verlaenen [https://community.jboss.org/people/KrisVerlaenen] created the discussion

"Re: How to get current node instance in a workitem handler?"

To view the discussion, visit: https://community.jboss.org/message/729952#729952


The main reason for not exposing the node instance in the work item handler is that "in general" we believe this is not necessary in most use cases.   Giving access to the node instance in the handler would in a lot situations lead to handlers that are tightly coupled to the process instance that triggered the service invocation (kinda like how ActionHandlers worked in jBPM3), where they (imho) should be more generic and reusable accross processes.

That said, I can see how access to the node instance id might be useful in some cases (without losing the genericity of the handler).  The work item currently has access to the process instance id, so you could just retrieve the process instance from the session and find the node instance that references this work item.  We could make an AbstractWorkItemHandler or a utility method that would allow you to do something like that easily.



Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120413/1a63f1fd/attachment.html 

More information about the jboss-user mailing list