Activiti之执行链路
在Activiti中Execution和ProcessInstance都用于获取当前流程实例的相关信息。
当流程中没有分支时,Execution等同于ProcessInstance,甚至连ID也相同;
当流程中存在分支(fork, parallel gateway),则在分支口会形成子Execution,在下一个gateway才会合并(joined)
原文出自:http://forums.activiti.org/en/viewtopic.php?f=4&t=1979
A processinstance is what is logically executed. The execution what is actually executed. An execution without a parent is a root execution and 'equal' to the processinstance (even in id). Each time e.g. A parallel gateway (fork) is encountered, an execution gets child executions which are e.g. 'joined' again at a next gateway.
activiti学习之task与execution的关系
一.含义 task 即待办任务
execution 即流程执行线路,或者执行环境
当流程中没有分支时,Execution等同于ProcessInstance,甚至连ID也相同;
当流程中存在分支(fork, parallel gateway),则在分支口会形成子Execution,在下一个gateway才会合并(joined)。
二.关系
从数量上来说,task是始终小于等于execution,每个task总是对应一个execution。而execution不一定对应一个task。
从级别上来说,execution相当于task的执行环境,execution是包含task的
总结
execution其实就是分支的执行线。
有的文章说task与execution是一对一的关系,这个是不准确的,应该是execution和分支是一对一的关系,有多少个分支就有多少个execution。