关于java:工作流初始一数据库表的作用和接口的相关api

5次阅读

共计 3562 个字符,预计需要花费 9 分钟才能阅读完成。

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

阐明:

  1. 在 Activiti 中最外围的类,其余的类都是由他而来。
  2. 产生形式:

![Activiti5.4_.ppt][]

在后面看到了两种创立 ProcessEngine(流程引擎)的形式,而这里要简化很多,调用 ProcessEngines 的 getDefaultProceeEngine 办法时会主动加载 classpath 下名为 activiti.cfg.xml 文件。

  1. 能够产生 RepositoryService

![Activiti5.4_.ppt][]

  1. 能够产生 RuntimeService

![Activiti5.4_.ppt][]

  1. 能够产生 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 文件和流程图片。

  1. 产生形式

![Activiti5.4_.ppt][]

  1. 能够产生 DeploymentBuilder,用来定义流程部署的相干参数

![Activiti5.4_.ppt][]

  1. 删除流程定义

![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),转载请注明出处。

正文完
 0