ssh整合activiti5工作流

百度百科:
http://baike.baidu.com/view/4845351.htm
下载地址:
http://www.activiti.org/
选择activiti5的原因:
1.osworkflow很老了,基本上没有新的资料。
2.jbpm4与jbpm5基本上是2套东西,对于jbpm4比较熟悉(看了很久的资料)
3.activiti5相当于jbpm4的升级版
注意:
activiti5的持久层中间件用的是mybatis
如何整合:
一.搭建ssh框架,这个不多说了,网上一搜一大堆。
二.整合activiti5,很简单的整合步骤
1.jar包:
activiti-engine-5.10.jar
activiti-spring-5.10.jar//与Spring整合必须

2.spring配置文件:
<?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:context="http://www.springframework.org/schema/context" 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/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"
	default-lazy-init="false">
	<!-- default-autowire="byName" 这个SpringProcessEngineConfiguration中的transactionManager是PlatformTransactionManager,所以不能用byName方式 -->
	<!-- activiti5 -->
	<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="jobExecutorActivate" value="false" />
	</bean>
	<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
		<property name="processEngineConfiguration" ref="processEngineConfiguration" />
	</bean>
	<!-- 这个是用activiti5几个主要的接口 -->
	<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="managementService" factory-bean="processEngine"
		factory-method="getManagementService" />
	<bean id="identityService" factory-bean="processEngine"
		factory-method="getIdentityService" />

</beans>

3.调用:junit测试是否能取到processEngine等,若取到值,则证明配置正确
private RuntimeService runtimeService;
public void setRuntimeService(RuntimeService runtimeService) {
		this.runtimeService = runtimeService;
	}

参考资料:
网路冷眼@BlogJava
http://www.blogjava.net/lewhwa/archive/2010/12/05/339823.html
咖啡兔
http://www.kafeitu.me/activiti/2012/05/26/kft-activiti-demo.html

猜你喜欢

转载自l1122303.iteye.com/blog/1678619