wiki-files/wg-basic/activiti.md

64 lines
2.0 KiB
Markdown
Raw Normal View History

2021-09-01 17:28:33 +08:00
---
2021-09-01 17:54:48 +08:00
title: 6.流程引擎模块
description: activiti流程引擎模块的使用
2021-09-01 17:28:33 +08:00
published: true
2021-09-01 22:20:48 +08:00
date: 2021-09-01T14:20:46.796Z
2021-09-01 17:28:33 +08:00
tags: wg-basic, activiti
editor: markdown
dateCreated: 2021-09-01T09:28:31.684Z
---
# 说明
流程引擎模块引入了 **activiti** 框架,目前可以完成流程的绘制、部署与流程图的查看。模块自带流程绘制功能,无需再使用插件绘制流程文件。
该模块需要手动添加管理菜案
# 依赖
```xml
<dependency>
<groupId>ink.wgink</groupId>
<artifactId>module-activiti</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
```
# 配置说明
```yaml
spring:
2021-09-01 22:20:48 +08:00
# 流程引擎
2021-09-01 17:28:33 +08:00
activiti:
# flase 默认值。activiti在启动时会对比数据库表中保存的版本如果没有表或者版本不匹配将抛出异常。
# true activiti会对数据库中所有表进行更新操作。如果表不存在则自动创建。
# create_drop 在activiti启动时创建表在关闭时删除表必须手动关闭引擎才能删除表
# drop-create 在activiti启动时删除原来的旧表然后在创建新表不需要手动关闭引擎
database-schema-update: true
#检测历史表是否存在
db-history-used: true
# 记录历史等级 可配置的历史级别有none, acitivity, audit, all
history-level: full
# 检查流程定义
check-process-definitions: false
rest-api-enabled: true
rest-api-servlet-name: activiti-swagger-document
SpringProcessEngineConfiguration:
activityFontName: 宋体
labelFontName: 宋体
dataSource: datasource
```
注意:`spring.datasource.druid` 配置中需要添加 **nullCatalogMeansCurrent=true** 参数用于防止项目启动自动建表失败的
2021-09-01 22:17:45 +08:00
# 启动类
启动类需要增加配置
2021-09-01 22:17:53 +08:00
`@SpringBootApplication` 注解增加 `exclude=SecurityAutoConfiguration.class`
2021-09-01 22:17:45 +08:00
```
@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
```
2021-09-01 17:28:33 +08:00
# 添加菜单
菜单路径为:`/route/activiti/list`