[jboss-user] [jBPM] - Re: getProcess in ProcessInstanceImpl throws a NullPointerException

Marco Rietveld do-not-reply at jboss.com
Fri Apr 5 05:33:44 EDT 2013


Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the discussion

"Re: getProcess in ProcessInstanceImpl throws a NullPointerException"

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

--------------------------------------------------------------
There are one or two things you can do to keep the tx from closing -- but you don't want to go down that road. I've been there, and it just gets complexer and ends up in code that's harder to maintain. 

(If you are really, really, really sure that you still want to do it after reading this, let me know and I can explain it.)

The main reason you don't want to fool around with tx's when working with jBPM is that jBPM is designed to have full control over transactions -- or in other words, when some of the drools/jbpm developers initially designed the persistence mechanism, they designed it only thinking about the use case where drools/jbpm had control over the tx's: later, some changes were made to make it possible for the users to do that, but the design of the core persistence mechanism (the SingleSessionCommandService) doesn't really play nice with that. With Drools/jBPM 6, we've expanded some of the possibilities, and hopefully we'll add even more in the coming year, but, in my very humble opinion, I don't think we're at a point yet where we can encourage users to take tx control away from the engine. 

In short, once you take control of the tx with jBPM, you're getting into "hacking" territory and you'll be more and more on your own, so to speak. 

So, having said that, I'm getting back to my original question: why do you want the node instance information? One of the anti-patterns that's emerged with BPM is "reaching into the engine": you're always better of treating the engine as a black box because it makes it easier to migrate to new versions of the engine (or other engines) in the long run. It's the same principle as webservices -- or even just information encapsulation.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/806641#806641]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130405/4f6a606c/attachment.html 


More information about the jboss-user mailing list