springboot2.1.6整合activiti6.0

Posted hmxs

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了springboot2.1.6整合activiti6.0相关的知识,希望对你有一定的参考价值。

一、pom

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.badcat</groupId>
  <artifactId>activiti_demo</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  
  <name>activiti_demo</name>
  <description>springboot2.1.6整合activiti6.0</description>
  
  <parent>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>2.1.6.RELEASE</version>
      <relativePath/> <!-- lookup parent from repository -->
  </parent>
  
  <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
      <java.version>1.8</java.version>
      <maven-jar-plugin.version>3.0.0</maven-jar-plugin.version>
      <druid.version>1.1.14</druid.version>
      <mysql.version>8.0.16</mysql.version>
      <activiti.starter.version>6.0.0</activiti.starter.version>
  </properties>
  
  <dependencies>
  
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>
    
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    
    <!--阿里数据库连接池 -->
    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>druid-spring-boot-starter</artifactId>
        <version>${druid.version}</version>
    </dependency>
    
    <!-- mysql -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>${mysql.version}</version>
    </dependency>
    
    <!-- activiti -->
    <dependency>
        <groupId>org.activiti</groupId>
        <artifactId>activiti-spring-boot-starter-basic</artifactId>
        <version>${activiti.starter.version}</version>
    </dependency>
  </dependencies>
</project>

二、application.properties

server.port=8087
server.tomcat.uri-encoding=UTF-8

spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.url = jdbc:mysql://localhost/activiti?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
spring.datasource.username = root
spring.datasource.password = 111111
spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver

spring.datasource.initialSize=5
spring.datasource.minIdle=5
spring.datasource.maxActive=20
spring.datasource.maxWait=60000
spring.datasource.timeBetweenEvictionRunsMillis=60000
spring.datasource.minEvictableIdleTimeMillis=300000
spring.datasource.validationQuery=SELECT 1 FROM DUAL
spring.datasource.testWhileIdle=true
spring.datasource.testOnBorrow=false
spring.datasource.testOnReturn=false
spring.datasource.poolPreparedStatements=true
spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
spring.datasource.filters=stat,wall
spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000


spring.activiti.check-process-definitions=false

三、Aplication.java

注意:@SpringBootApplication  后添加   exclude = {SecurityAutoConfiguration.class }

package com.badcat;


import org.activiti.spring.boot.SecurityAutoConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
    * 启动程序
 */
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class })
public class Application
{
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

 

四、运行Aplication.java,发现数据库多出了28张表

技术图片

 

以上是关于springboot2.1.6整合activiti6.0的主要内容,如果未能解决你的问题,请参考以下文章

SpringBoot2.1.6 整合CXF 实现Webservice

求一套spring boot视频教程

SpringBoot整合RocketMQ

Activiti工作流引擎整合系列收藏可做笔记系列

springboot怎么整合activiti

spring activiti 整合为啥要用它自带的表