Chapter 6. Deployment
第六章 部署
Table of Contents
Business archives
Deploying programmatically
Deploying with ant
Versioning of process definitions
Business archives
业务档案
To deploy processes, they have to be wrapped in a
business archive. A business archive is the unit of deployment to an Activiti
Engine. Basically a business archive is equivalent to a zip file. It can
contain BPMN 2.0 processes, task forms, rules, java classes and any other type
of file. In general, a business archive contains a collection of named
resources.
为了部署一个流程,你必须将数据打包成一个业务档案。业务档案是Activiti引擎进行部署的一个单元。基本上一个业务档案相当于一个打包文件。它包含了BPMN2.0流程定义,任务表单,规则,java类和其它一些类型的文件。总的来说,一个业务档案包含了一组命名的资源文件。
When a business archive is deployed, it is scanned for
BPMN files with a .bpmn20.xml extension. Each of those will be parsed and potentially contains multiple
process definitions.
当一个业务档案被部署时,流程引擎将首先获取以.bpmn20.xml结尾的BPMN流程配置文件。然后它们会被逐个被解析,有可能它们包含了多个流程定义。
Deploying programmatically
基于程序进行部署
Deploying a business archive from a zip file can be done
like this:
通过一个压缩文件来部署业务档案时,程序大概如下:
String barFileName = "path/to/process-one.bar";
ZipInputStream inputStream = new ZipInputStream(new FileInputStream(barFileName));
repositoryService.createDeployment()
.name("process-one.bar")
.addZipInputStream(inputStream)
.deploy();
It's also possible to build a deployment from individual
resources. See javadocs for more details.
也可以通过独立资源文件进行部署。详细可以参考javadoc。
Deploying with ant
使用ant进行部署
To deploy a business archive with ant, first the deploy-bar task needs to be defined. Make sure that the configuration jar is on the
classpath, as well as the Activiti jar and all its dependencies:
当时有ant进行业务档案部署时,你必须首先定义一个deploy-bar的task,并确认配置文件打包成的jar、Activiti的jar以及所依赖的包存在classpath目录下:
<taskdef name="deploy-bar" classname="org.activiti.engine.impl.ant.DeployBarTask">
<classpath>
<fileset dir="...">
<include name="activiti-cfg.jar"/>
<include name="your-db-driver.jar"/>
</fileset>
<fileset dir="${activiti.home}/lib">
<include name="activiti-engine-${activiti.version}.jar"/>
<include name="ibatis-sqlmap-*.jar"/>
</fileset>
</classpath>
</taskdef>
<deploy-bar file=".../yourprocess.bar" />
Versioning of process definitions
流程定义的版本
BPMN doesn't have a notion of versioning. And that is
good because the executable BPMN process file will probably live in an SVN
repository as part of your development project. Versions of process definitions
are created during deployment. During deployment, Activiti will assign a
version to the ProcessDefinition before it is stored in the Activiti DB.
BPMN本身没有版本概念。这是因为可执行的BPMN流程定义文件或许作为你开发项目的一部分存在SVN仓库中。流程定义的版本是在部署时创建的。当进行流程部署时,Activiti将为ProcessDefinition分配一个版本,然后在存入到数据库中。
For each process definition in a business archive the
following steps are performed to initialize the properties key, version, name and id:
业务档案中的每一个流程定义将按照下面的顺序对key、version、name和id等属性进行初始化:
-
The process id attribute is used as the
process definition key property
-
流程定义的key属性将作为流程id属性
-
The process name attribute is used as the
process definition name property. If the name attribute is not specified, then id attribute
is used as the name.
-
流程定义的name属性作为流程name属性。如果name属性没有指定,那么流程的id值将被赋值给name。
- The first time a process with a particular key is
deployed, version 1 is assigned. For all subsequent deployments of process
definitions with the same key, the version will be set 1 higher then the
max currently deployed version. The key property is used to distinct
process definitions.
-
当流程被首次部署时,version的值将被赋值为1。对于已经部署的流程定义,版本将设置为当前部署版本的最大值+1。Key属性则是用来区分两个不同的流程定义。
- The id property is set to
{processDefinitionKey}:{processDefinitionVersion}
-
Id属性设置为:{processDefinitionKey}:{processDefinitionVersion}
分享到:
相关推荐
赠送jar包:activiti-json-converter-5.21.0.jar; 赠送原API文档:activiti-json-converter-5.21.0-javadoc.jar; 赠送源代码:activiti-json-converter-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-...
这个“activiti-userguide-5-16”压缩包文件包含了 Activiti 5.16 版本的用户指南,帮助我们深入理解并有效使用这个流程管理工具。 1. **BPMN 2.0 规范**:Business Process Model and Notation 2.0(业务流程模型...
赠送jar包:activiti-engine-5.21.0.jar; 赠送原API文档:activiti-engine-5.21.0-javadoc.jar; 赠送源代码:activiti-engine-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-engine-5.21.0.pom; 包含...
赠送jar包:activiti-json-converter-5.21.0.jar; 赠送原API文档:activiti-json-converter-5.21.0-javadoc.jar; 赠送源代码:activiti-json-converter-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-...
赠送jar包:activiti-image-generator-5.21.0.jar; 赠送原API文档:activiti-image-generator-5.21.0-javadoc.jar; 赠送源代码:activiti-image-generator-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-...
赠送jar包:activiti-common-rest-5.21.0.jar; 赠送原API文档:activiti-common-rest-5.21.0-javadoc.jar; 赠送源代码:activiti-common-rest-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-common-rest-...
赠送jar包:activiti-bpmn-model-5.21.0.jar; 赠送原API文档:activiti-bpmn-model-5.21.0-javadoc.jar; 赠送源代码:activiti-bpmn-model-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-bpmn-model-...
赠送jar包:activiti-image-generator-5.21.0.jar; 赠送原API文档:activiti-image-generator-5.21.0-javadoc.jar; 赠送源代码:activiti-image-generator-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-...
activiti-spring-boot-starter-7.1.0.M1
activiti-spring-boot-starter-basic-6.0.0适配springboot2.1.2
activiti-bpmn-converter-5.18.0-sources.jar
赠送jar包:activiti-process-validation-5.21.0.jar; 赠送原API文档:activiti-process-validation-5.21.0-javadoc.jar; 赠送源代码:activiti-process-validation-5.21.0-sources.jar; 赠送Maven依赖信息文件:...
赠送jar包:activiti-bpmn-converter-5.21.0.jar; 赠送原API文档:activiti-bpmn-converter-5.21.0-javadoc.jar; 赠送源代码:activiti-bpmn-converter-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-...
activiti-bpmn-converter-5.16.4.jar
本文将详细介绍如何在SpringBoot项目中整合Activiti,并通过提供的"springboot-activiti-test-master.zip"压缩包进行实战演练。 首先,我们需要了解SpringBoot与Activiti的基本概念。SpringBoot旨在简化Spring应用...
1、将以下四个文件(见附件Activiti Designer 5.18.1插件补丁)拷贝到自己的eclipse的plugin文件夹下面,重启eclipse ...2、将activiti-designer-5.18.0文件夹copy到eclipse\dropins目录下; 3、重启eclipse即可
【 activiti-explorer-eclipse项目 】是一个基于Activiti工作流引擎的Eclipse插件项目。 Activiti 是一个开源的业务流程管理系统(BPMN 2.0)和工作流引擎,它允许开发者轻松地在应用程序中集成业务流程管理功能。这...
Activiti的Eclipse插件activiti-designer安装资料包,包含activiti-designer-5.18.0.zip、org.eclipse.emf.transaction_1.4.0.201306111400.jar、org.eclipse.emf.validation.ui_1.7.0.201403111711.jar、org....
1. **流程建模**: Activiti Designer 提供了一个图形化用户界面,通过拖放方式可以轻松创建和配置各种流程元素,如开始事件、结束事件、任务、网关和泳道等。这使得非技术背景的业务人员也能参与到流程设计中,提升...
《深入理解Activiti:基于activiti-test-master.zip的实践探索》 Activiti是一个开源的工作流引擎,它提供了强大的业务流程管理(BPM)能力。在我们的示例中,"activiti-test-master.zip"是一个包含与Activiti相关...