https://www.activiti.org/java... 官网api
http://www.mossle.com/docs/ac...#activiti.setup 用户手册 包含配置 和 装置和 相干api的介绍
1.1 简略的说 工作流 分为三块 一是流程节点 和流程节点对应人员的部署 二 执行动作 三是查问人员节点信息
1.2 对于表的生成有两种 一是纯代码生成 二是配置文件+代码生成(举荐)
##
1.3
外围API
1.3.1:ProcessEngine
阐明:
- 在Activiti中最外围的类,其余的类都是由他而来。
- 产生形式:
![Activiti5.4_.ppt][]
在后面看到了两种创立ProcessEngine(流程引擎)的形式,而这里要简化很多,调用ProcessEngines的getDefaultProceeEngine办法时会主动加载classpath下名为activiti.cfg.xml文件。
- 能够产生RepositoryService
![Activiti5.4_.ppt][]
- 能够产生RuntimeService
![Activiti5.4_.ppt][]
- 能够产生TaskService
![Activiti5.4_.ppt][]
各个Service的作用:
<div style="min-height: 14pt;"> <span style="min-height: 14pt; font-size: 11pt; color: rgb(255, 0, 0); font-family: 微软雅黑; font-weight: bold;">RepositoryService</span> </div> | <div style="min-height: 14pt;"> <span style="min-height: 14pt; font-size: 11pt; color: rgb(255, 0, 0); font-family: 微软雅黑; font-weight: bold;">治理流程定义</span> </div> |
<div style="min-height: 14pt;"> <span style="min-height: 14pt; font-size: 11pt; color: rgb(255, 0, 0); font-family: 微软雅黑; font-weight: bold;">RuntimeService</span> </div> | <div style="min-height: 14pt;"> <span style="min-height: 14pt; font-size: 11pt; color: rgb(255, 0, 0); font-family: 微软雅黑; font-weight: bold;">执行治理,包含启动、推动、删除流程实例等操作</span> </div> |
<div style="min-height: 14pt;"> <span style="min-height: 14pt; font-size: 11pt; color: rgb(255, 0, 0); font-family: 微软雅黑; font-weight: bold;">TaskService</span> </div> | <div style="min-height: 14pt;"> <span style="min-height: 14pt; font-size: 11pt; color: rgb(255, 0, 0); font-family: 微软雅黑; font-weight: bold;">工作治理</span> </div> |
<div style="min-height: 14pt;"> <span style="min-height: 14pt; font-size: 11pt; color: rgb(1, 1, 1); font-family: 微软雅黑; font-weight: bold;">HistoryService</span> </div> | <div style="min-height: 14pt;"> <span style="min-height: 14pt; font-size: 11pt; color: rgb(1, 1, 1); font-family: 微软雅黑; font-weight: bold;">历史治理(执行完的数据的治理)</span> </div> |
<div style="min-height: 14pt;"> <span style="min-height: 14pt; font-size: 11pt; color: rgb(1, 1, 1); font-family: 微软雅黑; font-weight: bold;">IdentityService</span> </div> | <div style="min-height: 14pt;"> <span style="min-height: 14pt; font-size: 11pt; color: rgb(1, 1, 1); font-family: 微软雅黑; font-weight: bold;">组织机构治理</span> </div> |
<div style="min-height: 14pt;"> <span style="min-height: 14pt; font-size: 11pt; color: rgb(1, 1, 1); font-family: 微软雅黑;">FormService</span> </div> | <div style="min-height: 14pt;"> <span style="min-height: 14pt; font-size: 11pt; color: rgb(1, 1, 1); font-family: 微软雅黑;">一个可选服务,工作表单治理</span> </div> |
<div style="min-height: 14pt;"> <span style="min-height: 14pt; font-size: 11pt; color: rgb(1, 1, 1); font-family: 微软雅黑;">ManagerService</span> </div> |
1.3.2:RepositoryService
是Activiti的仓库服务类。所谓的仓库指流程定义文档的两个文件:bpmn文件和流程图片。
- 产生形式
![Activiti5.4_.ppt][]
- 能够产生DeploymentBuilder,用来定义流程部署的相干参数
![Activiti5.4_.ppt][]
- 删除流程定义
![Activiti5.4_.ppt][]
1.3.3:RuntimeService
是activiti的流程执行服务类。能够从这个服务类中获取很多对于流程执行相干的信息。
1.3.4:TaskService
是activiti的工作服务类。能够从这个类中获取工作的信息。
1.3.5:HistoryService
是activiti的查问历史信息的类。在一个流程执行实现后,这个对象为咱们提供查问历史信息。
1.3.6:ProcessDefinition
流程定义类。能够从这里取得资源文件等。
1.3.7:ProcessInstance
代表流程定义的执行实例。如范冰冰请了一天的假,她就必须收回一个流程实例的申请。一个流程实例包含了所有的运行节点。咱们能够利用这个对象来理解以后流程实例的进度等信息。流程实例就示意一个流程从开始到完结的最大的流程分支,即一个流程中流程实例只有一个。
1.3.8:Execution
Activiti用这个对象去形容流程执行的每一个节点。在没有并发的状况下,Execution就是?ProcessInstance???流程依照流程定义的规定执行一次的过程,就能够示意执行对象Execution。
如图为ProcessInstance的源代码:
![Activiti5.4_.ppt][]
从源代码中能够看出ProcessInstance就是Execution。但在现实意义上有所区别:
![Activiti5.4_.ppt][]
在复线流程中,如上图的贷款流程,ProcessInstance与Execution是统一的。
![Activiti5.4_.ppt][]
这个例子有一个特点:wire money(汇钱)和archive(存档)是并发执行的。 这个时候,总线路代表ProcessInstance,而分线路中每个流动代表Execution。
总结:
* 一个流程中,执行对象能够存在多个,然而流程实例只能有一个。
* 当流程依照规定只执行一次的时候,那么流程实例就是执行对象。
记忆:部署 RepositoryService ,执行/启动流程 RuntimeService ,查问/实现 节点工作 TaskService。
本文来源于:宋文超super,专属平台有csdn、思否(SegmentFault)、 简书、 开源中国(oschina),转载请注明出处。