springboot集成flowable出现的问题

当在MySQL5.6中启动项目时遇到Specifiedkeywastoolong错误,原因为使用了utf8mb4字符集。问题解决方法是将字符集更改为之前的utf8。可能涉及索引长度限制。
摘要由CSDN通过智能技术生成

使用数据库mysql5.6时,启动项目,报错
出现问题:
Specified key was too long; max key length is 767 bytes。

刚开始以为是flowable出了问题,但是代码都没变,只是换了个数据库,
突然想起,建库时字符集选了utf8mb4 – UTF-8 Unicode
以前的库是utf8 – UTF-8 Unicode,换回来后,问题解决。
注:不知道时不时索引长度限制问题。

  • 9
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 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、付费专栏及课程。

余额充值