<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<!--<import resource="classpath:../spring/workflowconfig-action.xml" />-->
<!-- activiti 使用oracle数据库
<bean id="dataSource_acticiti" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="org.h2.Driver"/>
<property name="url" value="jdbc:h2:tcp:localhost/activiti;DB_CLOSE_DELAY=1000"/>
<property name="username" value="sa"/>
<property name="password" value=""/>
</bean>
-->
<!--配置jboss下的数据源,使用Jndi方式-->
<bean id="dataSource_acticiti" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:oracleDataSource" />
</bean>
<bean id="transactionManager_acticiti" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource_acticiti"/>
</bean>
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource_acticiti"/>
<property name="transactionManager" ref="transactionManager_acticiti"/>
<property name="deploymentResources" value="classpath*:/activiti/*.bpmn20.xml"/>
<property name="databaseSchemaUpdate" value="true"/>
<property name="jobExecutorActivate" value="false"/>
</bean>
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration"/>
</bean>
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService"/>
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService"/>
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService"/>
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService"/>
<bean id="formService" factory-bean="processEngine" factory-method="getFormService"/>
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService"/>
</beans>
<property name="deploymentResources" value="classpath*:/activiti/*.bpmn20.xml"/>
上述为实现自动部署代码,其中activiti为文件夹,位置在WEB-INF\classes\下.在该文件夹下流程定义文件未发生改变的情况下,数据库中的数据不会发生变化,当流程定义文件更新,数据库内容将会发生改变。
如:WorkOrder.bpmn20.xml,在第一次的时候,数据库会初始化一条记录,当WorkOrder.bpmn20.xml发生变化(更新时间变化后),数据库会相应再产生一条记录,版本号+1.