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() == DbType.KINGBASE_ES) { // flowable设置金仓数据库的数据库类型 SpringAppEngineConfiguration appEngineConfiguration = SpringUtils.getBean(SpringAppEngineConfiguration.class); appEngineConfiguration.setDatabaseType(AbstractEngineConfiguration.DATABASE_TYPE_MYSQL); // liquibase添加金仓数据库支持 DatabaseFactory.getInstance().register(new Kingbase8Database()); } } } 3、application.yml 配置文件禁用flowable数据库自动建表# flowable配置 flowable: # 是否自动建表 databaseSchemaUpdate: false 二、springboot3.x + flowable7.1 + kingbase1、flowable配置里设置金仓数据库的数据库类型，根据金仓数据库安装的哪种兼容模式来设置，这里以Mysql为例。import com.baomidou.mybatisplus.annotation.DbType; 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("宋体"); engineConfiguration.setIdGenerator(new DbIdGenerator()); if (DataSourceUtils.getCurrentDbType() == DbType.KINGBASE_ES) { // flowable设置金仓数据库的数据库类型 SpringAppEngineConfiguration appEngineConfiguration = SpringUtils.getBean(SpringAppEngineConfiguration.class); appEngineConfiguration.setDatabaseType(AbstractEngineConfiguration.DATABASE_TYPE_MYSQL); } } } 2、application.yml 配置文件禁用flowable数据库自动建表# flowable配置 flowable: # 是否自动建表 databaseSchemaUpdate: false