bpmn-js 18.1.2 → 18.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/LICENSE +23 -23
  2. package/README.md +95 -95
  3. package/dist/assets/bpmn-js.css +145 -145
  4. package/dist/bpmn-modeler.development.js +38666 -38635
  5. package/dist/bpmn-modeler.production.min.js +4 -4
  6. package/dist/bpmn-navigated-viewer.development.js +20798 -20798
  7. package/dist/bpmn-navigated-viewer.production.min.js +3 -3
  8. package/dist/bpmn-viewer.development.js +20735 -20735
  9. package/dist/bpmn-viewer.production.min.js +3 -3
  10. package/lib/BaseModeler.d.ts +15 -15
  11. package/lib/BaseModeler.js +79 -79
  12. package/lib/BaseViewer.d.ts +352 -352
  13. package/lib/BaseViewer.js +858 -858
  14. package/lib/Modeler.d.ts +86 -86
  15. package/lib/Modeler.js +206 -206
  16. package/lib/NavigatedViewer.d.ts +11 -11
  17. package/lib/NavigatedViewer.js +37 -37
  18. package/lib/Viewer.d.ts +47 -47
  19. package/lib/Viewer.js +76 -76
  20. package/lib/core/index.d.ts +10 -10
  21. package/lib/core/index.js +8 -8
  22. package/lib/draw/BpmnRenderUtil.d.ts +123 -123
  23. package/lib/draw/BpmnRenderUtil.js +256 -256
  24. package/lib/draw/BpmnRenderer.d.ts +116 -116
  25. package/lib/draw/BpmnRenderer.js +2339 -2339
  26. package/lib/draw/PathMap.d.ts +330 -330
  27. package/lib/draw/PathMap.js +478 -478
  28. package/lib/draw/TextRenderer.d.ts +74 -74
  29. package/lib/draw/TextRenderer.js +136 -136
  30. package/lib/draw/index.d.ts +10 -10
  31. package/lib/draw/index.js +11 -11
  32. package/lib/features/align-elements/AlignElementsContextPadProvider.d.ts +32 -32
  33. package/lib/features/align-elements/AlignElementsContextPadProvider.js +105 -105
  34. package/lib/features/align-elements/AlignElementsIcons.d.ts +10 -10
  35. package/lib/features/align-elements/AlignElementsIcons.js +43 -43
  36. package/lib/features/align-elements/AlignElementsMenuProvider.d.ts +32 -32
  37. package/lib/features/align-elements/AlignElementsMenuProvider.js +100 -100
  38. package/lib/features/align-elements/BpmnAlignElements.d.ts +9 -9
  39. package/lib/features/align-elements/BpmnAlignElements.js +45 -45
  40. package/lib/features/align-elements/index.d.ts +11 -11
  41. package/lib/features/align-elements/index.js +23 -23
  42. package/lib/features/append-preview/AppendPreview.d.ts +36 -36
  43. package/lib/features/append-preview/AppendPreview.js +108 -108
  44. package/lib/features/append-preview/index.d.ts +16 -16
  45. package/lib/features/append-preview/index.js +15 -15
  46. package/lib/features/auto-place/BpmnAutoPlace.d.ts +15 -15
  47. package/lib/features/auto-place/BpmnAutoPlace.js +22 -22
  48. package/lib/features/auto-place/BpmnAutoPlaceUtil.d.ts +52 -52
  49. package/lib/features/auto-place/BpmnAutoPlaceUtil.js +226 -226
  50. package/lib/features/auto-place/index.d.ts +7 -7
  51. package/lib/features/auto-place/index.js +8 -8
  52. package/lib/features/auto-resize/BpmnAutoResize.d.ts +25 -25
  53. package/lib/features/auto-resize/BpmnAutoResize.js +45 -45
  54. package/lib/features/auto-resize/BpmnAutoResizeProvider.d.ts +26 -26
  55. package/lib/features/auto-resize/BpmnAutoResizeProvider.js +69 -69
  56. package/lib/features/auto-resize/index.d.ts +8 -8
  57. package/lib/features/auto-resize/index.js +12 -12
  58. package/lib/features/context-pad/ContextPadProvider.d.ts +62 -62
  59. package/lib/features/context-pad/ContextPadProvider.js +582 -582
  60. package/lib/features/context-pad/index.d.ts +7 -7
  61. package/lib/features/context-pad/index.js +22 -22
  62. package/lib/features/copy-paste/BpmnCopyPaste.d.ts +17 -17
  63. package/lib/features/copy-paste/BpmnCopyPaste.js +192 -192
  64. package/lib/features/copy-paste/ModdleCopy.d.ts +45 -45
  65. package/lib/features/copy-paste/index.d.ts +9 -9
  66. package/lib/features/copy-paste/index.js +13 -13
  67. package/lib/features/di-ordering/BpmnDiOrdering.d.ts +11 -11
  68. package/lib/features/di-ordering/BpmnDiOrdering.js +48 -48
  69. package/lib/features/di-ordering/index.d.ts +6 -6
  70. package/lib/features/di-ordering/index.js +7 -7
  71. package/lib/features/distribute-elements/BpmnDistributeElements.d.ts +10 -10
  72. package/lib/features/distribute-elements/BpmnDistributeElements.js +60 -60
  73. package/lib/features/distribute-elements/DistributeElementsIcons.d.ts +5 -5
  74. package/lib/features/distribute-elements/DistributeElementsIcons.js +18 -18
  75. package/lib/features/distribute-elements/DistributeElementsMenuProvider.d.ts +32 -32
  76. package/lib/features/distribute-elements/DistributeElementsMenuProvider.js +92 -92
  77. package/lib/features/distribute-elements/index.d.ts +9 -9
  78. package/lib/features/distribute-elements/index.js +19 -19
  79. package/lib/features/drilldown/DrilldownBreadcrumbs.d.ts +19 -19
  80. package/lib/features/drilldown/DrilldownBreadcrumbs.js +138 -138
  81. package/lib/features/drilldown/DrilldownCentering.d.ts +17 -17
  82. package/lib/features/drilldown/DrilldownCentering.js +122 -122
  83. package/lib/features/drilldown/DrilldownOverlayBehavior.d.ts +20 -20
  84. package/lib/features/drilldown/DrilldownOverlayBehavior.js +218 -218
  85. package/lib/features/drilldown/SubprocessCompatibility.d.ts +21 -21
  86. package/lib/features/drilldown/SubprocessCompatibility.js +266 -266
  87. package/lib/features/drilldown/index.d.ts +13 -13
  88. package/lib/features/drilldown/index.js +16 -16
  89. package/lib/features/editor-actions/BpmnEditorActions.d.ts +13 -13
  90. package/lib/features/editor-actions/BpmnEditorActions.js +187 -187
  91. package/lib/features/editor-actions/index.d.ts +6 -6
  92. package/lib/features/editor-actions/index.js +10 -10
  93. package/lib/features/grid-snapping/BpmnGridSnapping.d.ts +9 -9
  94. package/lib/features/grid-snapping/behavior/GridSnappingAutoPlaceBehavior.d.ts +14 -14
  95. package/lib/features/grid-snapping/behavior/GridSnappingLayoutConnectionBehavior.d.ts +27 -27
  96. package/lib/features/grid-snapping/behavior/GridSnappingLayoutConnectionBehavior.js +155 -155
  97. package/lib/features/grid-snapping/behavior/GridSnappingParticipantBehavior.d.ts +13 -13
  98. package/lib/features/grid-snapping/behavior/index.d.ts +10 -10
  99. package/lib/features/grid-snapping/index.d.ts +11 -11
  100. package/lib/features/interaction-events/BpmnInteractionEvents.d.ts +18 -18
  101. package/lib/features/interaction-events/BpmnInteractionEvents.js +146 -146
  102. package/lib/features/interaction-events/index.d.ts +6 -6
  103. package/lib/features/interaction-events/index.js +5 -5
  104. package/lib/features/keyboard/BpmnKeyboardBindings.d.ts +15 -15
  105. package/lib/features/keyboard/BpmnKeyboardBindings.js +179 -179
  106. package/lib/features/keyboard/index.d.ts +7 -7
  107. package/lib/features/keyboard/index.js +11 -11
  108. package/lib/features/label-editing/LabelEditingPreview.d.ts +13 -13
  109. package/lib/features/label-editing/LabelEditingPreview.js +145 -145
  110. package/lib/features/label-editing/LabelEditingProvider.d.ts +62 -62
  111. package/lib/features/label-editing/LabelEditingProvider.js +519 -519
  112. package/lib/features/label-editing/LabelUtil.d.ts +1 -1
  113. package/lib/features/label-editing/LabelUtil.js +4 -4
  114. package/lib/features/label-editing/cmd/UpdateLabelHandler.d.ts +22 -22
  115. package/lib/features/label-editing/cmd/UpdateLabelHandler.js +149 -149
  116. package/lib/features/label-editing/index.d.ts +9 -9
  117. package/lib/features/label-editing/index.js +21 -21
  118. package/lib/features/modeling/BpmnFactory.d.ts +73 -73
  119. package/lib/features/modeling/BpmnFactory.js +180 -180
  120. package/lib/features/modeling/BpmnLayouter.d.ts +30 -30
  121. package/lib/features/modeling/BpmnLayouter.js +488 -488
  122. package/lib/features/modeling/BpmnUpdater.d.ts +90 -90
  123. package/lib/features/modeling/BpmnUpdater.js +818 -818
  124. package/lib/features/modeling/ElementFactory.d.ts +117 -117
  125. package/lib/features/modeling/ElementFactory.js +412 -412
  126. package/lib/features/modeling/ElementFactory.test.ts +132 -132
  127. package/lib/features/modeling/Modeling.d.ts +150 -150
  128. package/lib/features/modeling/Modeling.js +309 -309
  129. package/lib/features/modeling/Modeling.test.ts +147 -147
  130. package/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.d.ts +19 -19
  131. package/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.js +288 -288
  132. package/lib/features/modeling/behavior/AppendBehavior.d.ts +6 -6
  133. package/lib/features/modeling/behavior/AppendBehavior.js +42 -42
  134. package/lib/features/modeling/behavior/AssociationBehavior.d.ts +11 -11
  135. package/lib/features/modeling/behavior/AttachEventBehavior.d.ts +15 -15
  136. package/lib/features/modeling/behavior/AttachEventBehavior.js +106 -106
  137. package/lib/features/modeling/behavior/BoundaryEventBehavior.d.ts +15 -15
  138. package/lib/features/modeling/behavior/BoundaryEventBehavior.js +74 -74
  139. package/lib/features/modeling/behavior/CompensateBoundaryEventBehavior.d.ts +17 -17
  140. package/lib/features/modeling/behavior/CompensateBoundaryEventBehavior.js +222 -222
  141. package/lib/features/modeling/behavior/CreateBehavior.d.ts +9 -9
  142. package/lib/features/modeling/behavior/CreateBehavior.js +33 -33
  143. package/lib/features/modeling/behavior/CreateDataObjectBehavior.d.ts +15 -15
  144. package/lib/features/modeling/behavior/CreateDataObjectBehavior.js +43 -43
  145. package/lib/features/modeling/behavior/CreateParticipantBehavior.d.ts +19 -19
  146. package/lib/features/modeling/behavior/CreateParticipantBehavior.js +237 -237
  147. package/lib/features/modeling/behavior/DataInputAssociationBehavior.d.ts +21 -21
  148. package/lib/features/modeling/behavior/DataInputAssociationBehavior.js +162 -162
  149. package/lib/features/modeling/behavior/DataStoreBehavior.d.ts +19 -19
  150. package/lib/features/modeling/behavior/DeleteLaneBehavior.d.ts +15 -15
  151. package/lib/features/modeling/behavior/DeleteLaneBehavior.js +162 -162
  152. package/lib/features/modeling/behavior/DetachEventBehavior.d.ts +15 -15
  153. package/lib/features/modeling/behavior/DetachEventBehavior.js +101 -101
  154. package/lib/features/modeling/behavior/DropOnFlowBehavior.d.ts +13 -13
  155. package/lib/features/modeling/behavior/DropOnFlowBehavior.js +221 -221
  156. package/lib/features/modeling/behavior/EventBasedGatewayBehavior.d.ts +11 -11
  157. package/lib/features/modeling/behavior/EventBasedGatewayBehavior.js +110 -110
  158. package/lib/features/modeling/behavior/FixHoverBehavior.d.ts +17 -17
  159. package/lib/features/modeling/behavior/GroupBehavior.d.ts +26 -26
  160. package/lib/features/modeling/behavior/ImportDockingFix.d.ts +13 -13
  161. package/lib/features/modeling/behavior/ImportDockingFix.js +83 -83
  162. package/lib/features/modeling/behavior/IsHorizontalFix.d.ts +10 -10
  163. package/lib/features/modeling/behavior/IsHorizontalFix.js +54 -54
  164. package/lib/features/modeling/behavior/LabelBehavior.d.ts +56 -56
  165. package/lib/features/modeling/behavior/LabelBehavior.js +364 -364
  166. package/lib/features/modeling/behavior/LayoutConnectionBehavior.d.ts +16 -16
  167. package/lib/features/modeling/behavior/LayoutConnectionBehavior.js +121 -121
  168. package/lib/features/modeling/behavior/MessageFlowBehavior.d.ts +15 -15
  169. package/lib/features/modeling/behavior/NonInterruptingBehavior.d.ts +4 -4
  170. package/lib/features/modeling/behavior/NonInterruptingBehavior.js +41 -41
  171. package/lib/features/modeling/behavior/RemoveElementBehavior.d.ts +13 -13
  172. package/lib/features/modeling/behavior/RemoveElementBehavior.js +91 -91
  173. package/lib/features/modeling/behavior/RemoveEmbeddedLabelBoundsBehavior.d.ts +16 -16
  174. package/lib/features/modeling/behavior/RemoveEmbeddedLabelBoundsBehavior.js +41 -41
  175. package/lib/features/modeling/behavior/RemoveParticipantBehavior.d.ts +15 -15
  176. package/lib/features/modeling/behavior/RemoveParticipantBehavior.js +59 -59
  177. package/lib/features/modeling/behavior/ReplaceConnectionBehavior.d.ts +15 -15
  178. package/lib/features/modeling/behavior/ReplaceConnectionBehavior.js +194 -194
  179. package/lib/features/modeling/behavior/ReplaceElementBehaviour.d.ts +23 -23
  180. package/lib/features/modeling/behavior/ReplaceElementBehaviour.js +144 -144
  181. package/lib/features/modeling/behavior/ResizeBehavior.d.ts +64 -64
  182. package/lib/features/modeling/behavior/ResizeBehavior.js +265 -265
  183. package/lib/features/modeling/behavior/ResizeLaneBehavior.d.ts +16 -16
  184. package/lib/features/modeling/behavior/ResizeLaneBehavior.js +70 -70
  185. package/lib/features/modeling/behavior/RootElementReferenceBehavior.d.ts +25 -25
  186. package/lib/features/modeling/behavior/SetCompensationActivityAfterPasteBehavior.d.ts +16 -16
  187. package/lib/features/modeling/behavior/SetCompensationActivityAfterPasteBehavior.js +66 -66
  188. package/lib/features/modeling/behavior/SpaceToolBehavior.d.ts +10 -10
  189. package/lib/features/modeling/behavior/SpaceToolBehavior.js +207 -207
  190. package/lib/features/modeling/behavior/SubProcessPlaneBehavior.d.ts +28 -28
  191. package/lib/features/modeling/behavior/SubProcessPlaneBehavior.js +588 -588
  192. package/lib/features/modeling/behavior/SubProcessStartEventBehavior.d.ts +15 -15
  193. package/lib/features/modeling/behavior/SubProcessStartEventBehavior.js +55 -55
  194. package/lib/features/modeling/behavior/TextAnnotationBehavior.d.ts +6 -6
  195. package/lib/features/modeling/behavior/TextAnnotationBehavior.js +42 -42
  196. package/lib/features/modeling/behavior/ToggleCollapseConnectionBehaviour.d.ts +14 -14
  197. package/lib/features/modeling/behavior/ToggleCollapseConnectionBehaviour.js +87 -87
  198. package/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.d.ts +13 -13
  199. package/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js +156 -156
  200. package/lib/features/modeling/behavior/UnclaimIdBehavior.d.ts +19 -19
  201. package/lib/features/modeling/behavior/UnclaimIdBehavior.js +64 -64
  202. package/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.d.ts +16 -16
  203. package/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.js +59 -59
  204. package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.d.ts +15 -15
  205. package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.js +157 -157
  206. package/lib/features/modeling/behavior/index.d.ts +2 -2
  207. package/lib/features/modeling/behavior/index.js +131 -131
  208. package/lib/features/modeling/behavior/util/CategoryUtil.d.ts +49 -49
  209. package/lib/features/modeling/behavior/util/CategoryUtil.js +86 -86
  210. package/lib/features/modeling/behavior/util/ConnectionLayoutUtil.d.ts +19 -19
  211. package/lib/features/modeling/behavior/util/ConnectionLayoutUtil.js +22 -22
  212. package/lib/features/modeling/behavior/util/GeometricUtil.d.ts +1 -1
  213. package/lib/features/modeling/behavior/util/LabelLayoutUtil.d.ts +32 -32
  214. package/lib/features/modeling/behavior/util/LabelLayoutUtil.js +41 -41
  215. package/lib/features/modeling/behavior/util/LayoutUtil.d.ts +48 -48
  216. package/lib/features/modeling/behavior/util/LayoutUtil.js +259 -259
  217. package/lib/features/modeling/behavior/util/LineAttachmentUtil.d.ts +37 -37
  218. package/lib/features/modeling/behavior/util/LineAttachmentUtil.js +241 -241
  219. package/lib/features/modeling/behavior/util/LineIntersect.d.ts +13 -13
  220. package/lib/features/modeling/behavior/util/LineIntersect.js +39 -39
  221. package/lib/features/modeling/behavior/util/NonInterruptingUtil.d.ts +3 -3
  222. package/lib/features/modeling/behavior/util/NonInterruptingUtil.js +32 -32
  223. package/lib/features/modeling/behavior/util/ResizeUtil.d.ts +1 -1
  224. package/lib/features/modeling/cmd/AddLaneHandler.d.ts +22 -22
  225. package/lib/features/modeling/cmd/AddLaneHandler.js +187 -187
  226. package/lib/features/modeling/cmd/IdClaimHandler.d.ts +22 -22
  227. package/lib/features/modeling/cmd/IdClaimHandler.js +51 -51
  228. package/lib/features/modeling/cmd/ResizeLaneHandler.d.ts +39 -39
  229. package/lib/features/modeling/cmd/ResizeLaneHandler.js +146 -146
  230. package/lib/features/modeling/cmd/SetColorHandler.d.ts +18 -18
  231. package/lib/features/modeling/cmd/SplitLaneHandler.d.ts +20 -20
  232. package/lib/features/modeling/cmd/SplitLaneHandler.js +99 -99
  233. package/lib/features/modeling/cmd/UpdateCanvasRootHandler.d.ts +20 -20
  234. package/lib/features/modeling/cmd/UpdateCanvasRootHandler.js +99 -99
  235. package/lib/features/modeling/cmd/UpdateFlowNodeRefsHandler.d.ts +21 -21
  236. package/lib/features/modeling/cmd/UpdateFlowNodeRefsHandler.js +218 -218
  237. package/lib/features/modeling/cmd/UpdateModdlePropertiesHandler.d.ts +20 -20
  238. package/lib/features/modeling/cmd/UpdateModdlePropertiesHandler.js +107 -107
  239. package/lib/features/modeling/cmd/UpdatePropertiesHandler.d.ts +58 -58
  240. package/lib/features/modeling/cmd/UpdatePropertiesHandler.js +260 -260
  241. package/lib/features/modeling/cmd/UpdateSemanticParentHandler.d.ts +18 -18
  242. package/lib/features/modeling/index.d.ts +27 -27
  243. package/lib/features/modeling/index.js +45 -45
  244. package/lib/features/modeling/util/LaneUtil.d.ts +46 -46
  245. package/lib/features/modeling/util/LaneUtil.js +188 -188
  246. package/lib/features/modeling/util/ModelingUtil.d.ts +23 -23
  247. package/lib/features/modeling/util/ModelingUtil.js +88 -88
  248. package/lib/features/modeling-feedback/ModelingFeedback.d.ts +13 -13
  249. package/lib/features/modeling-feedback/ModelingFeedback.js +46 -46
  250. package/lib/features/modeling-feedback/index.d.ts +7 -7
  251. package/lib/features/modeling-feedback/index.js +12 -12
  252. package/lib/features/ordering/BpmnOrderingProvider.d.ts +19 -19
  253. package/lib/features/ordering/BpmnOrderingProvider.js +191 -191
  254. package/lib/features/ordering/index.d.ts +6 -6
  255. package/lib/features/ordering/index.js +5 -5
  256. package/lib/features/outline/OutlineProvider.d.ts +39 -39
  257. package/lib/features/outline/OutlineProvider.js +189 -189
  258. package/lib/features/outline/OutlineUtil.d.ts +23 -23
  259. package/lib/features/outline/OutlineUtil.js +35 -35
  260. package/lib/features/outline/index.d.ts +7 -7
  261. package/lib/features/outline/index.js +10 -10
  262. package/lib/features/palette/PaletteProvider.d.ts +34 -34
  263. package/lib/features/palette/PaletteProvider.js +214 -214
  264. package/lib/features/palette/index.d.ts +9 -9
  265. package/lib/features/palette/index.js +23 -23
  266. package/lib/features/popup-menu/ReplaceMenuProvider.d.ts +52 -52
  267. package/lib/features/popup-menu/ReplaceMenuProvider.js +629 -677
  268. package/lib/features/popup-menu/index.d.ts +11 -11
  269. package/lib/features/popup-menu/index.js +16 -16
  270. package/lib/features/popup-menu/util/Icons.d.ts +5 -5
  271. package/lib/features/popup-menu/util/Icons.js +14 -14
  272. package/lib/features/popup-menu/util/TypeUtil.d.ts +14 -14
  273. package/lib/features/popup-menu/util/TypeUtil.js +52 -52
  274. package/lib/features/replace/BpmnReplace.d.ts +45 -45
  275. package/lib/features/replace/BpmnReplace.js +391 -391
  276. package/lib/features/replace/ReplaceOptions.d.ts +79 -75
  277. package/lib/features/replace/ReplaceOptions.js +998 -919
  278. package/lib/features/replace/index.d.ts +9 -9
  279. package/lib/features/replace/index.js +14 -14
  280. package/lib/features/replace-preview/BpmnReplacePreview.d.ts +17 -17
  281. package/lib/features/replace-preview/BpmnReplacePreview.js +139 -139
  282. package/lib/features/replace-preview/index.d.ts +7 -7
  283. package/lib/features/replace-preview/index.js +11 -11
  284. package/lib/features/rules/BpmnRules.d.ts +181 -181
  285. package/lib/features/rules/BpmnRules.js +1191 -1191
  286. package/lib/features/rules/index.d.ts +7 -7
  287. package/lib/features/rules/index.js +11 -11
  288. package/lib/features/search/BpmnSearchProvider.d.ts +34 -34
  289. package/lib/features/search/BpmnSearchProvider.js +91 -91
  290. package/lib/features/search/index.d.ts +7 -7
  291. package/lib/features/search/index.js +14 -14
  292. package/lib/features/snapping/BpmnConnectSnapping.d.ts +17 -17
  293. package/lib/features/snapping/BpmnCreateMoveSnapping.d.ts +41 -41
  294. package/lib/features/snapping/BpmnCreateMoveSnapping.js +289 -289
  295. package/lib/features/snapping/BpmnSnappingUtil.d.ts +11 -11
  296. package/lib/features/snapping/index.d.ts +9 -9
  297. package/lib/features/snapping/index.js +12 -12
  298. package/lib/features/space-tool/BpmnSpaceTool.d.ts +21 -21
  299. package/lib/features/space-tool/BpmnSpaceTool.js +69 -69
  300. package/lib/features/space-tool/index.d.ts +6 -6
  301. package/lib/features/space-tool/index.js +7 -7
  302. package/lib/import/BpmnImporter.d.ts +51 -51
  303. package/lib/import/BpmnImporter.js +363 -363
  304. package/lib/import/BpmnTreeWalker.d.ts +20 -20
  305. package/lib/import/BpmnTreeWalker.js +453 -453
  306. package/lib/import/Importer.d.ts +25 -25
  307. package/lib/import/Importer.js +222 -222
  308. package/lib/import/Util.d.ts +1 -1
  309. package/lib/import/Util.js +6 -6
  310. package/lib/import/index.d.ts +6 -6
  311. package/lib/import/index.js +9 -9
  312. package/lib/index.d.ts +1 -1
  313. package/lib/index.js +2 -2
  314. package/lib/model/Types.d.ts +25 -25
  315. package/lib/model/Types.ts +40 -40
  316. package/lib/util/CompatibilityUtil.d.ts +8 -8
  317. package/lib/util/CompatibilityUtil.js +29 -29
  318. package/lib/util/DiUtil.d.ts +60 -60
  319. package/lib/util/DiUtil.js +122 -122
  320. package/lib/util/DrilldownUtil.d.ts +39 -39
  321. package/lib/util/DrilldownUtil.js +69 -69
  322. package/lib/util/LabelUtil.d.ts +83 -83
  323. package/lib/util/LabelUtil.js +266 -266
  324. package/lib/util/ModelUtil.d.ts +40 -40
  325. package/lib/util/ModelUtil.js +58 -58
  326. package/lib/util/PoweredByUtil.d.ts +8 -8
  327. package/lib/util/PoweredByUtil.js +99 -99
  328. package/lib/util/Types.js +4 -4
  329. package/lib/util/Types.ts +3 -3
  330. package/package.json +131 -131
  331. package/test/helper/TranslationCollector.js +15 -15
  332. package/test/helper/index.js +313 -313
  333. package/test/matchers/BoundsMatchers.js +252 -252
  334. package/test/matchers/ConnectionMatchers.js +165 -165
  335. package/test/matchers/JSONMatcher.js +19 -19
  336. package/test/util/KeyEvents.js +22 -22
  337. package/test/util/MockEvents.js +61 -61
  338. package/test/util/custom-rules/CustomRules.js +16 -16
  339. package/test/util/custom-rules/index.js +6 -6
@@ -1,478 +1,478 @@
1
- /**
2
- * Map containing SVG paths needed by BpmnRenderer
3
- */
4
- export default function PathMap() {
5
-
6
- /**
7
- * Contains a map of path elements
8
- *
9
- * <h1>Path definition</h1>
10
- * A parameterized path is defined like this:
11
- * <pre>
12
- * 'GATEWAY_PARALLEL': {
13
- * d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
14
- '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
15
- * height: 17.5,
16
- * width: 17.5,
17
- * heightElements: [2.5, 7.5],
18
- * widthElements: [2.5, 7.5]
19
- * }
20
- * </pre>
21
- * <p>It's important to specify a correct <b>height and width</b> for the path as the scaling
22
- * is based on the ratio between the specified height and width in this object and the
23
- * height and width that is set as scale target (Note x,y coordinates will be scaled with
24
- * individual ratios).</p>
25
- * <p>The '<b>heightElements</b>' and '<b>widthElements</b>' array must contain the values that will be scaled.
26
- * The scaling is based on the computed ratios.
27
- * Coordinates on the y axis should be in the <b>heightElement</b>'s array, they will be scaled using
28
- * the computed ratio coefficient.
29
- * In the parameterized path the scaled values can be accessed through the 'e' object in {} brackets.
30
- * <ul>
31
- * <li>The values for the y axis can be accessed in the path string using {e.y0}, {e.y1}, ....</li>
32
- * <li>The values for the x axis can be accessed in the path string using {e.x0}, {e.x1}, ....</li>
33
- * </ul>
34
- * The numbers x0, x1 respectively y0, y1, ... map to the corresponding array index.
35
- * </p>
36
- */
37
- this.pathMap = {
38
- 'EVENT_MESSAGE': {
39
- d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
40
- height: 36,
41
- width: 36,
42
- heightElements: [ 6, 14 ],
43
- widthElements: [ 10.5, 21 ]
44
- },
45
- 'EVENT_SIGNAL': {
46
- d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',
47
- height: 36,
48
- width: 36,
49
- heightElements: [ 18 ],
50
- widthElements: [ 10, 20 ]
51
- },
52
- 'EVENT_ESCALATION': {
53
- d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z',
54
- height: 36,
55
- width: 36,
56
- heightElements: [ 20, 7 ],
57
- widthElements: [ 8 ]
58
- },
59
- 'EVENT_CONDITIONAL': {
60
- d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +
61
- 'M {e.x2},{e.y3} l {e.x0},0 ' +
62
- 'M {e.x2},{e.y4} l {e.x0},0 ' +
63
- 'M {e.x2},{e.y5} l {e.x0},0 ' +
64
- 'M {e.x2},{e.y6} l {e.x0},0 ' +
65
- 'M {e.x2},{e.y7} l {e.x0},0 ' +
66
- 'M {e.x2},{e.y8} l {e.x0},0 ',
67
- height: 36,
68
- width: 36,
69
- heightElements: [ 8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5 ],
70
- widthElements: [ 10.5, 14.5, 12.5 ]
71
- },
72
- 'EVENT_LINK': {
73
- d: 'm {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z',
74
- height: 36,
75
- width: 36,
76
- heightElements: [ 4.4375, 6.75, 7.8125 ],
77
- widthElements: [ 9.84375, 13.5 ]
78
- },
79
- 'EVENT_ERROR': {
80
- d: 'm {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z',
81
- height: 36,
82
- width: 36,
83
- heightElements: [ 0.023, 8.737, 8.151, 16.564, 10.591, 8.714 ],
84
- widthElements: [ 0.085, 6.672, 6.97, 4.273, 5.337, 6.636 ]
85
- },
86
- 'EVENT_CANCEL_45': {
87
- d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
88
- '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
89
- height: 36,
90
- width: 36,
91
- heightElements: [ 4.75, 8.5 ],
92
- widthElements: [ 4.75, 8.5 ]
93
- },
94
- 'EVENT_COMPENSATION': {
95
- d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z',
96
- height: 36,
97
- width: 36,
98
- heightElements: [ 6.5, 13, 0.4, 6.1 ],
99
- widthElements: [ 9, 9.3, 8.7 ]
100
- },
101
- 'EVENT_TIMER_WH': {
102
- d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',
103
- height: 36,
104
- width: 36,
105
- heightElements: [ 10, 2 ],
106
- widthElements: [ 3, 7 ]
107
- },
108
- 'EVENT_TIMER_LINE': {
109
- d: 'M {mx},{my} ' +
110
- 'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',
111
- height: 36,
112
- width: 36,
113
- heightElements: [ 10, 3 ],
114
- widthElements: [ 0, 0 ]
115
- },
116
- 'EVENT_MULTIPLE': {
117
- d:'m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',
118
- height: 36,
119
- width: 36,
120
- heightElements: [ 6.28099, 12.56199 ],
121
- widthElements: [ 3.1405, 9.42149, 12.56198 ]
122
- },
123
- 'EVENT_PARALLEL_MULTIPLE': {
124
- d:'m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
125
- '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
126
- height: 36,
127
- width: 36,
128
- heightElements: [ 2.56228, 7.68683 ],
129
- widthElements: [ 2.56228, 7.68683 ]
130
- },
131
- 'GATEWAY_EXCLUSIVE': {
132
- d:'m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +
133
- '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +
134
- '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',
135
- height: 17.5,
136
- width: 17.5,
137
- heightElements: [ 8.5, 6.5312, -6.5312, -8.5 ],
138
- widthElements: [ 6.5, -6.5, 3, -3, 5, -5 ]
139
- },
140
- 'GATEWAY_PARALLEL': {
141
- d:'m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
142
- '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
143
- height: 30,
144
- width: 30,
145
- heightElements: [ 5, 12.5 ],
146
- widthElements: [ 5, 12.5 ]
147
- },
148
- 'GATEWAY_EVENT_BASED': {
149
- d:'m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',
150
- height: 11,
151
- width: 11,
152
- heightElements: [ -6, 6, 12, -12 ],
153
- widthElements: [ 9, -3, -12 ]
154
- },
155
- 'GATEWAY_COMPLEX': {
156
- d:'m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} ' +
157
- '{e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} ' +
158
- '{e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} ' +
159
- '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',
160
- height: 17.125,
161
- width: 17.125,
162
- heightElements: [ 4.875, 3.4375, 2.125, 3 ],
163
- widthElements: [ 3.4375, 2.125, 4.875, 3 ]
164
- },
165
- 'DATA_OBJECT_PATH': {
166
- d:'m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0',
167
- height: 61,
168
- width: 51,
169
- heightElements: [ 10, 50, 60 ],
170
- widthElements: [ 10, 40, 50, 60 ]
171
- },
172
- 'DATA_OBJECT_COLLECTION_PATH': {
173
- d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
174
- height: 10,
175
- width: 10,
176
- heightElements: [],
177
- widthElements: []
178
- },
179
- 'DATA_ARROW': {
180
- d:'m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',
181
- height: 61,
182
- width: 51,
183
- heightElements: [],
184
- widthElements: []
185
- },
186
- 'DATA_STORE': {
187
- d:'m {mx},{my} ' +
188
- 'l 0,{e.y2} ' +
189
- 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +
190
- 'l 0,-{e.y2} ' +
191
- 'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +
192
- 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +
193
- 'm -{e.x2},{e.y0}' +
194
- 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +
195
- 'm -{e.x2},{e.y0}' +
196
- 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0',
197
- height: 61,
198
- width: 61,
199
- heightElements: [ 7, 10, 45 ],
200
- widthElements: [ 2, 58, 60 ]
201
- },
202
- 'TEXT_ANNOTATION': {
203
- d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',
204
- height: 30,
205
- width: 10,
206
- heightElements: [ 30 ],
207
- widthElements: [ 10 ]
208
- },
209
- 'MARKER_SUB_PROCESS': {
210
- d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',
211
- height: 10,
212
- width: 10,
213
- heightElements: [],
214
- widthElements: []
215
- },
216
- 'MARKER_PARALLEL': {
217
- d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
218
- height: 10,
219
- width: 10,
220
- heightElements: [],
221
- widthElements: []
222
- },
223
- 'MARKER_SEQUENTIAL': {
224
- d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',
225
- height: 10,
226
- width: 10,
227
- heightElements: [],
228
- widthElements: []
229
- },
230
- 'MARKER_COMPENSATION': {
231
- d: 'm {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z',
232
- height: 10,
233
- width: 21,
234
- heightElements: [],
235
- widthElements: []
236
- },
237
- 'MARKER_LOOP': {
238
- d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +
239
- '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +
240
- '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +
241
- 'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',
242
- height: 13.9,
243
- width: 13.7,
244
- heightElements: [],
245
- widthElements: []
246
- },
247
- 'MARKER_ADHOC': {
248
- d: 'm {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 ' +
249
- '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +
250
- '1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 ' +
251
- '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +
252
- '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',
253
- height: 4,
254
- width: 15,
255
- heightElements: [],
256
- widthElements: []
257
- },
258
- 'TASK_TYPE_SEND': {
259
- d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
260
- height: 14,
261
- width: 21,
262
- heightElements: [ 6, 14 ],
263
- widthElements: [ 10.5, 21 ]
264
- },
265
- 'TASK_TYPE_SCRIPT': {
266
- d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +
267
- 'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +
268
- 'm -7,-12 l 5,0 ' +
269
- 'm -4.5,3 l 4.5,0 ' +
270
- 'm -3,3 l 5,0' +
271
- 'm -4,3 l 5,0',
272
- height: 15,
273
- width: 12.6,
274
- heightElements: [ 6, 14 ],
275
- widthElements: [ 10.5, 21 ]
276
- },
277
- 'TASK_TYPE_USER_1': {
278
- d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +
279
- '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +
280
- '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +
281
- 'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +
282
- 'm -8,6 l 0,5.5 m 11,0 l 0,-5'
283
- },
284
- 'TASK_TYPE_USER_2': {
285
- d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +
286
- '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '
287
- },
288
- 'TASK_TYPE_USER_3': {
289
- d: 'm {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 ' +
290
- '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +
291
- '-4.20799998,3.36699999 -4.20699998,4.34799999 z'
292
- },
293
- 'TASK_TYPE_MANUAL': {
294
- d: 'm {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 ' +
295
- '-0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 ' +
296
- '0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 ' +
297
- '-1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 ' +
298
- '0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 ' +
299
- '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +
300
- '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +
301
- '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +
302
- '-1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 ' +
303
- '-0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 ' +
304
- '0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 ' +
305
- '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'
306
- },
307
- 'TASK_TYPE_INSTANTIATING_SEND': {
308
- d: 'm {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6'
309
- },
310
- 'TASK_TYPE_SERVICE': {
311
- d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +
312
- '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +
313
- '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +
314
- 'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +
315
- '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +
316
- '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +
317
- 'h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 ' +
318
- '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +
319
- 'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +
320
- 'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +
321
- '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +
322
- 'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +
323
- 'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
324
- '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
325
- '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
326
- },
327
- 'TASK_TYPE_SERVICE_FILL': {
328
- d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
329
- '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
330
- '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
331
- },
332
- 'TASK_TYPE_BUSINESS_RULE_HEADER': {
333
- d: 'm {mx},{my} 0,4 20,0 0,-4 z'
334
- },
335
- 'TASK_TYPE_BUSINESS_RULE_MAIN': {
336
- d: 'm {mx},{my} 0,12 20,0 0,-12 z' +
337
- 'm 0,8 l 20,0 ' +
338
- 'm -13,-4 l 0,8'
339
- },
340
- 'MESSAGE_FLOW_MARKER': {
341
- d: 'm {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6'
342
- }
343
- };
344
-
345
- /**
346
- * Return raw path for the given ID.
347
- *
348
- * @param {string} pathId
349
- *
350
- * @return {string} raw path
351
- */
352
- this.getRawPath = function getRawPath(pathId) {
353
- return this.pathMap[pathId].d;
354
- };
355
-
356
- /**
357
- * Scales the path to the given height and width.
358
- * <h1>Use case</h1>
359
- * <p>Use case is to scale the content of elements (event, gateways) based
360
- * on the element bounding box's size.
361
- * </p>
362
- * <h1>Why not transform</h1>
363
- * <p>Scaling a path with transform() will also scale the stroke and IE does not support
364
- * the option 'non-scaling-stroke' to prevent this.
365
- * Also there are use cases where only some parts of a path should be
366
- * scaled.</p>
367
- *
368
- * @param {string} pathId The ID of the path.
369
- * @param {Object} param <p>
370
- * Example param object scales the path to 60% size of the container (data.width, data.height).
371
- * <pre>
372
- * {
373
- * xScaleFactor: 0.6,
374
- * yScaleFactor:0.6,
375
- * containerWidth: data.width,
376
- * containerHeight: data.height,
377
- * position: {
378
- * mx: 0.46,
379
- * my: 0.2,
380
- * }
381
- * }
382
- * </pre>
383
- * <ul>
384
- * <li>targetpathwidth = xScaleFactor * containerWidth</li>
385
- * <li>targetpathheight = yScaleFactor * containerHeight</li>
386
- * <li>Position is used to set the starting coordinate of the path. M is computed:
387
- * <ul>
388
- * <li>position.x * containerWidth</li>
389
- * <li>position.y * containerHeight</li>
390
- * </ul>
391
- * Center of the container <pre> position: {
392
- * mx: 0.5,
393
- * my: 0.5,
394
- * }</pre>
395
- * Upper left corner of the container
396
- * <pre> position: {
397
- * mx: 0.0,
398
- * my: 0.0,
399
- * }</pre>
400
- * </li>
401
- * </ul>
402
- * </p>
403
- *
404
- * @return {string} scaled path
405
- */
406
- this.getScaledPath = function getScaledPath(pathId, param) {
407
- var rawPath = this.pathMap[pathId];
408
-
409
- // positioning
410
- // compute the start point of the path
411
- var mx, my;
412
-
413
- if (param.abspos) {
414
- mx = param.abspos.x;
415
- my = param.abspos.y;
416
- } else {
417
- mx = param.containerWidth * param.position.mx;
418
- my = param.containerHeight * param.position.my;
419
- }
420
-
421
- var coordinates = {}; // map for the scaled coordinates
422
- if (param.position) {
423
-
424
- // path
425
- var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;
426
- var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;
427
-
428
-
429
- // Apply height ratio
430
- for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {
431
- coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;
432
- }
433
-
434
- // Apply width ratio
435
- for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {
436
- coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;
437
- }
438
- }
439
-
440
- // Apply value to raw path
441
- var path = format(
442
- rawPath.d, {
443
- mx: mx,
444
- my: my,
445
- e: coordinates
446
- }
447
- );
448
- return path;
449
- };
450
- }
451
-
452
- // helpers //////////////////////
453
-
454
- // copied and adjusted from https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js
455
- var tokenRegex = /\{([^{}]+)\}/g,
456
- objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g; // matches .xxxxx or ["xxxxx"] to run over object properties
457
-
458
- function replacer(all, key, obj) {
459
- var res = obj;
460
- key.replace(objNotationRegex, function(all, name, quote, quotedName, isFunc) {
461
- name = name || quotedName;
462
- if (res) {
463
- if (name in res) {
464
- res = res[name];
465
- }
466
- typeof res == 'function' && isFunc && (res = res());
467
- }
468
- });
469
- res = (res == null || res == obj ? all : res) + '';
470
-
471
- return res;
472
- }
473
-
474
- function format(str, obj) {
475
- return String(str).replace(tokenRegex, function(all, key) {
476
- return replacer(all, key, obj);
477
- });
478
- }
1
+ /**
2
+ * Map containing SVG paths needed by BpmnRenderer
3
+ */
4
+ export default function PathMap() {
5
+
6
+ /**
7
+ * Contains a map of path elements
8
+ *
9
+ * <h1>Path definition</h1>
10
+ * A parameterized path is defined like this:
11
+ * <pre>
12
+ * 'GATEWAY_PARALLEL': {
13
+ * d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
14
+ '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
15
+ * height: 17.5,
16
+ * width: 17.5,
17
+ * heightElements: [2.5, 7.5],
18
+ * widthElements: [2.5, 7.5]
19
+ * }
20
+ * </pre>
21
+ * <p>It's important to specify a correct <b>height and width</b> for the path as the scaling
22
+ * is based on the ratio between the specified height and width in this object and the
23
+ * height and width that is set as scale target (Note x,y coordinates will be scaled with
24
+ * individual ratios).</p>
25
+ * <p>The '<b>heightElements</b>' and '<b>widthElements</b>' array must contain the values that will be scaled.
26
+ * The scaling is based on the computed ratios.
27
+ * Coordinates on the y axis should be in the <b>heightElement</b>'s array, they will be scaled using
28
+ * the computed ratio coefficient.
29
+ * In the parameterized path the scaled values can be accessed through the 'e' object in {} brackets.
30
+ * <ul>
31
+ * <li>The values for the y axis can be accessed in the path string using {e.y0}, {e.y1}, ....</li>
32
+ * <li>The values for the x axis can be accessed in the path string using {e.x0}, {e.x1}, ....</li>
33
+ * </ul>
34
+ * The numbers x0, x1 respectively y0, y1, ... map to the corresponding array index.
35
+ * </p>
36
+ */
37
+ this.pathMap = {
38
+ 'EVENT_MESSAGE': {
39
+ d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
40
+ height: 36,
41
+ width: 36,
42
+ heightElements: [ 6, 14 ],
43
+ widthElements: [ 10.5, 21 ]
44
+ },
45
+ 'EVENT_SIGNAL': {
46
+ d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',
47
+ height: 36,
48
+ width: 36,
49
+ heightElements: [ 18 ],
50
+ widthElements: [ 10, 20 ]
51
+ },
52
+ 'EVENT_ESCALATION': {
53
+ d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z',
54
+ height: 36,
55
+ width: 36,
56
+ heightElements: [ 20, 7 ],
57
+ widthElements: [ 8 ]
58
+ },
59
+ 'EVENT_CONDITIONAL': {
60
+ d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +
61
+ 'M {e.x2},{e.y3} l {e.x0},0 ' +
62
+ 'M {e.x2},{e.y4} l {e.x0},0 ' +
63
+ 'M {e.x2},{e.y5} l {e.x0},0 ' +
64
+ 'M {e.x2},{e.y6} l {e.x0},0 ' +
65
+ 'M {e.x2},{e.y7} l {e.x0},0 ' +
66
+ 'M {e.x2},{e.y8} l {e.x0},0 ',
67
+ height: 36,
68
+ width: 36,
69
+ heightElements: [ 8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5 ],
70
+ widthElements: [ 10.5, 14.5, 12.5 ]
71
+ },
72
+ 'EVENT_LINK': {
73
+ d: 'm {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z',
74
+ height: 36,
75
+ width: 36,
76
+ heightElements: [ 4.4375, 6.75, 7.8125 ],
77
+ widthElements: [ 9.84375, 13.5 ]
78
+ },
79
+ 'EVENT_ERROR': {
80
+ d: 'm {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z',
81
+ height: 36,
82
+ width: 36,
83
+ heightElements: [ 0.023, 8.737, 8.151, 16.564, 10.591, 8.714 ],
84
+ widthElements: [ 0.085, 6.672, 6.97, 4.273, 5.337, 6.636 ]
85
+ },
86
+ 'EVENT_CANCEL_45': {
87
+ d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
88
+ '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
89
+ height: 36,
90
+ width: 36,
91
+ heightElements: [ 4.75, 8.5 ],
92
+ widthElements: [ 4.75, 8.5 ]
93
+ },
94
+ 'EVENT_COMPENSATION': {
95
+ d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z',
96
+ height: 36,
97
+ width: 36,
98
+ heightElements: [ 6.5, 13, 0.4, 6.1 ],
99
+ widthElements: [ 9, 9.3, 8.7 ]
100
+ },
101
+ 'EVENT_TIMER_WH': {
102
+ d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',
103
+ height: 36,
104
+ width: 36,
105
+ heightElements: [ 10, 2 ],
106
+ widthElements: [ 3, 7 ]
107
+ },
108
+ 'EVENT_TIMER_LINE': {
109
+ d: 'M {mx},{my} ' +
110
+ 'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',
111
+ height: 36,
112
+ width: 36,
113
+ heightElements: [ 10, 3 ],
114
+ widthElements: [ 0, 0 ]
115
+ },
116
+ 'EVENT_MULTIPLE': {
117
+ d:'m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',
118
+ height: 36,
119
+ width: 36,
120
+ heightElements: [ 6.28099, 12.56199 ],
121
+ widthElements: [ 3.1405, 9.42149, 12.56198 ]
122
+ },
123
+ 'EVENT_PARALLEL_MULTIPLE': {
124
+ d:'m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
125
+ '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
126
+ height: 36,
127
+ width: 36,
128
+ heightElements: [ 2.56228, 7.68683 ],
129
+ widthElements: [ 2.56228, 7.68683 ]
130
+ },
131
+ 'GATEWAY_EXCLUSIVE': {
132
+ d:'m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +
133
+ '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +
134
+ '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',
135
+ height: 17.5,
136
+ width: 17.5,
137
+ heightElements: [ 8.5, 6.5312, -6.5312, -8.5 ],
138
+ widthElements: [ 6.5, -6.5, 3, -3, 5, -5 ]
139
+ },
140
+ 'GATEWAY_PARALLEL': {
141
+ d:'m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
142
+ '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
143
+ height: 30,
144
+ width: 30,
145
+ heightElements: [ 5, 12.5 ],
146
+ widthElements: [ 5, 12.5 ]
147
+ },
148
+ 'GATEWAY_EVENT_BASED': {
149
+ d:'m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',
150
+ height: 11,
151
+ width: 11,
152
+ heightElements: [ -6, 6, 12, -12 ],
153
+ widthElements: [ 9, -3, -12 ]
154
+ },
155
+ 'GATEWAY_COMPLEX': {
156
+ d:'m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} ' +
157
+ '{e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} ' +
158
+ '{e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} ' +
159
+ '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',
160
+ height: 17.125,
161
+ width: 17.125,
162
+ heightElements: [ 4.875, 3.4375, 2.125, 3 ],
163
+ widthElements: [ 3.4375, 2.125, 4.875, 3 ]
164
+ },
165
+ 'DATA_OBJECT_PATH': {
166
+ d:'m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0',
167
+ height: 61,
168
+ width: 51,
169
+ heightElements: [ 10, 50, 60 ],
170
+ widthElements: [ 10, 40, 50, 60 ]
171
+ },
172
+ 'DATA_OBJECT_COLLECTION_PATH': {
173
+ d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
174
+ height: 10,
175
+ width: 10,
176
+ heightElements: [],
177
+ widthElements: []
178
+ },
179
+ 'DATA_ARROW': {
180
+ d:'m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',
181
+ height: 61,
182
+ width: 51,
183
+ heightElements: [],
184
+ widthElements: []
185
+ },
186
+ 'DATA_STORE': {
187
+ d:'m {mx},{my} ' +
188
+ 'l 0,{e.y2} ' +
189
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +
190
+ 'l 0,-{e.y2} ' +
191
+ 'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +
192
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +
193
+ 'm -{e.x2},{e.y0}' +
194
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +
195
+ 'm -{e.x2},{e.y0}' +
196
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0',
197
+ height: 61,
198
+ width: 61,
199
+ heightElements: [ 7, 10, 45 ],
200
+ widthElements: [ 2, 58, 60 ]
201
+ },
202
+ 'TEXT_ANNOTATION': {
203
+ d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',
204
+ height: 30,
205
+ width: 10,
206
+ heightElements: [ 30 ],
207
+ widthElements: [ 10 ]
208
+ },
209
+ 'MARKER_SUB_PROCESS': {
210
+ d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',
211
+ height: 10,
212
+ width: 10,
213
+ heightElements: [],
214
+ widthElements: []
215
+ },
216
+ 'MARKER_PARALLEL': {
217
+ d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
218
+ height: 10,
219
+ width: 10,
220
+ heightElements: [],
221
+ widthElements: []
222
+ },
223
+ 'MARKER_SEQUENTIAL': {
224
+ d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',
225
+ height: 10,
226
+ width: 10,
227
+ heightElements: [],
228
+ widthElements: []
229
+ },
230
+ 'MARKER_COMPENSATION': {
231
+ d: 'm {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z',
232
+ height: 10,
233
+ width: 21,
234
+ heightElements: [],
235
+ widthElements: []
236
+ },
237
+ 'MARKER_LOOP': {
238
+ d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +
239
+ '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +
240
+ '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +
241
+ 'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',
242
+ height: 13.9,
243
+ width: 13.7,
244
+ heightElements: [],
245
+ widthElements: []
246
+ },
247
+ 'MARKER_ADHOC': {
248
+ d: 'm {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 ' +
249
+ '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +
250
+ '1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 ' +
251
+ '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +
252
+ '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',
253
+ height: 4,
254
+ width: 15,
255
+ heightElements: [],
256
+ widthElements: []
257
+ },
258
+ 'TASK_TYPE_SEND': {
259
+ d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
260
+ height: 14,
261
+ width: 21,
262
+ heightElements: [ 6, 14 ],
263
+ widthElements: [ 10.5, 21 ]
264
+ },
265
+ 'TASK_TYPE_SCRIPT': {
266
+ d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +
267
+ 'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +
268
+ 'm -7,-12 l 5,0 ' +
269
+ 'm -4.5,3 l 4.5,0 ' +
270
+ 'm -3,3 l 5,0' +
271
+ 'm -4,3 l 5,0',
272
+ height: 15,
273
+ width: 12.6,
274
+ heightElements: [ 6, 14 ],
275
+ widthElements: [ 10.5, 21 ]
276
+ },
277
+ 'TASK_TYPE_USER_1': {
278
+ d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +
279
+ '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +
280
+ '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +
281
+ 'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +
282
+ 'm -8,6 l 0,5.5 m 11,0 l 0,-5'
283
+ },
284
+ 'TASK_TYPE_USER_2': {
285
+ d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +
286
+ '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '
287
+ },
288
+ 'TASK_TYPE_USER_3': {
289
+ d: 'm {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 ' +
290
+ '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +
291
+ '-4.20799998,3.36699999 -4.20699998,4.34799999 z'
292
+ },
293
+ 'TASK_TYPE_MANUAL': {
294
+ d: 'm {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 ' +
295
+ '-0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 ' +
296
+ '0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 ' +
297
+ '-1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 ' +
298
+ '0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 ' +
299
+ '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +
300
+ '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +
301
+ '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +
302
+ '-1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 ' +
303
+ '-0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 ' +
304
+ '0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 ' +
305
+ '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'
306
+ },
307
+ 'TASK_TYPE_INSTANTIATING_SEND': {
308
+ d: 'm {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6'
309
+ },
310
+ 'TASK_TYPE_SERVICE': {
311
+ d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +
312
+ '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +
313
+ '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +
314
+ 'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +
315
+ '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +
316
+ '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +
317
+ 'h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 ' +
318
+ '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +
319
+ 'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +
320
+ 'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +
321
+ '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +
322
+ 'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +
323
+ 'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
324
+ '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
325
+ '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
326
+ },
327
+ 'TASK_TYPE_SERVICE_FILL': {
328
+ d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
329
+ '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
330
+ '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
331
+ },
332
+ 'TASK_TYPE_BUSINESS_RULE_HEADER': {
333
+ d: 'm {mx},{my} 0,4 20,0 0,-4 z'
334
+ },
335
+ 'TASK_TYPE_BUSINESS_RULE_MAIN': {
336
+ d: 'm {mx},{my} 0,12 20,0 0,-12 z' +
337
+ 'm 0,8 l 20,0 ' +
338
+ 'm -13,-4 l 0,8'
339
+ },
340
+ 'MESSAGE_FLOW_MARKER': {
341
+ d: 'm {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6'
342
+ }
343
+ };
344
+
345
+ /**
346
+ * Return raw path for the given ID.
347
+ *
348
+ * @param {string} pathId
349
+ *
350
+ * @return {string} raw path
351
+ */
352
+ this.getRawPath = function getRawPath(pathId) {
353
+ return this.pathMap[pathId].d;
354
+ };
355
+
356
+ /**
357
+ * Scales the path to the given height and width.
358
+ * <h1>Use case</h1>
359
+ * <p>Use case is to scale the content of elements (event, gateways) based
360
+ * on the element bounding box's size.
361
+ * </p>
362
+ * <h1>Why not transform</h1>
363
+ * <p>Scaling a path with transform() will also scale the stroke and IE does not support
364
+ * the option 'non-scaling-stroke' to prevent this.
365
+ * Also there are use cases where only some parts of a path should be
366
+ * scaled.</p>
367
+ *
368
+ * @param {string} pathId The ID of the path.
369
+ * @param {Object} param <p>
370
+ * Example param object scales the path to 60% size of the container (data.width, data.height).
371
+ * <pre>
372
+ * {
373
+ * xScaleFactor: 0.6,
374
+ * yScaleFactor:0.6,
375
+ * containerWidth: data.width,
376
+ * containerHeight: data.height,
377
+ * position: {
378
+ * mx: 0.46,
379
+ * my: 0.2,
380
+ * }
381
+ * }
382
+ * </pre>
383
+ * <ul>
384
+ * <li>targetpathwidth = xScaleFactor * containerWidth</li>
385
+ * <li>targetpathheight = yScaleFactor * containerHeight</li>
386
+ * <li>Position is used to set the starting coordinate of the path. M is computed:
387
+ * <ul>
388
+ * <li>position.x * containerWidth</li>
389
+ * <li>position.y * containerHeight</li>
390
+ * </ul>
391
+ * Center of the container <pre> position: {
392
+ * mx: 0.5,
393
+ * my: 0.5,
394
+ * }</pre>
395
+ * Upper left corner of the container
396
+ * <pre> position: {
397
+ * mx: 0.0,
398
+ * my: 0.0,
399
+ * }</pre>
400
+ * </li>
401
+ * </ul>
402
+ * </p>
403
+ *
404
+ * @return {string} scaled path
405
+ */
406
+ this.getScaledPath = function getScaledPath(pathId, param) {
407
+ var rawPath = this.pathMap[pathId];
408
+
409
+ // positioning
410
+ // compute the start point of the path
411
+ var mx, my;
412
+
413
+ if (param.abspos) {
414
+ mx = param.abspos.x;
415
+ my = param.abspos.y;
416
+ } else {
417
+ mx = param.containerWidth * param.position.mx;
418
+ my = param.containerHeight * param.position.my;
419
+ }
420
+
421
+ var coordinates = {}; // map for the scaled coordinates
422
+ if (param.position) {
423
+
424
+ // path
425
+ var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;
426
+ var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;
427
+
428
+
429
+ // Apply height ratio
430
+ for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {
431
+ coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;
432
+ }
433
+
434
+ // Apply width ratio
435
+ for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {
436
+ coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;
437
+ }
438
+ }
439
+
440
+ // Apply value to raw path
441
+ var path = format(
442
+ rawPath.d, {
443
+ mx: mx,
444
+ my: my,
445
+ e: coordinates
446
+ }
447
+ );
448
+ return path;
449
+ };
450
+ }
451
+
452
+ // helpers //////////////////////
453
+
454
+ // copied and adjusted from https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js
455
+ var tokenRegex = /\{([^{}]+)\}/g,
456
+ objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g; // matches .xxxxx or ["xxxxx"] to run over object properties
457
+
458
+ function replacer(all, key, obj) {
459
+ var res = obj;
460
+ key.replace(objNotationRegex, function(all, name, quote, quotedName, isFunc) {
461
+ name = name || quotedName;
462
+ if (res) {
463
+ if (name in res) {
464
+ res = res[name];
465
+ }
466
+ typeof res == 'function' && isFunc && (res = res());
467
+ }
468
+ });
469
+ res = (res == null || res == obj ? all : res) + '';
470
+
471
+ return res;
472
+ }
473
+
474
+ function format(str, obj) {
475
+ return String(str).replace(tokenRegex, function(all, key) {
476
+ return replacer(all, key, obj);
477
+ });
478
+ }