网路冷眼@BlogJava

熙熙攘攘一闲人 以冷静的眼光观察技术
posts - 88, comments - 193, trackbacks - 0, articles - 28
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Chapter 18. JBPM Migration(JBPM 迁移)

Table of Contents

目录表

Database migration

数据迁移

Process conversion

流程转换

Extend the migration logic

扩展迁移逻辑

The jBPM migration is considered [EXPERIMENTAL].

jBPM迁移仅作[EXPERIMENTAL]之用。

It is possible to migrate an existing installation of jBPM version 3 to Activiti. The migration includes both process definition conversion (ie. from JPDL 3 to BPMN 2.0) and data migration.

将一个已安装的jBPM 版本3迁移到Activiti是有可能的。迁移包括流程定义转换(例如从JPDL3到BPMN 2.0)和数据迁移。

The migration tool is currently offered as a 'preview' only! The migration coverage is at this point in time not sufficient to be usable on production process definitions and databases. Also note that the migration is a 'best effort', which means that you may need to extend the migration logic to cover all your use cases.

迁移工具目前只作为‘预览’之用!当前迁移不能覆盖到产品的流程定义和数据。也要注意迁移是‘最大的努力’,这意味着你可以需要‘扩展迁移逻辑’来控制你所有的用例。

The migration tool is separately availbale as a zip file from the activiti.org download site. Once you have unzipped this file, you will see following files and folders:

迁移工具从activiti.org下载站点以zip文件方式分开下载。一旦加压这个文件,文件和文件夹如下所示:

clip_image002

  • build.xml: This ant buildfile contains the targets to execute the process definition conversion and database migration.
  • build.xml: 这个ant构建文件包含了执行流程定义转换和数据库迁移的目标。
  • activiti.db.properties and jbpm3.db.properties: these properties files contain the database connection parameters for the jBPM 3 and Activiti database. These properties files must be changed when executing a database migration.
  • activiti.db.properties and jbpm3.db.properties:这个特性文件包含了jBPM和Activiti数据库的数据库连接参数。当执行数据库迁移时,必须改变这些特性文件。
  • processes: when running a process definition conversion, the jBPM 3 process definition files must be placed in this folder.
  • processes:当运行流程定义转换时,jBPM3流程定义文件必须放置到这个文件夹。
  • src: this folder contains the source code of the migration tool. Read the extension section if you want to tailor or extend the migration code to your needs.
  • src:这个文件包含迁移工具的源代码。如果希望裁剪或者扩展迁移代码满足你自己的需求,请阅读扩展部分。
  • lib: this folder contains all jars required to execute the migration logic.
  • lib:这个文件夹包含执行迁移逻辑的全部jar包。

Database migration

数据库迁移

It is possible to migrate the data in the jBPM 3 database tables to the Activiti database schema. To do this, following properties files must be changed to point at the right database:

将jBPM3数据库表迁移到Activiti数据库schema是有可能的。为了完成这个任务,必须改变下面的properties文件,指向正确的数据库:

  • jbpm3.db.properties: contains the parameters to connect to the jBPM 3 database. Also the Hibernate dialect must be provided.
  • jbpm3.db.properties:包含了连接jBPM3数据库的参数。也必须提供Hibernate方言。
  • activiti.db.properties: contains the parameters to connect to database to which the migrated data will be written. This can be the same database schema as the jBPM schema (ie. there are no name-clashes between jBPM and Activiti tables, indexes, foreign keyes, etc).
  • activiti.db.properties: 包含了迁移将要写入数据库的连接参数。这个可能是和jBPM相同数据库schema(例如,在jBPM和Activiti数据库表名,索引名,外键名等等没有冲突).

The database migration will use the data in the jBPM 3 tables to:

数据迁移将使用jBPM3数据库表的数据来做:

  • Convert the process definition to the BPMN 2.0 counterpart. This means that the converted process definition will be deployed to the Activiti tables as part of the migration. As a side-effect, it will also produce the BPMN 2.0 XML files, similar to what happens when executing theprocess conversion.
  • 转换流程定义为BPMN 2.0对应物。这意味着转换之后的流程定义将作为迁移的一部分被部署到Activiti的数据库表。作为副作用,它也产生BPMN 2.0 XML文件,这和当执行流程转换时所发生的事相似。
  • Migrate runtime and history data of the processes to the Activiti tables. In this release, this is not yet implemented!
  • 迁移流程的运行时和历史数据到Activiti数据库表。本次发布,这没有实现!

The data is retrieved from the jBPM 3 tables using Hibernate queries and the Hibernate mappings of jBPM itself.

使用Hibernate查询和jBPM自身的Hibernate映

射,可以从jBPM 3数据库表里检索到这些数据。

Process conversion

流程转换

It is possible to only convert the process definitions xml from JPDL to BPMN 2.0 that can be executed on the Activiti engine. To do this, place the jBPM 3 processes inside the processes folder. There can be any number of (nested) subfolders, the tool will scan every (sub)folder inside processes to discover processdefinition.xml files (file name must be processdefinition.xml!).

只将JPDL的流程定义xml转换为能在Activiti引擎执行的BPMN 2.0是有可能的。为了完成这个任务,请将jBPM 3放置到process 文件夹。可以有任何数量(内置)子文件夹,工具将扫描process每个(子)文件夹,来发现processdefinition.xml文件(文件名必须是processfinition.xml!)。

migration.processes.location

The discovered processes will be parsed and deployed to an in-memory databse, such that the logic of reverse engineering the process definition from the jBPM deployment tables contained in the database migration is used for both cases.

被发现的流程将被解析并部署到一个内存数据库,以便对包含在数据库迁移的jBPM部署数据库表的流程定义进行反向工程,以为解析和部署之用。

Once the jBPM 3 processes are placed in the processes folder, execute the convert.processes target in the root of the unzipped migration tool folder:

一旦jBPM 3流程被放置到process文件夹,那么执行在解压之后的迁移工具文件夹根目录下的convert.processes目标。

ant convert.processes

migration.ant.convert.processes

During conversion, you will see plenty logging passing by describing where and how the process conversion is being executed. At the end of the conversion, you will see following logging appear:

在转换过程中,通过描述流程转换执行是何地和何时转换的方式,可以观察到大量的日志。在转换的末尾,将观察到下列日志出现:

migration.process.conversion.completed

As shown in the logging, the resulting BPMN 2.0 processes can be find in the converted-process-xxxx folder, where the xxxx is the timestamp of the conversion.

正如日志所示,BPMN 2.0流程的结果可以在converted-process-xxxx文件夹里找到,这里xxxx是转换的时间戳。

In this release, only limited support for start, end, wait state and task-nodes is implemented. In the future, this coverage will expand.

在本次发布里,只实现了对开始,结束,等待和任务节点的有限支持。在将来,这个覆盖范围将要扩充。


只有注册用户登录后才能发表评论。


网站导航: