3 Replies Latest reply on Mar 4, 2008 7:57 PM by youngm

    Spring sessionFactory for Seam-jBPM-integration

    Frank Bitzer Newbie

      Hi all,


      how can I use a Spring hibernateSessionFactory bean as sessionFactory for jBPM in a Seam application?


      Currently, I have the Spring beans like this:


           


      <bean id="hibernateSessionFactory"     class="AnnotationSessionFactoryBean">
      //hibernate properties and mappings here...
      //this sessionFactory should be used by jBPM, too
      </bean>
      
      
      <bean id="sessionFactory"     class="org.jboss.seam.ioc.spring.SeamManagedSessionFactoryBean">
        <property name="sessionName" value="hibernateSession" />
      </bean>



      and in components.xml



      <persistence:managed-hibernate-session name="hibernateSession" auto-create="true"
              session-factory="#{hibernateSessionFactory}"/>
      
      //init jBPM
      <component class="org.jboss.seam.bpm.Jbpm">
              <property name="processDefinitions">processdefinition.jpdl.xml</property>
      </component>



      This way, I can use the sessionFactory in Seam. But I have absolutely no idea how to pass it to jBPM.



      Is there any way to achieve this?



      Thanks in advance,
      Frank

        • 1. Re: Spring sessionFactory for Seam-jBPM-integration
          youngm Novice

          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.


          Mike

          • 2. Re: Spring sessionFactory for Seam-jBPM-integration
            Frank Bitzer Newbie

            Hi Mike,


            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 link to 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?


            Frank

            • 3. Re: Spring sessionFactory for Seam-jBPM-integration
              youngm Novice

              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. :(


              Mike