[jboss-user] [jBPM] - Re: jbpm 4.4 and Spring 3.0.5 integration

Samrat Roy do-not-reply at jboss.com
Tue May 10 04:16:27 EDT 2011


Samrat Roy [http://community.jboss.org/people/whizkid.samrat] created the discussion

"Re: jbpm 4.4 and Spring 3.0.5 integration"

To view the discussion, visit: http://community.jboss.org/message/604379#604379

--------------------------------------------------------------
I have done a Jbpm 4.4 Spring 3.0.5 integration in a webapp.. So I am your man  :)  .. believe me it is tricky.. 

Before you start to integrate stuff you need couple of files ready .

I am assuming you are using hibernate .. because jbpm itself uses hibernate for data persistance..  (The version to use will be 3.5 , 3.6 wont work )

1. jbpm.cfg.xml  - check atttachment - default attached. Keep it in the src directory of your project.

2. jbpm.hibernate.cfg.xml - See attached,  again keep it int the src directory (notice the custom written hibernate dialect , for some reason hibernate was messing up type mappings for oracle 10g in my case) , jbpm.hibernate.cfg.xml file is auto picked by the jbpm api (check jbpm.tx.hibernate.cfg.xml - this file includes jbpm.hibernate.cfg.xml , so jbpm.tx.hibernate.cfg.xml had to be included in jbpm.cfg.xml ), hence no need to mention jbpm.hibernate.cfg.xml in any cfg files you create.

3. jbpm4-context.xml - See attached,  again keep it in the src directory

4. Create your normal hibernate.cfg.xml to do application specific db operations.

5. jbpm specific hibernate operations are kept in jbpm.hibernate.cfg.xml (mentioned in point number 2)

6. Do the normal spring hibernate configuration ..

   add the following beans in applicationContext.xml

<!-- norman spring hibernate intigration -->   

<bean id="sessionFactory"

        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

        <!--<property name="dataSource" ref="dataSource" /> -->

        <property name="dataSource" ref="jndiDataSource" />



        <property name="configLocation">

            <value>classpath:hibernate.cfg.xml</value>

        </property>

        <property name="configurationClass">

            <value>org.hibernate.cfg.AnnotationConfiguration</value>

        </property>

    </bean>

<!--adding jbpm beans to the spring context-->

*<import resource="jbpm4-context.xml" />*

7. That is all folks .. whenever you need any jbpm service .. just ask the spring context for it  :) 
   {getBean("repositoryService");}
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[http://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/20110510/2aa24ac2/attachment.html 


More information about the jboss-user mailing list