activiti兼容达梦数据库

1、继承

SpringProcessEngineConfiguration

重写方法

initDatabaseType(){ 
Connection connection = null;
try {
   connection = dataSource.getConnection();
   DatabaseMetaData databaseMetaData = connection.getMetaData();
   String databaseProductName = databaseMetaData.getDatabaseProductName();
   log.debug("database product name: '{}'", databaseProductName);
   if(databaseProductName.contains("DM DBMS")){
      databaseProductName="Oracle";
   }
   databaseType = databaseTypeMappings.getProperty(databaseProductName);

   if (databaseType==null) {
      throw new ActivitiException("couldn't deduct database type from database product name '"+databaseProductName+"'");
   }
   log.debug("using database type: {}", databaseType);

} catch (SQLException e) {
   log.error("Exception while initializing Database connection", e);
} finally {
   try {
      if (connection!=null) {
         connection.close();
      }
   } catch (SQLException e) {
      log.error("Exception while closing the Database connection", e);
   }
}

}

2、修改activiti启动配置项

/*
 *    Copyright (c) 2018-2025, armycloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: armycloud
 */

package com.sourcedance.armycloud.act.config;

import lombok.AllArgsConstructor;
import org.activiti.spring.SpringProcessEngineConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.transaction.PlatformTransactionManager;

import javax.sql.DataSource;

/**
 * @author armycloud
 * @date 2018/9/25 Activiti 配置
 */
@Configuration
@AllArgsConstructor
public class ActivitiConfiguration {

   private final DataSource dataSource;

   private final PlatformTransactionManager transactionManager;

   @Bean
   public SpringProcessEngineConfiguration getProcessEngineConfiguration() {
      SpringProcessEngineConfiguration config = new ProcessEngineConfigurationImpl();
      // 流程图字体设置
      config.setActivityFontName("宋体");
      config.setAnnotationFontName("宋体");
      config.setLabelFontName("黑体");

      config.setDataSource(dataSource);
      config.setTransactionManager(transactionManager);
      config.setDatabaseSchemaUpdate("true");
      return config;
   }

   @Bean
   @Primary
   public TaskExecutor primaryTaskExecutor() {
      return new ThreadPoolTaskExecutor();
   }

}

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
是的,Activiti 5.2.2 可以兼容达梦数据库Activiti 是一个轻量级的开源工作流引擎,它支持与不同的关系型数据库进行集成。达梦数据库是一种关系型数据库管理系统,它拥有自己的特定规范和语法。 为了使 Activiti 兼容达梦数据库,您需要完成以下步骤: 1. 首先,您需要下载并安装适用于 Activiti 的达梦 JDBC 驱动程序。您可以在达梦官方网站上找到该驱动程序的下载链接。 2. 安装完驱动程序后,您需要在 Activiti 的配置文件中进行一些必要的更改。在 Activiti 的配置文件中,您需要指定使用达梦数据库和相应的连接信息,如数据库 URL、用户名和密码等。您还需要将达梦数据库的驱动类路径配置在 Activiti 的类路径中。 3. 此外,您还需要确保 Activiti 的版本与所使用的达梦 JDBC 驱动程序兼容。为了解决潜在的兼容性问题,您可以查阅 Activiti达梦数据库的官方文档,以获得更多关于版本兼容性的信息。 完成上述步骤后,您应该能够将 Activiti 集成到达梦数据库中,并使用其提供的工作流功能。请注意,在使用达梦数据库之前,您需要熟悉该数据库的语法和特性,以确保您的操作能够顺利进行。 总而言之,Activiti 5.2.2 可以兼容达梦数据库,但在集成和使用过程中可能需要注意一些细节,如安装适用于 Activiti 的达梦 JDBC 驱动程序、配置数据库连接信息等。通过正确完成这些步骤,您应该能够顺利地将 Activiti达梦数据库集成,并使用其提供的工作流引擎功能。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值