码农之家 - 2026年1月
type: channel
link: http://blog.liyx.fun/index.php/2026/01/
description: 我的工作记录
items: flowable 整合 人大金仓数据库

flowable 整合 人大金仓数据库
type: item
date: 2026-01-24T14:51:20+08:00
description: flowable不支持人大金仓数据库，需要做一些自定义处理。一、springboot2.x + flowable6.8 + kingbase1、liquibase金仓数据库支持import liquibase.database.DatabaseConnection; import liquibase.database.core.PostgresDatabase; import liquibase.exception.DatabaseException; /** * liquibase 金仓数据库支持 */ public class Kingbase8Database extends PostgresDatabase { public static final String PRODUCT_NAME = "KingbaseES"; private static final int DEFAULT_TCP_PORT_NUMBER = 54321; @Override public String getShortName() { return "kingbase8"; // 返回一个标识符 } @Override public Integer getDefaultPort() { return DEFAULT_TCP_PORT_NUMBER; } @Override protected String getDefaultDatabaseProductName() { return PRODUCT_NAME; } @Override public boolean isCorrectDatabaseImplementation(DatabaseConnection conn) throws DatabaseException { return PRODUCT_NAME.equalsIgnoreCase(conn.getDatabaseProductName()); } @Override public String getDefaultDriver(String url) { if (url.startsWith("jdbc:kingbase8:")) { return "com.kingbase8.Driver"; } return null; } } 2、flowable配置里设置金仓数据库的数据库类型，根据金仓数据库安装的哪种兼容模式来设置，这里以Mysql为例。liquibase注册金仓数据库支持。import com.baomidou.mybatisplus.annotation.DbType; import liquibase.database.DatabaseFactory; import org.flowable.app.spring.SpringAppEngineConfiguration; import org.flowable.common.engine.impl.AbstractEngineConfiguration; import org.flowable.engine.impl.db.DbIdGenerator; import org.flowable.spring.SpringProcessEngineConfiguration; import org.flowable.spring.boot.EngineConfigurationConfigurer; import org.springframework.context.annotation.Configuration; /** * Flowable配置 */ @Configuration public class FlowableConfig implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> { @Override public void configure(SpringProcessEngineConfiguration engineConfiguration) { engineConfiguration.setActivityFontName("宋体"); engineConfiguration.setLabelFontName("宋体"); engineConfiguration.setAnnotationFontName("宋体"); // 流程id生成处理 engineConfiguration.setIdGenerator(new DbIdGenerator()); if (DataSourceUtils.getCurrentDbType()…