# jflowable **Repository Path**: xzbd/jflowable ## Basic Information - **Project Name**: jflowable - **Description**: flowable 流程引擎示例 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-01-03 - **Last Updated**: 2024-01-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 简介 该项目是 SpringBoot 与 Flowable 整合的示例项目 # 技术 * SpringBoot 2.7.18 * Flowable 6.8.0 * Mysql 8.0 * Druid 1.2.14 # 问题经验 ### SpringBoot 与 Flowable 整合 当前,最新版 SpringBoot 是 3.2.0 ,最新版 Flowable 是 7.0.0 。 项目选择 SpringBoot:2.7.18 与 Flowable:7.0.0 有以下原因: 1. Flowable:7.0.0 基于 6.x 有很大的变化。7.0.0 之前的版本,Flowable 提供引擎和设计器两部分包。7.0.0 只提供了引擎,其流程设计器默认提供了一个云端设计器,这对于内部项目来说极不友好。 2. Flowable 6.8.0 是 Flowable 6.x 中最后一个稳定版本,提供了完整的引擎和流程设计器,易于项目整合。 3. Flowable 6.x 是基于 SpringBoot 2.x.x 适配的,因此 SpringBoot 也选用了其 2.x 的最后一个稳定版本。 4. Flowable 7.0.0 与 SpringBoot 3.2.0 是完全适配的(已验证,很容易完成整合) ### Flowable 切换 MySQL 数据源 Flowable 6.8.0 切换数据源到 MySQL 时会遇到一些问题。需要在连接时加上 *`&nullCatalogMeansCurrent=true`* 。其配置示例如下: ```yaml # spring: # datasource: # driver-class-name: com.mysql.cj.jdbc.Driver # password: 123456 # username: root # url: jdbc:mysql://localhost:3306/jfdb?serverTimezone=GMT%2B8&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true server: port: 8086 servlet: context-path: /flowable spring: main: allow-bean-definition-overriding: true allow-circular-references: true servlet: multipart: enabled: true max-request-size: 100MB max-file-size: 100MB file-size-threshold: 20MB datasource: druid: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/jfdb?serverTimezone=GMT%2B8&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true username: root password: 123456 initial-size: 20 max-active: 50 min-idle: 20 time-between-eviction-runs-millis: 60000 min-evictable-idle-time-millis: 300000 remove-abandoned-timeout: 1800 remove-abandoned: true validation-query: "select 1" test-while-idle: true test-on-borrow: false test-on-return: false pool-prepared-statements: true max-pool-prepared-statement-per-connection-size: 20 default-auto-commit: false query-timeout: 50 filter: stat: enabled: false slf4j: enabled: true connect-properties: maps: druid.stat.mergeSql: true druid.stat.slowSqlMillis: 10000 stat-view-servlet: url-pattern: /druid/* reset-enable: false login-username: root login-password: 123456 enabled: false allow: "" deny: "" web-stat-filter: enabled: false flowable: database-schema-update: true ``` ### API 使用 Flowable 与 SpringBoot 整合后,Flowable 会将引擎相关 API 自动注入的 IOC 容器,使用时注意导包,这些包一般在 `org.flowable.engine` 下。如: 1. `org.flowable.engine.RuntimeService` 2. `org.flowable.engine.TaskService`