jbpm4.4 spring整合

满大街都是资料,但整理起来还是比较麻烦,现将我的步骤梳理一下:

1:将jbpm.cfg.xml里面的

 
<import resource="jbpm.tx.hibernate.cfg.xml" />


换成

  
<import resource="jbpm.tx.spring.cfg.xml" />


2: 根据实际情况配置jbpm.hibernate.cfg.xml

主要是几个MAPPING文件

<mapping resource="jbpm.repository.hbm.xml" />
     <mapping resource="jbpm.execution.hbm.xml" />
     <mapping resource="jbpm.history.hbm.xml" />
     <mapping resource="jbpm.task.hbm.xml" />
     <mapping resource="jbpm.identity.hbm.xml" />


3:配置spring的application-context.xml
<bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper" >
  </bean>

  <bean id="processEngine" factory-bean="springHelper" factory-method="createProcessEngine" />


4:配置其他如 sessionfactory 和 事务管理器
bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
	<property name="dataSource">
		<ref bean="dataSource" />
	</property>
	<property name="configLocations">
		<list>
						<value>classpath:/jbpm.hibernate.cfg.xml</value>
		</list>
	</property>
</bean>
  <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
    <property name="dataSource" ref="dataSource" />
  </bean>


你可能感兴趣的:(java,spring,Hibernate,jbpm,配置管理)