You will probably have to dig into the Seam JBPM integration component to see how JBPM is getting a SessionFactory. It may be a simple matter of creating a custom JBPM Component and extend how Seam provides JBPM with a session factory by default. If you find a solution and wish to contribute such an integration to the Seam-Spring module or suggest a Seam FeatureRequest that would make it easier to specify a SessionFactory perhaps through EL to the JBPM compoponent that would be great.
your suggestion is probably the best and cleanest approach.
However, yesterday I started a try in a different direction: using spring-modules-jbpm31 (a set of integration classes for jBPM and Spring) I am able to configure jBPM using beans and it is easy to share the Spring hibernate sessionFactory bean.
BUT the big problem is: the
linkto Seam is missing, the nice Seam components like pooledTaskInstanceList etc. are not available.
Using org.springframework.web.jsf.DelegatingVariableResolver does not solve this problem.
So this way it won't work :(
Or does someone know a solution to this?
Ya, so somewhere it looks like you're going to need to do an integration. I haven't looked at the JBPM stuff so I won't be much help. But I'm sure it would just be a matter of analyze the different touch points between JBPM and Seam and finding a place to override a component somewhere to use a Spring provided Hibernate thing or JBPM thing.
If you'd like to create an issue for Seam-JBPM-Spring integration go ahead but I probably won't have time to look at it for a number of months. :(