Activiti与Spring配置

web.xml
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:applicationContext-tx.xml
				, classpath*:applicationContext-service.xml
				, classpath*:applicationContext-action.xml
				, classpath*:applicationContext-activiti.xml
		</param-value>
  </context-param>



<?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-3.0.xsd
	http://www.springframework.org/schema/aop
	http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
	http://www.springframework.org/schema/tx
	http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

   	<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
		<property name="dataSource" ref="dataSource" />
		<property name="transactionManager" ref="transactionManager"/>
		<property name="databaseSchemaUpdate" value="true"/>
		<property name="deploymentResources">
			<list>
				<value>classpath*:/process/deployment/*.zip</value>
			</list>
		</property>
	</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="formService" factory-bean="processEngine" factory-method="getFormService" /> 
	<bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" /> 
	<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" /> 
	<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" /> 
	<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" /> 
	
</beans>

猜你喜欢

转载自tianqiushi.iteye.com/blog/2119090