Springboot集成flowable工作流

文章讲述了在Springboot3.1.5版本中集成Flowable7.0.1时遇到的初始化表结构异常,原因是MySQL8.x及以上版本的驱动使用schema标识库名导致的。为解决此问题,需在数据库URL中添加`nullCatalogMeansCurrent=true`。文章最后提到flowable的基础构建已完成,后续将进行持续更新。
摘要由CSDN通过智能技术生成

概要

Spirng boot 集成flowable

<spring-boot.version>3.1.5</spring-boot.version>

包依赖

<dependency>
   <groupId>org.flowable</groupId>
   <artifactId>flowable-spring-boot-starter</artifactId>
   <version>7.0.1</version>
</dependency>

使用7.0.1版本

问题

项目启动初始化flowable 表结构异常.
原因如下:

mysql8.xxx以上驱动会出现这个问题
mysql使用schema标识库名而不是catalog,因此mysql会扫描所有的库来找表,如果其他库中有相同名称的表,floable就以为找到了,本质上这个表在当前数据库中并不存在。
设置nullCatalogMeansCurrent=true,表示mysql默认当前数据库操作,在mysql-connector-java 5.xxx该参数默认为true,在6.xxx以上默认为false,因此需要设置nullCatalogMeansCurrent=true。

数据库url连接增加

&nullCatalogMeansCurrent=true

在这里插入图片描述
如上70张表初始化完成!

小结

flowable 基础工作构建完成,其他持续更新

  • 9
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
集成 Flowable 可以让 Spring Boot 应用程序具有工作流功能。下面是在 Spring Boot集成 Flowable 的步骤: 1. 添加依赖。在 pom.xml 文件中添加以下依赖: ``` <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-spring-boot-starter</artifactId> <version>6.5.0</version> </dependency> ``` 2. 配置数据源。在 application.properties 文件中添加以下配置: ``` spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/flowable?useUnicode=true&characterEncoding=utf-8 spring.datasource.username=root spring.datasource.password=root ``` 3. 创建流程定义。在 resources 目录下创建一个名为 processes 的目录,然后在该目录下创建一个名为 myprocess.bpmn20.xml 的文件,该文件包含要创建的流程定义。 4. 创建 Service。创建一个名为 MyService 的类,并在该类中添加以下代码: ``` @Service public class MyService { @Autowired private RuntimeService runtimeService; public void startProcess(String processDefinitionKey) { runtimeService.startProcessInstanceByKey(processDefinitionKey); } } ``` 5. 创建 Controller。创建一个名为 MyController 的类,并在该类中添加以下代码: ``` @RestController @RequestMapping("/my") public class MyController { @Autowired private MyService myService; @PostMapping("/start-process") public void startProcess(@RequestParam("processDefinitionKey") String processDefinitionKey) { myService.startProcess(processDefinitionKey); } } ``` 6. 启动应用程序。运行 Spring Boot 应用程序。 现在,您已经成功在 Spring Boot集成Flowable,并可以使用工作流功能。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值