flowable工作流组件在KingbaseES V8中的配置方法

flowable简介

Flowable提供了一个组高效的核心开源业务流程引擎,为开发人员,系统管理员和业务用户提供工作流和业务流程管理(BPM)平台。全部用Java编写,并且基于Apache 2.0许可的开源,代码在社区维护。

Flowable是Activiti(Alfresco持有的注册商标)的fork。包名、配置文件、使用等处两者相似。

目前Flowable已经修复了activiti6很多的bug,可以实现零成本从activiti迁移到flowable。

flowable目前已经支持加签、动态增加实例中的节点、支持cmmn、dmn规范。这些都是activiti6目前版本没有的。

目前,flowable支持mysql、postgreSQL、DB2、Oracle等数据库,官方暂不支持国产数据库KingbaseES。笔者尝试修改flowable 6.4支持了KingbaseES V8,配置方法如下文所述。

下载包flowable-engine-common-6.4.0.jar

支持KingbaseES对此jar包做了修改,需要下载以下链接中的包替换工程中的原始包。

链接:https://pan.baidu.com/s/1umRu1RaAUtdqzf0k2KKvQg
提取码:kd55
复制这段内容后打开百度网盘手机App,操作更方便哦

myeclipse建立测试工程

1、pom.xml配置

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.flowable</groupId>
  <artifactId>HolidayRequest</artifactId>
  <version>1.0-SNAPSHOT</version>
  
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
  	<dependency>
  		<groupId>org.flowable</groupId>
  		<artifactId>flowable-engine</artifactId>
  		<version>6.4.0</version>
  	</dependency>
  	<dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.3.0</version>
    </dependency>
    <dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>3.6</version>
	</dependency>

    <dependency>
    	<groupId>com.kingbase8</groupId>
    	<artifactId>kingbase8</artifactId>
    	<version>8.2.0</version>
    </dependency>
  </dependencies>
</project>

2、测试主程序

package org.flowable;

import org.flowable.engine.ProcessEngine;
import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration;

public class HolidayRequest {
    
    

	public static void main(String[] args) {
    
    
		// TODO Auto-generated method stub
		ProcessEngineConfiguration cfg = new StandaloneProcessEngineConfiguration()
			      .setJdbcUrl("jdbc:kingbase8://192.168.10.128:54321/TEST")
			      .setJdbcUsername("SYSTEM")
			      .setJdbcPassword("111111")
			      .setJdbcDriver("com.kingbase8.Driver")
			      .setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);

			    ProcessEngine processEngine = cfg.buildProcessEngine();
	}

}

3、本地maven仓库导入kingbaseES V8的jdbc驱动
需要在本地仓库上放入KingbaseES V8的JDBC驱动文件,注意目录结构
GroupID是文件目录名字,每一个. 都是一级目录
artifactId 是里面的目录名字
version 是更里面的目录名字
最后文件名构成是 artifactId-version.jar

例如V82的JDBC驱动在pom.xml中配置如下:

<dependency>
       <groupId>com.kingbase8</groupId>
       <artifactId>kingbase8</artifactId>
       <version>8.2.0</version>
    </dependency>

V82的JDBC驱动对应的本地仓库目录:
E:\apache-maven-3.6.1\repository\com\kingbase8\kingbase8\8.2.0

4、经测试flowable相关表可创建成功,程序未报错
在这里插入图片描述

笔者未对flowable功能做全部测试,如查有朋友测出问题,可在下方留言,谢谢!

猜你喜欢

转载自blog.csdn.net/sxqinjh/article/details/105652862