-
1. Re: Persisting Hibernate entities as process variables
kukeltje Feb 1, 2010 7:17 AM (in response to protocol7)Can you make a full unit test (but as minimal as possible) in an eclipse (or maven) project with I'm curious to this to but have no direct answer.
Did you try to do a save of the entity as the error states? Is ID generation working?
Ronald
-
2. Re: Persisting Hibernate entities as process variables
protocol7 Feb 2, 2010 3:58 PM (in response to kukeltje)Sorry for the delay. I've uploaded a modified version of the Hello world example which exposes this problem here: http://github.com/protocol7/jbmp4-helloworld-persist (if you do not use Git, you can download everything using the "Download source" button. Just run the Main class and you should get the exception.
Thanks!
/niklas
-
3. Re: Persisting Hibernate entities as process variables
jbarrez Feb 2, 2010 5:00 PM (in response to protocol7)You have to persist your Hibernate entities first. jBPM will use the generated id to link the entity as a variable (instead of serializing the complete object). A quick way to persist your entity is to create a custom command (where you have access to the Hibernate session via environment.get(Session.class).
Check org.jbpm.test.hibernatelongid.HibernateLongIdTest to see an example.
-
4. Re: Persisting Hibernate entities as process variables
protocol7 Feb 3, 2010 4:04 AM (in response to jbarrez)Thanks a bunch, works like a charm. I've updated the code on GitHub. How about adding something correspoding to PersistCommand to jBPM to make this a bit more obvious to thick people like myself? :-)