1、导包 pom.xml
4.0.0 org.springframework.boot spring-boot-starter-parent1.5.9.RELEASE com.example demo0.0.1-SNAPSHOT demo Demo project for Spring Boot war 1.8 UTF-8 UTF-8 org.springframework.boot spring-boot-starter-weborg.activiti activiti-spring-boot-starter-basic6.0.0 org.springframework.boot spring-boot-starter-data-jpaorg.springframework.boot spring-boot-starter-thymeleaforg.springframework.boot spring-boot-starter-testtest org.activiti activiti-engine6.0.0 org.slf4j slf4j-api1.7.21 org.slf4j slf4j-log4j121.7.21 mysql mysql-connector-java5.1.46 mysql mysql-connector-javaorg.springframework.boot spring-boot-starter-tomcatcom.alibaba fastjson1.2.41 org.projectlombok lombok1.16.20 provided org.springframework.boot spring-boot-maven-pluginorg.apache.tomcat.maven tomcat7-maven-plugin8080 /activity 4000
2、环境配置 application.yml
spring:
activiti:
check-process-definitions: true #自动检查、部署流程定义文件
database-schema-update: true #自动更新数据库结构
history-level: full #保存历史数据级别设置为full最高级别,便于历史数据的追溯 还有两个级别activity与none
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/activiti-test?useUnicode=true&characterEncoding=utf-8&nullCatalogMeansCurrent=true
username: root
password: root
表生成后 要将 check-process-definitions: true 改成FALSE
3、启动类
package com.bzyc.activiti;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration;
@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
public class ActivitiApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
启动后,刷新数据库会在数据库生成28张表



