介绍
当流程运行到排他网关
,会解析后续顺序流的条件表达式,选择一条解析结果为true
的顺序流,继续执行
演示
JSON规范
- 1process: {
- 2 nodes: [
- 3 {
- 4 id: 'startEvent_1',
- 5 name: 'Start',
- 6 type: 'startEventNone',
- 7 },
- 8 // 排他网关
- 9 {
- 10 id: 'gateway_1',
- 11 name: 'Gateway Exclusive',
- 12 type: 'gatewayExclusive',
- 13 },
- 14 {
- 15 id: 'endEvent_1',
- 16 name: 'End',
- 17 type: 'endEventNone',
- 18 },
- 19 {
- 20 id: 'endEvent_2',
- 21 name: 'End',
- 22 type: 'endEventNone',
- 23 },
- 24 ],
- 25 edges: [
- 26 {
- 27 id: 'edge_1',
- 28 name: '',
- 29 source: 'startEvent_1',
- 30 target: 'gateway_1',
- 31 },
- 32 // 后续顺序流
- 33 {
- 34 id: 'edge_2',
- 35 name: 'x=1',
- 36 source: 'gateway_1',
- 37 target: 'endEvent_1',
- 38 options: {
- 39 // 条件表达式
- 40 conditionExpression: "context.vars.get('x')===1",
- 41 },
- 42 },
- 43 // 后续顺序流
- 44 {
- 45 id: 'edge_3',
- 46 name: 'x=2',
- 47 source: 'gateway_1',
- 48 target: 'endEvent_2',
- 49 options: {
- 50 // 条件表达式
- 51 conditionExpression: `
- 52 contextNodePrevious.vars.get('x')===2
- 53 `,
- 54 },
- 55 },
- 56 ],
- 57},
- node
名称 | 说明 |
---|---|
id | gateway_1,节点Id |
name | Gateway Exclusive,节点名称 |
type | gatewayExclusive,表示该节点类型为排他网关 |
-
edge
- 参见:转移线:顺序流
评论: