2023-08-11 17:47:02 +08:00
|
|
|
|
# 流程实例
|
|
|
|
|
|
|
|
|
|
流程实例指正在运行的一个流程。数据存放在FlowInstance表中,该表核心字段如下:
|
|
|
|
|
|
|
|
|
|
#### IsFinish:流程的当前状态
|
|
|
|
|
|
2025-03-08 15:01:17 +08:00
|
|
|
|
- -1 草稿/召回:流程发起人主动召回流程;
|
2023-08-11 17:47:02 +08:00
|
|
|
|
|
|
|
|
|
- 0 正在运行;
|
|
|
|
|
|
|
|
|
|
- 1 完成:流程结束,同时所有的审批都通过;
|
|
|
|
|
|
|
|
|
|
- 3 不同意:即流程结束,同时审批人员没有通过;
|
|
|
|
|
|
|
|
|
|
- 4 驳回:流程结束,可能发起的流程内容有问题,要求被驳回重新提交;
|
|
|
|
|
|
|
|
|
|
|
2025-03-08 15:01:17 +08:00
|
|
|
|
#### ActivityId: 当前活动节点,即待审批的节点
|
|
|
|
|
|
2023-08-11 17:47:02 +08:00
|
|
|
|
#### ActivityType:当前节点的类型
|
|
|
|
|
|
|
|
|
|
- -1 无法运行,
|
|
|
|
|
|
|
|
|
|
- 0 会签开始,
|
|
|
|
|
|
|
|
|
|
- 1 会签结束,
|
|
|
|
|
|
|
|
|
|
- 2 一般节点,
|
|
|
|
|
|
|
|
|
|
- 3 开始节点,
|
|
|
|
|
|
|
|
|
|
- 4 流程运行结束
|
|
|
|
|
|
|
|
|
|
#### SchemeContent:流程实例的具体内容
|
|
|
|
|
|
|
|
|
|
该字段存储的是一个JSON对象,具体内容如下所示:
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title":"newFlow_1",
|
|
|
|
|
"nodes":[
|
|
|
|
|
{
|
|
|
|
|
"name":"node_1",
|
|
|
|
|
"left":75,
|
|
|
|
|
"top":90,
|
|
|
|
|
"type":"start round mix",
|
|
|
|
|
"id":1521797877921,
|
|
|
|
|
"width":26,
|
|
|
|
|
"height":26,
|
|
|
|
|
"alt":true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name":"审核",
|
|
|
|
|
"left":235,
|
|
|
|
|
"top":97,
|
|
|
|
|
"type":"node",
|
|
|
|
|
"id":1521797879744,
|
|
|
|
|
"width":104,
|
|
|
|
|
"height":26,
|
|
|
|
|
"alt":true,
|
|
|
|
|
"setInfo":{
|
|
|
|
|
"NodeDesignateData":{
|
|
|
|
|
"users":[
|
|
|
|
|
"49df1602-f5f3-4d52-afb7-3802da619558",
|
|
|
|
|
"6ba79766-faa0-4259-8139-a4a6d35784e0"
|
|
|
|
|
],
|
|
|
|
|
"role":{
|
|
|
|
|
},
|
|
|
|
|
"org":{
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"NodeCode":"FIRST",
|
|
|
|
|
"NodeName":"审核"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name":"node_3",
|
|
|
|
|
"left":268,
|
|
|
|
|
"top":209,
|
|
|
|
|
"type":"end round",
|
|
|
|
|
"id":1521797881216,
|
|
|
|
|
"width":26,
|
|
|
|
|
"height":26,
|
|
|
|
|
"alt":true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"lines":[
|
|
|
|
|
{
|
|
|
|
|
"type":"sl",
|
|
|
|
|
"from":"1521797877921",
|
|
|
|
|
"to":"1521797879744",
|
|
|
|
|
"id":1521797883552,
|
|
|
|
|
"name":"",
|
|
|
|
|
"dash":false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type":"sl",
|
|
|
|
|
"from":"1521797879744",
|
|
|
|
|
"to":"1521797881216",
|
|
|
|
|
"id":1521797884536,
|
|
|
|
|
"name":"",
|
|
|
|
|
"dash":false
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"areas":{
|
|
|
|
|
},
|
|
|
|
|
"initNum":7
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
其中:nodes为流程实例的所有节点。lines为流程实例的所有连线。节点的type属性为节点的类型属性,对应上面提到的ActivityType:
|
|
|
|
|
|
|
|
|
|
- -1:无法运行;
|
|
|
|
|
|
|
|
|
|
- 0:会签开始,即type为:‘fork’;
|
|
|
|
|
|
|
|
|
|
- 1:会签结束,即type为:’join’;
|
|
|
|
|
|
|
|
|
|
- 2:一般节点,即type为:’node’;
|
|
|
|
|
|
|
|
|
|
- 3:开始节点,即type为:‘start’;
|
|
|
|
|
|
|
|
|
|
- 4:流程运行结束,即type为’end’;
|
2025-03-08 15:01:17 +08:00
|
|
|
|
|
|
|
|
|
与流程实例密切相关的还有两个表:流程实例的操作记录FlowInstanceOperationHistory及流转记录FlowInstanceTransitionHistory。它们有不同的作用:
|
|
|
|
|
|
|
|
|
|
### 操作记录FlowInstanceOperationHistory
|
|
|
|
|
该表记录了流程实例的所有操作记录,包括流程的创建、撤回、驳回、同意、不同意等操作。
|
|
|
|
|
|
|
|
|
|
### 流转记录FlowInstanceTransitionHistory
|
|
|
|
|
记录某个流程实例所有已审批的从一个活动节点到下一个活动节点的操作人、操作时间。
|