??xml version="1.0" encoding="utf-8" standalone="yes"?>
扩展q移逻辑
The migration logic is written in such a way, that it is easy to extend to suit your needs. The source code is available as a Maven 2 project in the srcsubfolder of the downloaded zip file. To build a new zip file, after having changed or extended the logic, simply execute a
q移逻辑可以~写Q以便轻村֜满你的需求。源代码在所下蝲zip文g里src子文件夹里作一个Maven 2目来用。ؓ了构Z个新的zip文gQ在已经改变或者扩展逻辑之后Q简单执行下面指?/p>
to produce a new zip file in the target folder.
在target文g下生一个新的zip文g?
Following picture gives a high-level overview of the classes in the migration logic.
下图提供了在q移逻辑里类的高层次概貌?
ServiceFactory.configureFromProperties(jbpmDbProperties, activitiDbProperties);
1 public void execute() throws IOException {
2
3 // convert processes
4 ServiceFactory serviceFactory = createServiceFactory();
5 ProcessConversionService processConversionService = serviceFactory.getProcessConversionService();
6 Map<String, Document> migratedProcesses = processConversionService.convertAllProcessDefinitions();
7
8 // write results to bpmn20.xml files
9 writeConvertedProcesses(migratedProcesses, workingDir);
10
11 // Deploy processes to Activiti
12 ActivitiService activitiService = serviceFactory.getActivitiService();
13 activitiService.deployConvertedProcesses(migratedProcesses);
14
15 // data migration
16
17 }
The ActivitiService offers operation needed to get the migrated data in the Activiti tables. For example, deploying the converted process definitions is such an operation
ProcessConversionService 是一个包含流E{换和数据索的程定义借口。它使用?Jbpm3Dao.的实现。这个类的缺省实C用了Hibernate?strong>SessionFactory从jBPM 3的数据库表里索所有的数据?
ActivitiService 提供需要从Activiti数据库表q移数据的操作。例如,部v转换之后的流E定义就是如此的操作?
1 public ProcessConversionService getProcessConversionService() {2 if (processConversionService == null) {
3 this.processConversionService = createDefaultProcessConversionService();
4 }
5 return processConversionService;
6 }
7
8 protected ProcessConversionService createDefaultProcessConversionService() {
9 ProcessConversionServiceImpl service = new ProcessConversionServiceImpl(getJbpm3Dao());
10 return service;
11 }
Table of Contents
目录?
数据q移
程转换
扩展q移逻辑
The jBPM migration is considered [EXPERIMENTAL].
jBPMq移仅作[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 版本3q移到Activiti是有可能的。迁Ud括流E定义{换(例如从JPDL3到BPMN 2.0Q和数据q移?
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.
q移工具目前只作?#8216;预览’之用Q?/strong>当前q移不能覆盖C品的程定义和数据。也要注意迁UL‘最大的努力’Q这意味着你可以需?#8216;扩展q移逻辑’来控制你所有的用例?
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:
q移工具?a >activiti.org下蝲站点以zip文g方式分开下蝲。一旦加压这个文Ӟ文g和文件夹如下所C:
数据库迁U?/strong>
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数据库表q移到Activiti数据库schema是有可能的。ؓ了完成这个Q务,必须改变下面的properties文gQ指向正的数据库:
The database migration will use the data in the jBPM 3 tables to:
数据q移用jBPM3数据库表的数据来做:
The data is retrieved from the jBPM 3 tables using Hibernate queries and the Hibernate mappings of jBPM itself.
使用Hibernate查询和jBPM自n的Hibernate?
,可以从jBPM 3数据库表里检索到q些数据?
程转换
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的流E定义xml转换在Activiti引擎执行的BPMN 2.0是有可能的。ؓ了完成这个Q务,请将jBPM 3攄到process 文g夏V可以有M数量Q内|)子文件夹Q工具将扫描process每个Q子Q文件夹Q来发现processdefinition.xml文gQ文件名必须是processfinition.xml!Q?
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.
被发现的程被解析q|到一个内存数据库Q以便对包含在数据库q移的jBPM部v数据库表的流E定义进行反向工E,以ؓ解析和部|之用?
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文g夹,那么执行在解压之后的q移工具文gҎ目录下的convert.processes目标?
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:
在{换过E中Q通过描述程转换执行是何地和何时转换的方式,可以观察到大量的日志。在转换的末,观察到下列日志出现Q?
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.
正如日志所C,BPMN 2.0程的结果可以在converted-process-xxxx文g多w扑ֈQ这里xxxx是{换的旉戟?
In this release, only limited support for start, end, wait state and task-nodes is implemented. In the future, this coverage will expand.
在本ơ发布里Q只实现了对开始,l束Q等待和d节点的有限支持。在来Q这个覆盖范围将要扩充?
Grails is a dynamic web application framework built on Java and Groovy, leveraging best of breed APIs from the Java EE sphere including Spring, Hibernate and SiteMesh. Grails brings to Java and Groovy developers the joys of convention-based rapid development while allowing them to leverage their existing knowledge and capitalize on the proven and performant APIs Java developers have been using for years.
Grails 1.3.7 now bundles Groovy 1.7.8.
When Grails logs a stacktrace, the log message may include the names and values of all of the request parameters for the current request. To mask out the values of secure request parameters, specify the parameter names in the grails.exceptionresolver.params.exclude
config property:
grails.exceptionresolver.params.exclude = ['password', 'creditCard']
Request parameter logging may be turned off altogether by setting thegrails.exceptionresolver.logRequestParameters
config property to false
. The default value is true
when the application is running in DEVELOPMENT mode and false
for all other modes.
grails.exceptionresolver.logRequestParameters = false
Table of Contents
OverviewQ概qͼ
Changing the databaseQ变更数据库Q?
Activiti KickStart is a webbased tool to quickly create 'adhoc' business processes using a subset of constructs available to the Activiti engine. KickStart provides a simple UI that doesn't require to learn BPMN or any modeling environment, as it works with concepts that are familiar to every business user. However, the processes that are created using KickStart, are fully BPMN 2.0 compliant and can be used as a starting point for more complex BPM endeavours.
Activiti KickStart的是一个基于Web的工P用Activiti引擎可用的构ӞconstructsQ的子集提供l快速创?#8220;卛_QadhocQ?#8221;的业务流E。Kickstart提供了不必学习BPMN或者Q何徏模环境的单UIQ因为它树立了每个业务用户都熟悉的概c但是,通过KickStart创徏的的程Q是和BPMN 2.0兼容Qƈ可作为更为复杂BPM努力的v炏V?
KickStart integrates perfectly with the Activiti engine. As such, processes created with KickStart are immediataly usable in Activiti Explorer and are visible in Probe.
KickStart能和Activiti引擎完美集成。因此,采用KickStart创徏的流E在Activiti Explorer立即可用Qƈ在Probe里面可见?
KickStart serves many business cases, but the following three are probably the most common:
KickStart服务许多商业案例Q但以下三个可能是最常见Q?
Following screenshots show the capabilities of Activiti KickStart. Take for example the next picture. It shows how an expense process is created in a matter of a few minutes.
下列屏幕截图展示了Activiti KickStart的能力。下图作为示例。它展示如何在几分钟之内创徏一个付ҎE?
After clicking the save button, the process is immediately usable in Activiti Explorer:
在点?#8220;保存”按钮之后Q这个流E立卛_Activiti Explorer可用?
KickStart also allows to define forms for every task:
KickStart也允ؓ每个d定义表单Q?
Which are obviously directly usable in Activiti Explorer:
q些明显直接在Activiti Explorer可用Q?
At any time during process creation, it is possible to view the corresponding BPMN 2.0 diagram of the business process:
在流E徏立的L旉Q它可以查看相应的BPMN2.0业务程图?
Whenever it is required, the processes defined with KickStart can be opened up and modified:
每当它是必需Q与KickStart的定义的程可被打开和修改:
Processes created with KickStart are fully compliant with the BPMN 2.0 XML, which means that the process can be imported into any BPMN 2.0 editor:
用KickStart的创建的程是完全符合BPMN2.0的XMLQ这意味着该流E可以由M兼容的BPMN2.0~辑器输入:
Changing the databaseQ变更数据库Q?/strong>
Activiti KickStart is currently not yet using the REST API, but uses the service API by including the Activiti engine as a library. While Explorer, Probe and Cycle use the same mechanism for changing the database (see here), the same does not yet apply for KickStart.
Activiti KickStart当前q没有用REST APIQ而是通过包括了Activiti引擎作ؓcd使用服务API。虽然ExplorerQProbe和Cycle使用相同的机制改变数据(参见q里Q,但这不适于KickStart?
To change the database that KickStart uses in the demo setup, generate a new activiti.cfg.jar, and place it in the apps/apache-tomcat-6.x/webapps/activiti-kickstart/WEB-INF/lib folder.
Z改变演示安装里KickStart使用的数据库Q生一个新的activiti.cfg.jar,q将它放|到apps/apache-tomcat-6.x/webapps/activiti-kickstart/WEB-INF/lib文g夏V?