|
第一步:将JBPM的配置写入HIbernate,生成相应的表
<property name="mappingLocations">
第二步:与Spring集成
* 用到jbpmConfiguration对象的时候,需要注入 (<property name="jbpmConfiguration" ref="jbpmConfiguration"></property>) |
<!-- JBPM Hibernate SessionFactory -->
<bean id="jbpmSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="mappingLocations">
<value>classpath*:/org/jbpm/**/*.hbm.xml</value>
</property>
</bean>
<bean id="jbpmConfiguration"
class="org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean">
<property name="configuration" value="classpath:jbpm.cfg.xml"></property>
<property name="sessionFactory" ref="jbpmSessionFactory" />
<property name="processDefinitions">
<list>
<ref local="qingjia" />
</list>
</property>
<property name="createSchema" value="false" />
</bean>
<bean id="qingjia" class="org.springmodules.workflow.jbpm31.definition.ProcessDefinitionFactoryBean">
<property name="definitionLocation" value="file:${oa_application.config}/qingjia/processdefinition.xml"/>
</bean>
附:
<!-- jbpm 3.2.6 -->
<property name="mappingLocations">
<value>classpath*:/org/jbpm/**/*.hbm.xml</value>
</property>
<property name="typeDefinitions">
<ref bean="jbpmTypes" />
</property>
<bean id="jbpmTypes"
class="org.springframework.orm.hibernate3.TypeDefinitionBean">
<property name="typeName" value="string_max" />
<property name="typeClass"
value="org.jbpm.db.hibernate.StringMax" />
</bean>
<!-- jbpm 3.2.6.sp1 -->
<import resource="file:${oa_application.config}/cn/firstsoft/firstframe/plugins/jbpm/applicationContext-jbpm.xml"/>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
<!-- JBPM 3.2.6.SP1 -->
<bean id="jbpmConfiguration"
class="org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean">
<property name="sessionFactory" ref="sessionFactory" />
<property name="configuration"
value="file:${oa_application.config}/conf/jbpm.cfg.xml" />
<!--
<property name="createSchema" value="false"/>
-->
<!-- unused, it can be deploy false, deploy success, then set it -->
<!--
<property name="processDefinitions"> <list> <ref
local="testProcess"/> </list> </property>
-->
</bean>
<bean id="jbpmTemplate" class="org.springmodules.workflow.jbpm31.JbpmTemplate">
<property name="jbpmConfiguration" ref="jbpmConfiguration" />
</bean>
<!-- 动态分配任务的处理,利用node-enter事件
<bean id="jbpmProcessDao" class="cn.firstsoft.firstframe.plugins.jbpm.JbpmProcessDao">
<property name="template" ref="jbpmTemplate" />
</bean>
<bean id="nodeEnterActionHandler" parent="baseTxService">
<property name="target">
<bean
class="cn.firstsoft.modules.workflow.service.handler.NodeEnterActionHandler" />
</property>
</bean>
<bean id="endNodeEnterActionHandler" parent="baseTxService">
<property name="target">
<bean
class="cn.firstsoft.modules.workflow.service.handler.EndNodeEnterActionHandler" />
</property>
</bean>
<bean id="taskEndCountersignActionHandler" parent="baseTxService">
<property name="target">
<bean
class="cn.firstsoft.modules.workflow.service.handler.TaskEndCountersignActionHandler" />
</property>
</bean>
-->
</beans>
998

被折叠的 条评论
为什么被折叠?



