欢迎来到代码驿站!

JAVA代码

当前位置:首页 > 软件编程 > JAVA代码

Springboot集成Camunda使用Mysql介绍

时间:2022-03-01 10:19:14|栏目:JAVA代码|点击:

一、匹配版本

基于Camunda 7.16.0 + Springboot 2.5.8

首先我们去官网找到camunda7.16对应的springboot版本。camunda官网

使用camunda流程引擎、web界面、Rest服务接口相应依赖如下:

流程引擎:camunda-bpm-spring-boot-starterRest服务接口:camunda-bpm-spring-boot-starter-restweb界面模块:camunda-bpm-spring-boot-starter-webapp

<dependency>
    <groupId>org.camunda.bpm.springboot</groupId>
    <artifactId>camunda-bpm-spring-boot-starter</artifactId>
    <version>7.16.0</version>
</dependency>
<dependency>
    <groupId>org.camunda.bpm.springboot</groupId>
    <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
    <version>7.16.0</version>
</dependency>
<dependency>
    <groupId>org.camunda.bpm.springboot</groupId>
    <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
    <version>7.16.0</version>
</dependency>

二、相关配置

首先新建一个数据库

 再新建一个Springboot项目,引入相关的场景启动器

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>        
        <dependency>
            <groupId>org.camunda.bpm.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter</artifactId>
            <version>7.16.0</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>2.1.3</version>
        </dependency>

新建application.yml文件【注意修改数据库名,数据库用户名和密码等值

spring:
  datasource:
    url: jdbc:mysql://127.0.0.1:3306/snail?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false
    driver-class-name: com.mysql.cj.jdbc.Driver
    username: root
    password: 1234
  application:
    name: snail-workflow
 
camunda.bpm:
  # 配置账户密码来访问Camunda自带的管理界面
  admin-user:
    id: demo
    password: demo
    firstName: Demo
  filter:
    create: All tasks
  #禁止自动部署resources下面的bpmn文件
  auto-deployment-enabled: false
  #禁止index跳转到Camunda自带的管理界面,默认true
  #    webapp:
  #      index-redirect-enabled: false

直接启动项目后,就可以看到数据库已经生成了49张表

ACT_RE_*:RE代表存repository。带有此前缀的表包含“静态”信息,例如流程定义和流程资源(图像、规则等)。

ACT_RU_*:RU代表runtime。这些是运行时表,包含流程实例、用户任务、变量、作业等的运行时数据。引擎仅在流程实例执行期间存储运行时数据,并在流程实例结束时删除记录。这使运行时表既小又快。

ACT_ID_*:ID代表identity。这些表包含身份信息,例如用户、组等。

ACT_HI_*:HI代表history。这些是包含历史数据的表,例如过去的流程实例、变量、任务等。

ACT_GE_*:GE代表 general一般数据,用于各种用例

总结

上一篇:Java Spring框架的概述

栏    目:JAVA代码

下一篇:springboot+mybatis plus实现树形结构查询

本文标题:Springboot集成Camunda使用Mysql介绍

本文地址:http://www.codeinn.net/misctech/194934.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有