介绍

当流程运行到并行网关,会将流程分成多条分支,也能够把多条分支汇聚到一起

并行网关根据流向支持两种情况:

  1. 分支: 从并行网关向后流出,为所有后继顺序流创建分支

  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 Parallel(out)',
  12. 12 type: 'gatewayParallel',
  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 {
  26. 26 id: 'gateway_2',
  27. 27 name: 'Gateway Parallel(in)',
  28. 28 type: 'gatewayParallel',
  29. 29 },
  30. 30 {
  31. 31 id: 'endEvent_1',
  32. 32 name: 'End',
  33. 33 type: 'endEventNone',
  34. 34 },
  35. 35 ],
  36. 36 edges: [
  37. 37 {
  38. 38 id: 'edge_1',
  39. 39 name: '',
  40. 40 source: 'startEvent_1',
  41. 41 target: 'gateway_1',
  42. 42 },
  43. 43 // 后继顺序流
  44. 44 {
  45. 45 id: 'edge_2',
  46. 46 name: '',
  47. 47 source: 'gateway_1',
  48. 48 target: 'activity_1',
  49. 49 },
  50. 50 // 后继顺序流
  51. 51 {
  52. 52 id: 'edge_3',
  53. 53 name: '',
  54. 54 source: 'gateway_1',
  55. 55 target: 'activity_2',
  56. 56 },
  57. 57 // 前继顺序流
  58. 58 {
  59. 59 id: 'edge_4',
  60. 60 name: '',
  61. 61 source: 'activity_1',
  62. 62 target: 'gateway_2',
  63. 63 },
  64. 64 // 前继顺序流
  65. 65 {
  66. 66 id: 'edge_5',
  67. 67 name: '',
  68. 68 source: 'activity_2',
  69. 69 target: 'gateway_2',
  70. 70 },
  71. 71 {
  72. 72 id: 'edge_6',
  73. 73 name: '',
  74. 74 source: 'gateway_2',
  75. 75 target: 'endEvent_1',
  76. 76 },
  77. 77 ],
  78. 78},
  • node
名称 说明
id gateway_1,节点Id
name Gateway Parallel(out),节点名称
type gatewayParallel,表示该节点类型为并行网关