已有的项目中添加流程控制,activiti6.0基于springboot2.0开发部署及mybatisplus3.2.0,及遇到的问题

本文介绍了在已有SpringBoot2.0项目中集成Activiti6.0进行流程控制的步骤,包括添加依赖、配置数据源和流程图绘制。在集成过程中遇到与MybatisPlus3.2.0版本冲突的问题,原因是Activiti使用的Mybatis版本与MybatisPlus不兼容。通过排除Mybatis解决了冲突,最终成功启动项目并在数据库中看到生成的28个表。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 下载activiti插件(我用的是eclipse开发工具)
在这里插入图片描述
新建项目时出现上面的就证明安装成功了,这里不具体记录了;安装成功就可以画流程图了;
2. 打开已有的项目,在pom.xml中添加activiti依赖jar包;

<dependency>
			<groupId>org.activiti</groupId>
			<artifactId>activiti-spring-boot-starter-basic</artifactId>
			<version>6.0.0</version>
		</dependency>

3. 配置数据源及activiti配置(在yml文件中)如下:

#配置数据源的属性
spring:
  datasource:
    druid:
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://localhost:3306/jtts?useSSL=false&serverTimezone=Hongkong&characterEncoding=utf-8&nullCatalogMeansCurrent=true&autoReconnect=true
      username: root
      password: root
      max-active: 20
      max-wait: 5000
      initial-size: 1
      filters: stat,log4j,wall
      validationQuery: SELECT 'x'   #验证连接
      enable: true
     # activiti 流程控制默认配置
  activiti:
    check-process-definitions: true  #自动检查,部署流程定义文件
    database-schema-update: true #自动更新数据库结构
    process-definition-location-prefix: classpath:/processes/  #流程定义文件存放目录 

4. 在启动类中springbootApplication()加入这句:是排除掉这个类的意思;

@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
@MapperScan(basePackages= {"com.jtts.*.mapper"})
public class ChangKuApplication {
	public static void main(String[] args) {
	SpringApplication.run(ChangKuApplication.class, args);
}

5. 在项目中添加,画流程图
在这里插入图片描述
在这里插入图片描述

**

问题:

**
启动springboot项目,启动不成功,报错:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-12-23 23:05:45.302 ERROR 19168 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    com.baomidou.mybatisplus.core.MybatisMapperAnnotationBuilder.getLanguageDriver(MybatisMapperAnnotationBuilder.java:369)

原因: 主要是jar包版本冲突.(activiti6.0.0版本与mybatisplus3.2.0版本冲突)
因为: mybatisPlus我用的是3.2.0,而activiti用的是mybatis3.4.2,两边有冲突。
解决办法就是去除mybatis,如下:

<dependency>
			<groupId>org.activiti</groupId>
			<artifactId>activiti-spring-boot-starter-basic</artifactId>
			<version>6.0.0</version>
			 <exclusions>
                <exclusion>
                    <groupId>org.mybatis</groupId>
                    <artifactId>mybatis</artifactId>
                </exclusion>
            </exclusions>
		</dependency>

重新启动成功了,登录数据库发现了28个表;OK;
springboot2与activiti6之间也有很多坑,遇到了在记录一下;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值