activiti mysql spring整合
1.下载activiti-5.3??? www.activiti.org
2.C:\activiti-5.3\activiti-5.3\setup???
??? 修改build.properties??? db=mysql
??? 修改build.mysql
?????????? db=mysql
?????????? jdbc.driver=com.mysql.jdbc.Driver
?????????? jdbc.url=jdbc:mysql://localhost:3306/activiti?autoReconnect=true
?????????? jdbc.username=activiti
??????????? jdbc.password=activiti
??? 运行ant db.create
2.新建项目,把C:\activiti-5.3\activiti-5.3\workspace\activiti-spring-examples拷贝到项目中
??? 如果运行了ant demo.setup? 在这个目录下会有libs-runtime libs-test 把相关类库添加到项目中
3.修改activiti-context.xml
???? <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"?
?????? xmlns:context="http://www.springframework.org/schema/context"
?????? xmlns:tx="http://www.springframework.org/schema/tx"
?????? xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
?????? xsi:schemaLocation="http://www.springframework.org/schema/beans?? http://www.springframework.org/schema/beans/spring-beans.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-3.0.xsd">
? <bean id="dataSource" value="com.mysql.jdbc.Driver" />
??? <property name="url" value="jdbc:mysql://localhost:3306/activiti?autoReconnect=true" />
??? <property name="username" value="activiti" />
??? <property name="password" value="activiti" />
? </bean>
??
? <bean id="transactionManager" ref="dataSource" />
? </bean>
??
? <bean id="entityManagerFactory" ref="dataSource"/>
?? ?? <property name="persistenceXmlLocation">
??? ??? ? <value>classpath:custom-persistence.xml</value>
????? </property>
?? ?? <property name="jpaVendorAdapter">
?? ??? ?? <bean value="org.apache.openjpa.jdbc.sql.MySQLDictionary" />
?? ??? ?? </bean>
?? ?? </property>
? </bean>
?<bean id="processEngineConfiguration" ref="dataSource" />
??? <property name="transactionManager" ref="transactionManager" />
??? <property name="databaseSchemaUpdate" value="true" />
??? <property name="mailServerHost" value="localhost" />
??? <property name="mailServerPort" value="5025" />
??? <property name="jpaEntityManagerFactory" ref="entityManagerFactory" />
??? <property name="jpaHandleTransaction" value="true" />
??? <property name="jpaCloseEntityManager" value="true" />
??? <property name="jobExecutorActivate" value="false" />
? </bean>
??
? <bean id="processEngine" 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="managementService" factory-bean="processEngine" factory-method="getManagementService" />
? <bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService"></bean>
</beans>
4.新建一个过程定义文件financialReport.bpmn20.xml(从10分钟教程中copy过来的)
5.新建一个测试用例,测试发布,任务获取整个过程
package com.brsy.test;?? 参考http://rongjih.blog.163.com/blog/static/33574461201011345145978/
1 楼 xiegs2007 2011-12-12 是的,这个例子是成功的,但是如何把它集成到springMVC的web项目中去呢?