This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

There isn't any sample for jbpm at the moment. I'll try to make one or migrate an existing one from plain jbpm to spring jbpm support. You can take a look at the tests which contain application context definitions. Can you also please, raise an issue on jira under spring modules? thanks.

Comment

I have looked at the tests, but cannot figure out how to set up the factorybean.

I would like to pass in a mysql connection for the hibernate. I know how to set up transaction managers, and a mysql connection...but, how would I configure it to use a specific database, with the default hbm files?

Here is what I have in my application context...it fails in the afterPropertiesSet...I am not sure which of the two configuration methods to use (JbpmConfiguration, or ObjectFactory)

Comment

getting further...i had missed the &. However, if I call getConfiguration on the hibernate session factory the return type is Configuration....the LocalJbpmConfigurationFactoryBean has a method setConfiguration, but is expecting resource.

I don't see what I should be setting, setObjectFactory, or setConfiguration.

That's what I meant by tests. jbpm 3.1 support is different from jbpm 3.0 since jbpm itself has been modified quite a lot. Even though there are some similarities the classes and underlying architecture has changed - one aspect would be that you don't need to pass in a Hibernate configuration.

Comment

Here's how I am incorporating jBPM 3.1 into an existing Hibernate3/Spring app. My goal is to have a single SessionFactory for jBPM and the rest of my app, so everything participates in the same Spring declarative transactions.

- add jbpm-3.1.1.jar to WEB-INF/lib.
- in applicationContext.xml, I created a bean for JbpmConfiguration

- sessionFactory/hibernate configuration has to incorporate all of the jBPM org.jbpm.....hbm.xml mappings *and*your own.

- jbpm.cfg.xml copy-pasted from jBPM docs, but I took out reference to hibernate.cfg.xml since the SessionFactory is being provided via Spring.

- process defs (process1.xml etc.) are normal.

- you have to create the DB tables yourself somehow.

Only problem: it seems like this is causing a new version of each process to be redeployed to the jbpm_processdefinition table every time the app is restarted. This seems a little odd, and may make the Spring-based process deployment less useful.

Only problem: it seems like this is causing a new version of each process to be redeployed to the jbpm_processdefinition table every time the app is restarted. This seems a little odd, and may make the Spring-based process deployment less useful.

Do you have any idea what causes this redeployment? Is it caused by Spring integration? Can you please raise an issue on jira so I can take a look at it and fix it on our next Spring Modules release?
Thanks.

Comment

Do you have any idea what causes this redeployment? Is it caused by Spring integration? Can you please raise an issue on jira so I can take a look at it and fix it on our next Spring Modules release?
Thanks.

Wow, thanks for the quick reply. now that's service!

Honestly, I have no idea why this is happening. I'm new to jBPM, and right now focused on just getting the basic configuration and db connection/tx mgmt right.

Your process seems to be just fine. What jbpm version are you using? Lately I've been a bit swamped in work and I didn't have much time to do the jbpm documentation but it's high on my Spring Modules priority list (you can actually vote the jira issue).
I'll try to reproduce your problem though from my tests I haven't had such a problem.

Comment

Your process seems to be just fine. What jbpm version are you using? Lately I've been a bit swamped in work and I didn't have much time to do the jbpm documentation but it's high on my Spring Modules priority list (you can actually vote the jira issue).
I'll try to reproduce your problem though from my tests I haven't had such a problem.