37. Springboot integrates flowable

Time:2020-11-28

Workflow is an indispensable part of OA system. This paper introduces a new workflow engine flowable. Flowable is a new workflow engine created by the original author of activiti, a famous Java workflow engine. Flowable is a business process management (BPM) and workflow system for developers and system administrators. Its core is ultra fast and stable BPMN2 process introduction; it is easy to integrate with spring.

1. Flowable designer flowable designer installation
Download address:


https://blog.flowable.org/2016/11/01/flowable-eclipse-designer-5-22-0-release/

37. Springboot integrates flowable
Online installation address:

http://flowable.org/designer/update

Offline installation package address:

http://www.flowable.org/designer/archived/flowable-designer-5.22.0.zip

37. Springboot integrates flowable
2. New project SC flowable, corresponding to pom.xml The documents are as follows

<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.flowable</groupId>
    <artifactId>sc-flowable</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>sc-flowable</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.4.RELEASE</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <! -- hikaricp connection pool dependency -- >
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
        </dependency>
        <dependency>
            <groupId>org.flowable</groupId>
            <artifactId>flowable-spring-boot-starter-basic</artifactId>
            <version>6.4.0</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j2</artifactId>
        </dependency>
    </dependencies>
</project>

3. New profile application.yml

spring:
  datasource:
    driver-class-name : com.mysql.jdbc.Driver
    url: jdbc:mysql://127.0.0.1:3306/flowable?characterEncoding=UTF-8
    username: root
    password: root
logging:
  level:
    ROOT: info
flowable:
  #Close scheduled task job
  async-executor-activate: false
  #Set databaseschemaupdate to true. When flowable finds that the structure of the database table is inconsistent with that of the database table, it will automatically upgrade the database table structure to the new version.
  database-schema-update: true

The address, user name and password of the main configuration database in the configuration file

4. Create a new springboot boot class

package com.flowable;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class FlowableApplication {

    public static void main(String[] args) {
        SpringApplication.run(FlowableApplication.class, args);
    }

}

5. Verify that the integration of flowable is successful
After operation FlowableApplication.java During this period, there is no exception information; when you view the database, the flowable related table structure has been automatically generated
37. Springboot integrates flowable