珍惜当下 展望未来!

SpringBoot整合activiti7

SpringBoot整合activiti7

步骤:

1.引入相关依赖

2.创建配置文件

3.创建启动类

4.启动项目,测试

1.引入相关依赖

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.0.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>1


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

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.activiti/activiti-spring-boot-starter -->
        <dependency>
            <groupId>org.activiti</groupId>
            <artifactId>activiti-spring-boot-starter</artifactId>
            <version>7.0.0.Beta2</version>
        </dependency>

        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.4.5</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.27</version>
        </dependency>
    </dependencies>

2.创建配置文件

application.yml

spring:
  datasource:
    url: jdbc:mysql://47.107.93.172:3306/activiti7?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT
    username: root
    password: root
    driver-class-name: com.mysql.jdbc.Driver

  # Activiti 配置  不配置的话只会生成17张表  hi_相关表没有
  activiti:
    database-schema-update: true
    history-level: full
    db-history-used: true

3.创建启动类

@SpringBootApplication
public class Activiti7Application {
    public static void main(String[] args) {
        SpringApplication.run(Activiti7Application.class);
    }
}

4.启动项目,测试

@RunWith(SpringRunner.class)
@SpringBootTest(classes = Activiti7Application.class)
public class ActivitiTest {

    //测试 启动项目就会生成25张表
    @Test
    public void test1(){
        System.out.println(111);
    }
}

posted @ 2022-01-07 16:56  嘿嘿-  阅读(180)  评论(0编辑  收藏  举报