Activiti演示环境采用的是h2内存数据库。 为了便于研究代码,所以将其迁移到我已有的MySQL/PostgreSQL数据库上去。
一、MySQL
1、MySQL配置
Activiti数据库DDL文件位于activiti-engine-5.17.0.jar\org\activiti\db\create\, MySQL 5.6.4及其之后版本与之前的版本使用的是不同的DDL文件。将下列用于MySQL 5.6.4+的DDL文件提取保存到某一目录下。
activiti.mysql.create.engine.sql activiti.mysql.create.identity.sql activiti.mysql.create.history.sql
create database ActivitiDB character set utf8 collate utf8_general_ci; use ActivitiDB; source c:/activiti.mysql.create.engine.sql; source c:/activiti.mysql.create.identity.sql; source c:/activiti.mysql.create.history.sql;
删除下列MyBatis配置文件:
apache-tomcat-7\webapps\activiti-explorer\WEB-INF\classes\db.properties apache-tomcat-7\webapps\activiti-rest\WEB-INF\classes\db.properties
apache-tomcat-7\webapps\activiti-explorer\WEB-INF\classes\activiti-custom-context.xml apache-tomcat-7\webapps\activiti-rest\WEB-INF\classes\activiti-custom-context.xml
修改下列Tomcat上下文,配置Tomcat JNDI资源:
apache-tomcat-7\webapps\activiti-explorer\META-INF\context.xml
apache-tomcat-7\webapps\activiti-rest\META-INF\context.xml
二、PostgreSQL
1、PostgreSQL配置
Activiti数据库DDL文件位于activiti-engine-5.17.0.jar\org\activiti\db\create\, 将下列用于PostgreSQL的DDL文件提取保存到某一目录下。
activiti.postgres.create.engine.sql activiti.postgres.create.identity.sql activiti.postgres.create.history.sql
CREATE DATABASE ActivitiDB WITH ENCODING 'UTF8' TEMPLATE=template0; \c ActivitiDB; \i c:/activiti.postgres.create.engine.sql; \i c:/activiti.postgres.create.identity.sql; \i c:/activiti.postgres.create.history.sql;
删除下列MyBatis配置文件:
apache-tomcat-7\webapps\activiti-explorer\WEB-INF\classes\db.properties apache-tomcat-7\webapps\activiti-rest\WEB-INF\classes\db.properties
apache-tomcat-7\webapps\activiti-explorer\WEB-INF\classes\activiti-custom-context.xml apache-tomcat-7\webapps\activiti-rest\WEB-INF\classes\activiti-custom-context.xml
修改下列Tomcat上下文,配置Tomcat JNDI资源:
apache-tomcat-7\webapps\activiti-explorer\META-INF\context.xml
apache-tomcat-7\webapps\activiti-rest\META-INF\context.xml
完毕!