- Chapter 1. Introduction 介绍
- Chapter 2. Getting Started
- Chapter 3. Configuration
- Creating a ProcessEngine 创建 ProcessEngine
- ProcessEngineConfiguration bean
- Database configuration 数据库配置
- JNDI Datasource Configuration 数据源配置
- Supported databases 支持的数据库
- Creating the database tables 创建数据库表
- Database table names explained 理解数据库表名字
- Database upgrade 数据库升级
- Job Executor and Async Executor (since version 5.17.0)
- Job executor activation 启用 Job executor
- Async executor activation 启用 Async executor
- Mail server configuration 配置邮件服务器
- History configuration 配置历史
- Exposing configuration beans in expressions and scripts 在表达式和脚本中暴露配置
- Deployment cache configuration 配置部署缓存
- Logging 日志
- Mapped Diagnostic Contexts 映射诊断上下文
- Event handlers 事件处理
- Chapter 4. The Activiti API
- Chapter 5. Spring integration 集成 Spring
- Chapter 6. Deployment
- Chapter 7. BPMN 2.0 Introduction
- Chapter 8. BPMN 2.0 Constructs 关于 BPMN 2.0 架构
- Chapter 9. Forms 表单
- Chapter 10. JPA
- Chapter 11. History 历史
- Chapter 12. Eclipse Designer
- Chapter 13. Activiti Explorer
- Chapter 14. Activiti Modeler
- Chapter 15. REST API
- Chapter 16. CDI integration 集成 CDI
- Chapter 17. LDAP integration 集成 LDAP
- Chapter 18. Advanced 高级
- Hooking into process parsing 监听流程解析
- UUID id generator for high concurrency 高并发的 UUID 生成器
- Multitenancy 多租户
- Execute custom SQL 执行自定义 SQL
- Advanced Process Engine configuration with a ProcessEngineConfigurator 用 ProcessEngineConfigurator 实现高级引擎配置
- Advanced query API seamless switching between runtime and historic task querying 高级查询 API-运行时无缝任务切换和历史任务查询
- Custom identity management by overriding standard SessionFactory 通过重写标准的 SessionFactory 实现自定义身份的管理
- Enable safe BPMN 2.0 xml 启用安全的 BPMN 2.0 xml
- Event logging Experimental 事件日志-实验
- Introduction 介绍
- CrystalBall inside 内部
- History analysis 历史分析
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
Versioning of process definitions 流程定义的版本
BPMN 中并没有版本的概念,没有版本也是不错的,因为可执行的 BPMN 流程作为你开发项目的一部分存在版本控制系统的知识库中(例如 SVN,Git 或者 Mercurial )。 而在 Activiti 中,流程定义的版本是在部署时创建的。在部署的时候,流程定义被存储到 Activiti 使用的数据 库之前,Activiti 将会自动给 流程定义 分配一个版本号。
对于业务文档中每一个的流程定义,都会通过下列部署执行初始化属性 key, version, name 和 id:
- XML 文件中流程定义(流程模型)的 id 属性被当做是流程定义的 key 属性。
- XML 文件中的流程模型的 name 属性被当做是流程定义的 name 属性。如果该 name 属性并没有指定,那么 id 属性被当做是 name。
- 带有特定 key 的流程定义在第一次部署的时候,将会自动分配版本号为 1,对于之后部署相同 key 的流程定义时候,这次部署的版本号将会设置为比当前最大的版本号大 1 的值。该 key 属性被用来区别不同的流程定义。
- 流程定义中的 id 属性被设置为 {processDefinitionKey}:{processDefinitionVersion}: {generated-id}, 这里的 generated-id 是一个唯一的数字被添加,用于确保在集群环境中缓存的流程定义的唯一性。
看下面示例
<definitions id="myDefinitions" >
<process id="myProcess" name="My important process" >
...
当部署了这个流程定义之后,在数据库中的流程定义看起来像这样:
Table 6.1.
id | key | name | version |
---|---|---|---|
myProcess:1:676 | myProcess | My important process | 1 |
假设我们现在部署用一个流程的最新版本号(例如 改变用户任务),但是流程定义的 id 保持不变。 流程定义表将包含以下列表信息:
Table 6.2.
id | key | name | version |
---|---|---|---|
myProcess:1:676 | myProcess | My important process | 1 |
myProcess:2:870 | myProcess | My important process | 2 |
当 runtimeService.startProcessInstanceByKey("myProcess") 方法被调用时,它将会使用流程定义版本号为 2 的,因为这是最新版本的流程定义。可以说每次流程定义创建流程实例时,都会默认使用最新版本的流程定义。
我们应该创建第二个流程,在 Activiti 中,如下,定义并且部署它,该流程定义会添加到流程定义表中
<definitions id="myNewDefinitions" >
<process id="myNewProcess" name="My important process" >
...
表格如下:
Table 6.3.
id | key | name | version |
---|---|---|---|
myProcess:1:676 | myProcess | My important process | 1 |
myProcess:2:870 | myProcess | My important process | 2 |
myNewProcess:1:1033 | myNewProcess | My important process | 1 |
注意:为何新流程的 key 与我们的第一个流程是不同的。尽管流程定义的名称是相同的(当然,我们应该也是可以改变这一点的),Activiti 仅仅只考虑 id 属性判断流程。因此,新的流程定义部署的版本号为 1。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论