(二)Activiti之用activiti.cfg.xml配置文件初始化表
一、案例
- 本章案例使用activiti 5.19.0.2版本
1.1 引入maven依赖
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency> <dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
<version>5.19.0.2</version>
</dependency> <dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring</artifactId>
<version>5.19.0.2</version>
</dependency> <dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-bpmn-model</artifactId>
<version>5.19.0.2</version>
</dependency> <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version>
</dependency> <dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.0</version>
<scope>provided</scope>
</dependency> </dependencies>
1.2 初始化
public class App
{ @Test
public void testCreateTable() {
ProcessEngineConfiguration pec=ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml");
ProcessEngine pe=pec.buildProcessEngine();
}
}
1.3 配置activiti.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
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"> <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration"> <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/db_activiti" />
<property name="jdbcDriver" value="com.mysql.jdbc.Driver" />
<property name="jdbcUsername" value="root" />
<property name="jdbcPassword" value="" />
<!-- 配置模式 true 自动创建和更新表 -->
<property name="databaseSchemaUpdate" value="true" /> </bean> </beans>
1.4 执行以及结果

- 如图activiti 5.19.0.2版本的共生成了25张表,6.0.0好像会生成28张表。
- 上图中表的用途:
- ACT_RE_*: 'RE'表示repository。 这个前缀的表包含了流程定义和流程静态资源 (图片,规则,等等)。
- ACT_RU_*: 'RU'表示runtime。 这些运行时的表,包含流程实例,任务,变量,异步任务,等运行中的数据。 Activiti只在流程实例执行过程中保存这些数据, 在流程结束时就会删除这些记录。 这样运行时表可以一直很小速度很快。
- ACT_ID_*: 'ID'表示identity。 这些表包含身份信息,比如用户,组等等。
- ACT_HI_*: 'HI'表示history。 这些表包含历史数据,比如历史流程实例, 变量,任务等等。
- ACT_GE_*: 'GE'表示general。通用数据, 用于不同场景下,如存放资源文件。
(二)Activiti之用activiti.cfg.xml配置文件初始化表的更多相关文章
- web服务器专题:tomcat(二)模块组件与server.xml 配置文件
web服务器专题:tomcat(二)模块组件与server.xml 配置文件 回顾: Web服务器专题:tomcat(一) 基础模块 一个Server.xml的实例 <?xml version= ...
- hibernate.cfg.xml配置文件对关联关系的书写技巧!
以Department(部门类)和User(用户类)作为例子: 类图如下: 一般hibernate.cfg.xml的配置文件开头都是如下: <?xml version="1.0&quo ...
- hibernate.cfg.xml配置文件和hbm.xml配置文件
http://blog.sina.com.cn/s/blog_a7b8ab2801014m0e.html hibernate.cfg.xml配置文件格式 <?xml version=" ...
- hibernate.cfg.xml配置文件和hbm.xml配置文件 模板
hibernate.cfg.xml配置文件格式 <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE ...
- 给Eclipse中hibernate.cfg.xml配置文件加提示
在hibernate框架需要的jar包中找到hibernate3.jar,并用压缩软件打开,如图: 2 选择org文件夹--打开下一级文件夹 3 点击类型,方便找到dtd文件,下拉查看dtd文件,有两 ...
- Hibernate之通过hibernate.cfg.xml配置文件访问数据库的例子
hibernate.cfg.xml文件内容: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ...
- Hibernate3.5.4---java application的xml和annotation环境搭建(hibernate.cfg.xml配置文件说明,映射文件Student.hbm.xml说明
http://blog.csdn.net/centre10/article/details/6050466 来自于:http://blog.csdn.net/centre10/article/deta ...
- 模拟Spring中applicationContext.xml配置文件初始化bean的过程
package com.xiaohao.action; import java.io.File; import java.lang.reflect.Method; import java.util.C ...
- [Hibernate] hibernate.cfg.xml 配置文件的一些设置
<!-- 消除:Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect. ...
随机推荐
- js的一些笔试面试题
1. 判断字符串是否是这样组成的,第一个必须是字母,后面可以是字母.数字.下划线,总长度为5-20 var reg = /^[a-zA-Z][a-zA-Z_0-9]{4,19}$/; reg.test ...
- 完全基于卷积神经网络的seq2seq
本文参考文献: Gehring J, Auli M, Grangier D, et al. Convolutional Sequence to Sequence Learning[J]. arXiv ...
- tornado异步请求响应速度的实例测试
tornado异步请求响应速度的实例测试
- angular 中父子路由
1. 创建组件引入组件 import { NewsaddComponent } from './components/newsadd/newsadd.component'; import { News ...
- django模型多对多调用
对于如下的模型: from django.db import models # Create your models here. class Student(models.Model): name = ...
- Spring为什么@Autowired注入的是接口
1.Spring怎么知道注入哪个实现? As long as there is only a single implementation of the interface and that imple ...
- Linux -- GCC Built-in functions for atomic memory access
下列内建函数旨在兼容Intel Itanium Processor-specific Application Binary Interface, section 7.4. 因此,这些函数区别于普通的G ...
- PAT 甲级 1034 Head of a Gang (30 分)(bfs,map,强连通)
1034 Head of a Gang (30 分) One way that the police finds the head of a gang is to check people's p ...
- Ubuntu 16.04 haproxy 简单配置应用
HAproxy HAProxy是一个使用C语言编写的自由及开放源代码软件,其提供高可用性.负载均衡,以及基于TCP和HTTP的应用程序代理. 测试环境 ubuntu16.04 192.168.20 ...
- 【ARTS】01_35_左耳听风-201900708~201900714
ARTS: Algrothm: leetcode算法题目 Review: 阅读并且点评一篇英文技术文章 Tip/Techni: 学习一个技术技巧 Share: 分享一篇有观点和思考的技术文章 Algo ...