介绍

包含网关可以看作是排他网关并行网关的结合体

包含网关根据流向支持两种情况:

  1. 分支: 从包含网关向后流出,解析所有后继顺序流的条件表达式,为解析结果为true的所有顺序流创建分支

  2. 汇聚: 在此等待,直到所有存在运行分支前继顺序流分支都到达以后,流程才会通过该包含网关

演示

包含网关

JSON规范

  1. 1{
  2. 2 nodes: [
  3. 3 {
  4. 4 id: 'startEvent_1',
  5. 5 name: 'Start',
  6. 6 type: 'startEventNone',
  7. 7 },
  8. 8 // 包含网关-分支
  9. 9 {
  10. 10 id: 'gateway_1',
  11. 11 name: 'Gateway Inclusive(out)',
  12. 12 type: 'gatewayInclusive',
  13. 13 },
  14. 14 {
  15. 15 id: 'activity_1',
  16. 16 name: 'ActivityNone',
  17. 17 type: 'activityNone',
  18. 18 },
  19. 19 {
  20. 20 id: 'activity_2',
  21. 21 name: 'ActivityNone',
  22. 22 type: 'activityNone',
  23. 23 },
  24. 24 {
  25. 25 id: 'activity_3',
  26. 26 name: 'ActivityNone',
  27. 27 type: 'activityNone',
  28. 28 },
  29. 29 // 包含网关-汇聚
  30. 30 {
  31. 31 id: 'gateway_2',
  32. 32 name: 'Gateway Inclusive(in)',
  33. 33 type: 'gatewayInclusive',
  34. 34 },
  35. 35 {
  36. 36 id: 'endEvent_1',
  37. 37 name: 'End',
  38. 38 type: 'endEventNone',
  39. 39 },
  40. 40 ],
  41. 41 edges: [
  42. 42 {
  43. 43 id: 'edge_1',
  44. 44 name: '',
  45. 45 source: 'startEvent_1',
  46. 46 target: 'gateway_1',
  47. 47 },
  48. 48 // 后继顺序流
  49. 49 {
  50. 50 id: 'edge_2',
  51. 51 name: '',
  52. 52 source: 'gateway_1',
  53. 53 target: 'activity_1',
  54. 54 options: {
  55. 55 // 条件表达式
  56. 56 conditionExpression: "context.vars.get('x')===1",
  57. 57 },
  58. 58 },
  59. 59 // 后继顺序流
  60. 60 {
  61. 61 id: 'edge_3',
  62. 62 name: '',
  63. 63 source: 'gateway_1',
  64. 64 target: 'activity_2',
  65. 65 options: {
  66. 66 // 条件表达式
  67. 67 conditionExpression: "context.vars.get('x')===2",
  68. 68 },
  69. 69 },
  70. 70 // 后继顺序流
  71. 71 {
  72. 72 id: 'edge_4',
  73. 73 name: '',
  74. 74 source: 'gateway_1',
  75. 75 target: 'activity_3',
  76. 76 options: {
  77. 77 // 条件表达式
  78. 78 conditionExpression: "context.vars.get('x')===1",
  79. 79 },
  80. 80 },
  81. 81 // 前继顺序流
  82. 82 {
  83. 83 id: 'edge_5',
  84. 84 name: '',
  85. 85 source: 'activity_1',
  86. 86 target: 'gateway_2',
  87. 87 },
  88. 88 // 前继顺序流
  89. 89 {
  90. 90 id: 'edge_6',
  91. 91 name: '',
  92. 92 source: 'activity_2',
  93. 93 target: 'gateway_2',
  94. 94 },
  95. 95 // 前继顺序流
  96. 96 {
  97. 97 id: 'edge_7',
  98. 98 name: '',
  99. 99 source: 'activity_3',
  100. 100 target: 'gateway_2',
  101. 101 },
  102. 102 {
  103. 103 id: 'edge_8',
  104. 104 name: '',
  105. 105 source: 'gateway_2',
  106. 106 target: 'endEvent_1',
  107. 107 },
  108. 108 ],
  109. 109},
  • node
名称 说明
id gateway_1,节点Id
name Gateway Inclusive(out),节点名称
type gatewayInclusive,表示该节点类型为包含网关