bpmn-js 12.1.0 → 13.0.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.
- package/dist/bpmn-modeler.development.js +5172 -2047
- package/dist/bpmn-modeler.production.min.js +35 -35
- package/dist/bpmn-navigated-viewer.development.js +1547 -589
- package/dist/bpmn-navigated-viewer.production.min.js +5 -5
- package/dist/bpmn-viewer.development.js +1525 -584
- package/dist/bpmn-viewer.production.min.js +5 -5
- package/lib/BaseModeler.d.ts +12 -5
- package/lib/BaseModeler.js +4 -5
- package/lib/BaseViewer.d.ts +160 -366
- package/lib/BaseViewer.js +136 -57
- package/lib/Modeler.d.ts +76 -15
- package/lib/Modeler.js +6 -4
- package/lib/NavigatedViewer.d.ts +8 -3
- package/lib/Viewer.d.ts +44 -3
- package/lib/core/index.d.ts +10 -0
- package/lib/draw/BpmnRenderUtil.d.ts +76 -0
- package/lib/draw/BpmnRenderUtil.js +73 -21
- package/lib/draw/BpmnRenderer.d.ts +124 -0
- package/lib/draw/BpmnRenderer.js +51 -0
- package/lib/draw/PathMap.d.ts +330 -0
- package/lib/draw/PathMap.js +9 -2
- package/lib/draw/TextRenderer.d.ts +74 -0
- package/lib/draw/TextRenderer.js +32 -11
- package/lib/draw/index.d.ts +10 -0
- package/lib/features/align-elements/AlignElementsContextPadProvider.d.ts +32 -0
- package/lib/features/align-elements/AlignElementsContextPadProvider.js +28 -5
- package/lib/features/align-elements/AlignElementsIcons.d.ts +10 -0
- package/lib/features/align-elements/AlignElementsMenuProvider.d.ts +32 -0
- package/lib/features/align-elements/AlignElementsMenuProvider.js +38 -10
- package/lib/features/align-elements/BpmnAlignElements.d.ts +9 -0
- package/lib/features/align-elements/BpmnAlignElements.js +7 -1
- package/lib/features/align-elements/index.d.ts +11 -0
- package/lib/features/auto-place/BpmnAutoPlace.d.ts +13 -0
- package/lib/features/auto-place/BpmnAutoPlace.js +3 -0
- package/lib/features/auto-place/BpmnAutoPlaceUtil.d.ts +47 -0
- package/lib/features/auto-place/BpmnAutoPlaceUtil.js +39 -11
- package/lib/features/auto-place/index.d.ts +7 -0
- package/lib/features/auto-resize/BpmnAutoResize.d.ts +25 -0
- package/lib/features/auto-resize/BpmnAutoResize.js +15 -7
- package/lib/features/auto-resize/BpmnAutoResizeProvider.d.ts +26 -0
- package/lib/features/auto-resize/BpmnAutoResizeProvider.js +16 -4
- package/lib/features/auto-resize/index.d.ts +8 -0
- package/lib/features/context-pad/ContextPadProvider.d.ts +60 -0
- package/lib/features/context-pad/ContextPadProvider.js +64 -9
- package/lib/features/context-pad/index.d.ts +7 -0
- package/lib/features/copy-paste/BpmnCopyPaste.d.ts +17 -0
- package/lib/features/copy-paste/BpmnCopyPaste.js +15 -7
- package/lib/features/copy-paste/ModdleCopy.d.ts +45 -0
- package/lib/features/copy-paste/ModdleCopy.js +17 -45
- package/lib/features/copy-paste/index.d.ts +9 -0
- package/lib/features/di-ordering/BpmnDiOrdering.d.ts +11 -0
- package/lib/features/di-ordering/BpmnDiOrdering.js +8 -0
- package/lib/features/di-ordering/index.d.ts +6 -0
- package/lib/features/distribute-elements/BpmnDistributeElements.d.ts +10 -0
- package/lib/features/distribute-elements/BpmnDistributeElements.js +9 -4
- package/lib/features/distribute-elements/DistributeElementsIcons.d.ts +5 -0
- package/lib/features/distribute-elements/DistributeElementsMenuProvider.d.ts +32 -0
- package/lib/features/distribute-elements/DistributeElementsMenuProvider.js +27 -4
- package/lib/features/distribute-elements/index.d.ts +9 -0
- package/lib/features/drilldown/DrilldownBreadcrumbs.d.ts +19 -0
- package/lib/features/drilldown/DrilldownBreadcrumbs.js +34 -24
- package/lib/features/drilldown/DrilldownCentering.d.ts +17 -0
- package/lib/features/drilldown/DrilldownCentering.js +7 -2
- package/lib/features/drilldown/DrilldownOverlayBehavior.d.ts +18 -0
- package/lib/features/drilldown/DrilldownOverlayBehavior.js +70 -40
- package/lib/features/drilldown/SubprocessCompatibility.d.ts +21 -0
- package/lib/features/drilldown/SubprocessCompatibility.js +80 -30
- package/lib/features/drilldown/index.d.ts +13 -0
- package/lib/features/editor-actions/BpmnEditorActions.d.ts +13 -0
- package/lib/features/editor-actions/BpmnEditorActions.js +4 -0
- package/lib/features/editor-actions/index.d.ts +6 -0
- package/lib/features/grid-snapping/BpmnGridSnapping.d.ts +9 -0
- package/lib/features/grid-snapping/BpmnGridSnapping.js +7 -0
- package/lib/features/grid-snapping/behavior/GridSnappingAutoPlaceBehavior.d.ts +12 -0
- package/lib/features/grid-snapping/behavior/GridSnappingAutoPlaceBehavior.js +16 -1
- package/lib/features/grid-snapping/behavior/GridSnappingLayoutConnectionBehavior.d.ts +27 -0
- package/lib/features/grid-snapping/behavior/GridSnappingLayoutConnectionBehavior.js +20 -8
- package/lib/features/grid-snapping/behavior/GridSnappingParticipantBehavior.d.ts +13 -0
- package/lib/features/grid-snapping/behavior/GridSnappingParticipantBehavior.js +11 -1
- package/lib/features/grid-snapping/behavior/index.d.ts +10 -0
- package/lib/features/grid-snapping/index.d.ts +11 -0
- package/lib/features/interaction-events/BpmnInteractionEvents.d.ts +18 -0
- package/lib/features/interaction-events/BpmnInteractionEvents.js +34 -9
- package/lib/features/interaction-events/index.d.ts +6 -0
- package/lib/features/keyboard/BpmnKeyboardBindings.d.ts +15 -0
- package/lib/features/keyboard/BpmnKeyboardBindings.js +5 -0
- package/lib/features/keyboard/index.d.ts +7 -0
- package/lib/features/label-editing/LabelEditingPreview.d.ts +13 -0
- package/lib/features/label-editing/LabelEditingPreview.js +13 -6
- package/lib/features/label-editing/LabelEditingProvider.d.ts +62 -0
- package/lib/features/label-editing/LabelEditingProvider.js +48 -11
- package/lib/features/label-editing/LabelUtil.d.ts +14 -0
- package/lib/features/label-editing/LabelUtil.js +16 -1
- package/lib/features/label-editing/cmd/UpdateLabelHandler.d.ts +22 -0
- package/lib/features/label-editing/cmd/UpdateLabelHandler.js +14 -3
- package/lib/features/label-editing/index.d.ts +9 -0
- package/lib/features/modeling/BpmnFactory.d.ts +67 -0
- package/lib/features/modeling/BpmnFactory.js +57 -8
- package/lib/features/modeling/BpmnLayouter.d.ts +26 -0
- package/lib/features/modeling/BpmnLayouter.js +25 -2
- package/lib/features/modeling/BpmnUpdater.d.ts +92 -0
- package/lib/features/modeling/BpmnUpdater.js +90 -29
- package/lib/features/modeling/ElementFactory.d.ts +116 -0
- package/lib/features/modeling/ElementFactory.js +114 -17
- package/lib/features/modeling/ElementFactory.test.ts +133 -0
- package/lib/features/modeling/Modeling.d.ts +150 -0
- package/lib/features/modeling/Modeling.js +124 -19
- package/lib/features/modeling/Modeling.test.ts +148 -0
- package/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.d.ts +20 -0
- package/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.js +16 -6
- package/lib/features/modeling/behavior/AppendBehavior.d.ts +6 -0
- package/lib/features/modeling/behavior/AppendBehavior.js +6 -5
- package/lib/features/modeling/behavior/AssociationBehavior.d.ts +11 -0
- package/lib/features/modeling/behavior/AssociationBehavior.js +9 -1
- package/lib/features/modeling/behavior/AttachEventBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/AttachEventBehavior.js +11 -3
- package/lib/features/modeling/behavior/BoundaryEventBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/BoundaryEventBehavior.js +8 -1
- package/lib/features/modeling/behavior/CreateBehavior.d.ts +9 -0
- package/lib/features/modeling/behavior/CreateBehavior.js +6 -0
- package/lib/features/modeling/behavior/CreateDataObjectBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/CreateDataObjectBehavior.js +10 -4
- package/lib/features/modeling/behavior/CreateParticipantBehavior.d.ts +19 -0
- package/lib/features/modeling/behavior/CreateParticipantBehavior.js +10 -0
- package/lib/features/modeling/behavior/DataInputAssociationBehavior.d.ts +21 -0
- package/lib/features/modeling/behavior/DataInputAssociationBehavior.js +5 -0
- package/lib/features/modeling/behavior/DataStoreBehavior.d.ts +19 -0
- package/lib/features/modeling/behavior/DataStoreBehavior.js +12 -1
- package/lib/features/modeling/behavior/DeleteLaneBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/DeleteLaneBehavior.js +9 -3
- package/lib/features/modeling/behavior/DetachEventBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/DetachEventBehavior.js +11 -3
- package/lib/features/modeling/behavior/DropOnFlowBehavior.d.ts +13 -0
- package/lib/features/modeling/behavior/DropOnFlowBehavior.js +11 -1
- package/lib/features/modeling/behavior/EventBasedGatewayBehavior.d.ts +11 -0
- package/lib/features/modeling/behavior/EventBasedGatewayBehavior.js +9 -0
- package/lib/features/modeling/behavior/FixHoverBehavior.d.ts +17 -0
- package/lib/features/modeling/behavior/FixHoverBehavior.js +6 -0
- package/lib/features/modeling/behavior/GroupBehavior.d.ts +26 -0
- package/lib/features/modeling/behavior/GroupBehavior.js +35 -13
- package/lib/features/modeling/behavior/ImportDockingFix.d.ts +13 -0
- package/lib/features/modeling/behavior/ImportDockingFix.js +3 -0
- package/lib/features/modeling/behavior/IsHorizontalFix.d.ts +10 -0
- package/lib/features/modeling/behavior/IsHorizontalFix.js +4 -0
- package/lib/features/modeling/behavior/LabelBehavior.d.ts +56 -0
- package/lib/features/modeling/behavior/LabelBehavior.js +22 -10
- package/lib/features/modeling/behavior/LayoutConnectionBehavior.d.ts +16 -0
- package/lib/features/modeling/behavior/LayoutConnectionBehavior.js +6 -2
- package/lib/features/modeling/behavior/MessageFlowBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/MessageFlowBehavior.js +8 -0
- package/lib/features/modeling/behavior/ModelingFeedback.d.ts +13 -0
- package/lib/features/modeling/behavior/ModelingFeedback.js +11 -0
- package/lib/features/modeling/behavior/RemoveElementBehavior.d.ts +13 -0
- package/lib/features/modeling/behavior/RemoveElementBehavior.js +11 -1
- package/lib/features/modeling/behavior/RemoveEmbeddedLabelBoundsBehavior.d.ts +16 -0
- package/lib/features/modeling/behavior/RemoveEmbeddedLabelBoundsBehavior.js +8 -0
- package/lib/features/modeling/behavior/RemoveParticipantBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/RemoveParticipantBehavior.js +8 -1
- package/lib/features/modeling/behavior/ReplaceConnectionBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/ReplaceConnectionBehavior.js +13 -1
- package/lib/features/modeling/behavior/ReplaceElementBehaviour.d.ts +23 -0
- package/lib/features/modeling/behavior/ReplaceElementBehaviour.js +19 -4
- package/lib/features/modeling/behavior/ResizeBehavior.d.ts +57 -0
- package/lib/features/modeling/behavior/ResizeBehavior.js +35 -0
- package/lib/features/modeling/behavior/ResizeLaneBehavior.d.ts +16 -0
- package/lib/features/modeling/behavior/ResizeLaneBehavior.js +10 -3
- package/lib/features/modeling/behavior/RootElementReferenceBehavior.d.ts +25 -0
- package/lib/features/modeling/behavior/RootElementReferenceBehavior.js +19 -0
- package/lib/features/modeling/behavior/SpaceToolBehavior.d.ts +10 -0
- package/lib/features/modeling/behavior/SpaceToolBehavior.js +14 -4
- package/lib/features/modeling/behavior/SubProcessPlaneBehavior.d.ts +28 -0
- package/lib/features/modeling/behavior/SubProcessPlaneBehavior.js +45 -23
- package/lib/features/modeling/behavior/SubProcessStartEventBehavior.d.ts +15 -0
- package/lib/features/modeling/behavior/SubProcessStartEventBehavior.js +6 -0
- package/lib/features/modeling/behavior/ToggleCollapseConnectionBehaviour.d.ts +14 -0
- package/lib/features/modeling/behavior/ToggleCollapseConnectionBehaviour.js +14 -1
- package/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.d.ts +13 -0
- package/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js +11 -3
- package/lib/features/modeling/behavior/UnclaimIdBehavior.d.ts +19 -0
- package/lib/features/modeling/behavior/UnclaimIdBehavior.js +7 -0
- package/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.d.ts +16 -0
- package/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.js +6 -3
- package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.d.ts +17 -0
- package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.js +13 -10
- package/lib/features/modeling/behavior/index.d.ts +2 -0
- package/lib/features/modeling/behavior/index.js +3 -0
- package/lib/features/modeling/behavior/util/CategoryUtil.d.ts +49 -0
- package/lib/features/modeling/behavior/util/CategoryUtil.js +10 -6
- package/lib/features/modeling/behavior/util/ConnectionLayoutUtil.d.ts +19 -0
- package/lib/features/modeling/behavior/util/ConnectionLayoutUtil.js +11 -5
- package/lib/features/modeling/behavior/util/GeometricUtil.d.ts +1 -0
- package/lib/features/modeling/behavior/util/LabelLayoutUtil.d.ts +32 -0
- package/lib/features/modeling/behavior/util/LabelLayoutUtil.js +27 -18
- package/lib/features/modeling/behavior/util/LayoutUtil.d.ts +48 -0
- package/lib/features/modeling/behavior/util/LayoutUtil.js +35 -6
- package/lib/features/modeling/behavior/util/LineAttachmentUtil.d.ts +37 -0
- package/lib/features/modeling/behavior/util/LineAttachmentUtil.js +17 -5
- package/lib/features/modeling/behavior/util/LineIntersect.d.ts +13 -0
- package/lib/features/modeling/behavior/util/LineIntersect.js +4 -0
- package/lib/features/modeling/behavior/util/ResizeUtil.d.ts +1 -0
- package/lib/features/modeling/cmd/AddLaneHandler.d.ts +22 -0
- package/lib/features/modeling/cmd/AddLaneHandler.js +8 -0
- package/lib/features/modeling/cmd/IdClaimHandler.d.ts +22 -0
- package/lib/features/modeling/cmd/IdClaimHandler.js +15 -0
- package/lib/features/modeling/cmd/ResizeLaneHandler.d.ts +39 -0
- package/lib/features/modeling/cmd/ResizeLaneHandler.js +17 -4
- package/lib/features/modeling/cmd/SetColorHandler.d.ts +18 -0
- package/lib/features/modeling/cmd/SetColorHandler.js +25 -12
- package/lib/features/modeling/cmd/SplitLaneHandler.d.ts +22 -0
- package/lib/features/modeling/cmd/SplitLaneHandler.js +9 -0
- package/lib/features/modeling/cmd/UpdateCanvasRootHandler.d.ts +20 -0
- package/lib/features/modeling/cmd/UpdateCanvasRootHandler.js +16 -1
- package/lib/features/modeling/cmd/UpdateFlowNodeRefsHandler.d.ts +21 -0
- package/lib/features/modeling/cmd/UpdateFlowNodeRefsHandler.js +29 -4
- package/lib/features/modeling/cmd/UpdateModdlePropertiesHandler.d.ts +20 -0
- package/lib/features/modeling/cmd/UpdateModdlePropertiesHandler.js +17 -3
- package/lib/features/modeling/cmd/UpdatePropertiesHandler.d.ts +60 -0
- package/lib/features/modeling/cmd/UpdatePropertiesHandler.js +38 -14
- package/lib/features/modeling/cmd/UpdateSemanticParentHandler.d.ts +18 -0
- package/lib/features/modeling/cmd/UpdateSemanticParentHandler.js +15 -0
- package/lib/features/modeling/index.d.ts +27 -0
- package/lib/features/modeling/util/LaneUtil.d.ts +46 -0
- package/lib/features/modeling/util/LaneUtil.js +22 -13
- package/lib/features/modeling/util/ModelingUtil.d.ts +12 -0
- package/lib/features/modeling/util/ModelingUtil.js +10 -4
- package/lib/features/ordering/BpmnOrderingProvider.d.ts +21 -0
- package/lib/features/ordering/BpmnOrderingProvider.js +9 -3
- package/lib/features/ordering/index.d.ts +7 -0
- package/lib/features/palette/PaletteProvider.d.ts +34 -0
- package/lib/features/palette/PaletteProvider.js +26 -2
- package/lib/features/palette/index.d.ts +9 -0
- package/lib/features/popup-menu/ReplaceMenuProvider.d.ts +50 -0
- package/lib/features/popup-menu/ReplaceMenuProvider.js +226 -202
- package/lib/features/popup-menu/index.d.ts +11 -0
- package/lib/features/popup-menu/util/TypeUtil.d.ts +12 -0
- package/lib/features/popup-menu/util/TypeUtil.js +4 -1
- package/lib/features/replace/BpmnReplace.d.ts +47 -0
- package/lib/features/replace/BpmnReplace.js +81 -29
- package/lib/features/replace/ReplaceOptions.d.ts +70 -0
- package/lib/features/replace/ReplaceOptions.js +58 -0
- package/lib/features/replace/index.d.ts +9 -0
- package/lib/features/replace-preview/BpmnReplacePreview.d.ts +17 -0
- package/lib/features/replace-preview/BpmnReplacePreview.js +15 -1
- package/lib/features/replace-preview/index.d.ts +7 -0
- package/lib/features/rules/BpmnRules.d.ts +171 -0
- package/lib/features/rules/BpmnRules.js +295 -46
- package/lib/features/rules/index.d.ts +7 -0
- package/lib/features/search/BpmnSearchProvider.d.ts +29 -0
- package/lib/features/search/BpmnSearchProvider.js +30 -22
- package/lib/features/search/index.d.ts +7 -0
- package/lib/features/snapping/BpmnConnectSnapping.d.ts +17 -0
- package/lib/features/snapping/BpmnConnectSnapping.js +51 -3
- package/lib/features/snapping/BpmnCreateMoveSnapping.d.ts +41 -0
- package/lib/features/snapping/BpmnCreateMoveSnapping.js +47 -1
- package/lib/features/snapping/BpmnSnappingUtil.d.ts +11 -0
- package/lib/features/snapping/BpmnSnappingUtil.js +12 -0
- package/lib/features/snapping/index.d.ts +9 -0
- package/lib/features/space-tool/BpmnSpaceTool.d.ts +21 -0
- package/lib/features/space-tool/BpmnSpaceTool.js +20 -1
- package/lib/features/space-tool/index.d.ts +6 -0
- package/lib/import/BpmnImporter.d.ts +49 -0
- package/lib/import/BpmnImporter.js +37 -10
- package/lib/import/BpmnTreeWalker.d.ts +22 -0
- package/lib/import/BpmnTreeWalker.js +25 -22
- package/lib/import/Importer.d.ts +25 -0
- package/lib/import/Importer.js +15 -21
- package/lib/import/Util.d.ts +1 -0
- package/lib/import/index.d.ts +6 -0
- package/lib/model/Types.d.ts +24 -0
- package/lib/model/Types.ts +40 -0
- package/lib/util/CompatibilityUtil.d.ts +22 -0
- package/lib/util/CompatibilityUtil.js +13 -0
- package/lib/util/DiUtil.d.ts +53 -0
- package/lib/util/DiUtil.js +47 -13
- package/lib/util/DrilldownUtil.d.ts +39 -0
- package/lib/util/DrilldownUtil.js +12 -8
- package/lib/util/LabelUtil.d.ts +73 -0
- package/lib/util/LabelUtil.js +40 -16
- package/lib/util/ModelUtil.d.ts +40 -0
- package/lib/util/ModelUtil.js +9 -5
- package/lib/util/PoweredByUtil.d.ts +8 -0
- package/lib/util/Types.js +5 -0
- package/lib/util/Types.ts +4 -0
- package/package.json +10 -5
- package/test/matchers/ConnectionMatchers.js +1 -1
- package/lib/icons/dist/append.svg +0 -1
- package/lib/icons/dist/connect-context-pad.svg +0 -1
- package/lib/icons/dist/connect-palette.svg +0 -1
- package/lib/icons/dist/create.svg +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
every,
|
|
3
2
|
some
|
|
4
3
|
} from 'min-dash';
|
|
5
4
|
|
|
@@ -11,8 +10,20 @@ import {
|
|
|
11
10
|
componentsToPath
|
|
12
11
|
} from 'diagram-js/lib/util/RenderUtil';
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {import('../model').ModdleElement} ModdleElement
|
|
16
|
+
* @typedef {import('../model').DiagramElement} DiagramElement
|
|
17
|
+
*
|
|
18
|
+
* @typedef {import('../model').ShapeLike} ShapeLike
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
// re-export for compatibility
|
|
22
|
+
export {
|
|
23
|
+
getDi,
|
|
24
|
+
getBusinessObject as getSemantic
|
|
25
|
+
} from '../util/ModelUtil';
|
|
26
|
+
|
|
16
27
|
|
|
17
28
|
export var black = 'hsl(225, 10%, 15%)';
|
|
18
29
|
|
|
@@ -21,54 +32,75 @@ export var black = 'hsl(225, 10%, 15%)';
|
|
|
21
32
|
/**
|
|
22
33
|
* Checks if eventDefinition of the given element matches with semantic type.
|
|
23
34
|
*
|
|
24
|
-
* @
|
|
35
|
+
* @param {ModdleElement} event
|
|
36
|
+
* @param {string} eventDefinitionType
|
|
37
|
+
*
|
|
38
|
+
* @return {boolean}
|
|
25
39
|
*/
|
|
26
|
-
export function isTypedEvent(event, eventDefinitionType
|
|
27
|
-
|
|
28
|
-
function matches(definition, filter) {
|
|
29
|
-
return every(filter, function(val, key) {
|
|
30
|
-
|
|
31
|
-
// we want a == conversion here, to be able to catch
|
|
32
|
-
// undefined == false and friends
|
|
33
|
-
/* jshint -W116 */
|
|
34
|
-
return definition[key] == val;
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
40
|
+
export function isTypedEvent(event, eventDefinitionType) {
|
|
38
41
|
return some(event.eventDefinitions, function(definition) {
|
|
39
|
-
return definition.$type === eventDefinitionType
|
|
42
|
+
return definition.$type === eventDefinitionType;
|
|
40
43
|
});
|
|
41
44
|
}
|
|
42
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Check if element is a throw event.
|
|
48
|
+
*
|
|
49
|
+
* @param {ModdleElement} event
|
|
50
|
+
*
|
|
51
|
+
* @return {boolean}
|
|
52
|
+
*/
|
|
43
53
|
export function isThrowEvent(event) {
|
|
44
54
|
return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent');
|
|
45
55
|
}
|
|
46
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Check if element is a throw event.
|
|
59
|
+
*
|
|
60
|
+
* @param {ModdleElement} element
|
|
61
|
+
*
|
|
62
|
+
* @return {boolean}
|
|
63
|
+
*/
|
|
47
64
|
export function isCollection(element) {
|
|
48
65
|
var dataObject = element.dataObjectRef;
|
|
49
66
|
|
|
50
67
|
return element.isCollection || (dataObject && dataObject.isCollection);
|
|
51
68
|
}
|
|
52
69
|
|
|
53
|
-
export function getSemantic(element) {
|
|
54
|
-
return element.businessObject;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
70
|
|
|
58
71
|
// color access //////////////////////
|
|
59
72
|
|
|
73
|
+
/**
|
|
74
|
+
* @param {DiagramElement} element
|
|
75
|
+
* @param {string} defaultColor
|
|
76
|
+
*
|
|
77
|
+
* @return {string}
|
|
78
|
+
*/
|
|
60
79
|
export function getFillColor(element, defaultColor) {
|
|
61
80
|
var di = getDi(element);
|
|
62
81
|
|
|
63
82
|
return di.get('color:background-color') || di.get('bioc:fill') || defaultColor || 'white';
|
|
64
83
|
}
|
|
65
84
|
|
|
85
|
+
/**
|
|
86
|
+
* @param {DiagramElement} element
|
|
87
|
+
* @param {string} defaultColor
|
|
88
|
+
*
|
|
89
|
+
* @return {string}
|
|
90
|
+
*/
|
|
66
91
|
export function getStrokeColor(element, defaultColor) {
|
|
67
92
|
var di = getDi(element);
|
|
68
93
|
|
|
69
94
|
return di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || black;
|
|
70
95
|
}
|
|
71
96
|
|
|
97
|
+
/**
|
|
98
|
+
* @param {DiagramElement} element
|
|
99
|
+
* @param {string} defaultColor
|
|
100
|
+
* @param {string} defaultStrokeColor
|
|
101
|
+
*
|
|
102
|
+
* @return {string}
|
|
103
|
+
*/
|
|
72
104
|
export function getLabelColor(element, defaultColor, defaultStrokeColor) {
|
|
73
105
|
var di = getDi(element),
|
|
74
106
|
label = di.get('label');
|
|
@@ -79,6 +111,11 @@ export function getLabelColor(element, defaultColor, defaultStrokeColor) {
|
|
|
79
111
|
|
|
80
112
|
// cropping path customizations //////////////////////
|
|
81
113
|
|
|
114
|
+
/**
|
|
115
|
+
* @param {ShapeLike} shape
|
|
116
|
+
*
|
|
117
|
+
* @return {string} path
|
|
118
|
+
*/
|
|
82
119
|
export function getCirclePath(shape) {
|
|
83
120
|
|
|
84
121
|
var cx = shape.x + shape.width / 2,
|
|
@@ -96,6 +133,11 @@ export function getCirclePath(shape) {
|
|
|
96
133
|
return componentsToPath(circlePath);
|
|
97
134
|
}
|
|
98
135
|
|
|
136
|
+
/**
|
|
137
|
+
* @param {ShapeLike} shape
|
|
138
|
+
*
|
|
139
|
+
* @return {string} path
|
|
140
|
+
*/
|
|
99
141
|
export function getRoundRectPath(shape, borderRadius) {
|
|
100
142
|
|
|
101
143
|
var x = shape.x,
|
|
@@ -119,6 +161,11 @@ export function getRoundRectPath(shape, borderRadius) {
|
|
|
119
161
|
return componentsToPath(roundRectPath);
|
|
120
162
|
}
|
|
121
163
|
|
|
164
|
+
/**
|
|
165
|
+
* @param {ShapeLike} shape
|
|
166
|
+
*
|
|
167
|
+
* @return {string} path
|
|
168
|
+
*/
|
|
122
169
|
export function getDiamondPath(shape) {
|
|
123
170
|
|
|
124
171
|
var width = shape.width,
|
|
@@ -139,6 +186,11 @@ export function getDiamondPath(shape) {
|
|
|
139
186
|
return componentsToPath(diamondPath);
|
|
140
187
|
}
|
|
141
188
|
|
|
189
|
+
/**
|
|
190
|
+
* @param {ShapeLike} shape
|
|
191
|
+
*
|
|
192
|
+
* @return {string} path
|
|
193
|
+
*/
|
|
142
194
|
export function getRectPath(shape) {
|
|
143
195
|
var x = shape.x,
|
|
144
196
|
y = shape.y,
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A renderer for BPMN elements
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export default class BpmnRenderer extends BaseRenderer {
|
|
6
|
+
static $inject: string[];
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @param config
|
|
10
|
+
* @param eventBus
|
|
11
|
+
* @param styles
|
|
12
|
+
* @param pathMap
|
|
13
|
+
* @param canvas
|
|
14
|
+
* @param textRenderer
|
|
15
|
+
* @param priority
|
|
16
|
+
*/
|
|
17
|
+
constructor(config: BpmnRendererConfig, eventBus: import('diagram-js/lib/core/EventBus').default, styles: import('diagram-js/lib/draw/Styles').default, pathMap: import('./PathMap').default, canvas: import('diagram-js/lib/core/Canvas').default, textRenderer: import('./TextRenderer').default, priority?: number);
|
|
18
|
+
|
|
19
|
+
handlers: {
|
|
20
|
+
'bpmn:Event': (parentGfx: any, element: any, attrs: any) => SVGCircleElement;
|
|
21
|
+
'bpmn:StartEvent': (parentGfx: any, element: any) => any;
|
|
22
|
+
'bpmn:MessageEventDefinition': (parentGfx: any, element: any, isThrowing: any) => SVGPathElement;
|
|
23
|
+
'bpmn:TimerEventDefinition': (parentGfx: any, element: any) => SVGCircleElement;
|
|
24
|
+
'bpmn:EscalationEventDefinition': (parentGfx: any, event: any, isThrowing: any) => SVGPathElement;
|
|
25
|
+
'bpmn:ConditionalEventDefinition': (parentGfx: any, event: any) => SVGPathElement;
|
|
26
|
+
'bpmn:LinkEventDefinition': (parentGfx: any, event: any, isThrowing: any) => SVGPathElement;
|
|
27
|
+
'bpmn:ErrorEventDefinition': (parentGfx: any, event: any, isThrowing: any) => SVGPathElement;
|
|
28
|
+
'bpmn:CancelEventDefinition': (parentGfx: any, event: any, isThrowing: any) => SVGPathElement;
|
|
29
|
+
'bpmn:CompensateEventDefinition': (parentGfx: any, event: any, isThrowing: any) => SVGPathElement;
|
|
30
|
+
'bpmn:SignalEventDefinition': (parentGfx: any, event: any, isThrowing: any) => SVGPathElement;
|
|
31
|
+
'bpmn:MultipleEventDefinition': (parentGfx: any, event: any, isThrowing: any) => SVGPathElement;
|
|
32
|
+
'bpmn:ParallelMultipleEventDefinition': (parentGfx: any, event: any) => SVGPathElement;
|
|
33
|
+
'bpmn:EndEvent': (parentGfx: any, element: any) => any;
|
|
34
|
+
'bpmn:TerminateEventDefinition': (parentGfx: any, element: any) => SVGCircleElement;
|
|
35
|
+
'bpmn:IntermediateEvent': (parentGfx: any, element: any) => any;
|
|
36
|
+
'bpmn:IntermediateCatchEvent': (parentGfx: any, element: any) => any;
|
|
37
|
+
'bpmn:IntermediateThrowEvent': (parentGfx: any, element: any) => any;
|
|
38
|
+
'bpmn:Activity': (parentGfx: any, element: any, attrs: any) => SVGRectElement;
|
|
39
|
+
'bpmn:Task': (parentGfx: any, element: any) => any;
|
|
40
|
+
'bpmn:ServiceTask': (parentGfx: any, element: any) => any;
|
|
41
|
+
'bpmn:UserTask': (parentGfx: any, element: any) => any;
|
|
42
|
+
'bpmn:ManualTask': (parentGfx: any, element: any) => any;
|
|
43
|
+
'bpmn:SendTask': (parentGfx: any, element: any) => any;
|
|
44
|
+
'bpmn:ReceiveTask': (parentGfx: any, element: any) => any;
|
|
45
|
+
'bpmn:ScriptTask': (parentGfx: any, element: any) => any;
|
|
46
|
+
'bpmn:BusinessRuleTask': (parentGfx: any, element: any) => any;
|
|
47
|
+
'bpmn:SubProcess': (parentGfx: any, element: any, attrs: any) => any;
|
|
48
|
+
'bpmn:AdHocSubProcess': (parentGfx: any, element: any) => any;
|
|
49
|
+
'bpmn:Transaction': (parentGfx: any, element: any) => any;
|
|
50
|
+
'bpmn:CallActivity': (parentGfx: any, element: any) => any;
|
|
51
|
+
'bpmn:Participant': (parentGfx: any, element: any) => any;
|
|
52
|
+
'bpmn:Lane': (parentGfx: any, element: any, attrs: any) => SVGRectElement;
|
|
53
|
+
'bpmn:InclusiveGateway': (parentGfx: any, element: any) => any;
|
|
54
|
+
'bpmn:ExclusiveGateway': (parentGfx: any, element: any) => any;
|
|
55
|
+
'bpmn:ComplexGateway': (parentGfx: any, element: any) => any;
|
|
56
|
+
'bpmn:ParallelGateway': (parentGfx: any, element: any) => any;
|
|
57
|
+
'bpmn:EventBasedGateway': (parentGfx: any, element: any) => any;
|
|
58
|
+
'bpmn:Gateway': (parentGfx: any, element: any) => SVGPolygonElement;
|
|
59
|
+
'bpmn:SequenceFlow': (parentGfx: any, element: any) => SVGElement;
|
|
60
|
+
'bpmn:Association': (parentGfx: any, element: any, attrs: any) => SVGElement;
|
|
61
|
+
'bpmn:DataInputAssociation': (parentGfx: any, element: any) => any;
|
|
62
|
+
'bpmn:DataOutputAssociation': (parentGfx: any, element: any) => any;
|
|
63
|
+
'bpmn:MessageFlow': (parentGfx: any, element: any) => SVGElement;
|
|
64
|
+
'bpmn:DataObject': (parentGfx: any, element: any) => SVGPathElement;
|
|
65
|
+
'bpmn:DataObjectReference': (parentGfx: any, element: any) => any;
|
|
66
|
+
'bpmn:DataInput': (parentGfx: any, element: any) => any;
|
|
67
|
+
'bpmn:DataOutput': (parentGfx: any, element: any) => any;
|
|
68
|
+
'bpmn:DataStoreReference': (parentGfx: any, element: any) => SVGPathElement;
|
|
69
|
+
'bpmn:BoundaryEvent': (parentGfx: any, element: any) => any;
|
|
70
|
+
'bpmn:Group': (parentGfx: any, element: any) => SVGRectElement;
|
|
71
|
+
label: (parentGfx: any, element: any) => SVGElement;
|
|
72
|
+
'bpmn:TextAnnotation': (parentGfx: any, element: any) => SVGRectElement;
|
|
73
|
+
ParticipantMultiplicityMarker: (parentGfx: any, element: any) => void;
|
|
74
|
+
SubProcessMarker: (parentGfx: any, element: any) => void;
|
|
75
|
+
ParallelMarker: (parentGfx: any, element: any, position: any) => void;
|
|
76
|
+
SequentialMarker: (parentGfx: any, element: any, position: any) => void;
|
|
77
|
+
CompensationMarker: (parentGfx: any, element: any, position: any) => void;
|
|
78
|
+
LoopMarker: (parentGfx: any, element: any, position: any) => void;
|
|
79
|
+
AdhocMarker: (parentGfx: any, element: any, position: any) => void;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @param element
|
|
84
|
+
*
|
|
85
|
+
* @return
|
|
86
|
+
*/
|
|
87
|
+
canRender(element: any): boolean;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Draw shape into parentGfx.
|
|
91
|
+
*
|
|
92
|
+
* @param parentGfx
|
|
93
|
+
* @param element
|
|
94
|
+
*
|
|
95
|
+
* @return mainGfx
|
|
96
|
+
*/
|
|
97
|
+
drawShape(parentGfx: SVGElement, element: any): SVGElement;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Draw connection into parentGfx.
|
|
101
|
+
*
|
|
102
|
+
* @param parentGfx
|
|
103
|
+
* @param element
|
|
104
|
+
*
|
|
105
|
+
* @return mainGfx
|
|
106
|
+
*/
|
|
107
|
+
drawConnection(parentGfx: SVGElement, element: any): SVGElement;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Get shape path.
|
|
111
|
+
*
|
|
112
|
+
* @param element
|
|
113
|
+
*
|
|
114
|
+
* @return path
|
|
115
|
+
*/
|
|
116
|
+
getShapePath(element: any): string;
|
|
117
|
+
}
|
|
118
|
+
export type BpmnRendererConfig = Partial<{
|
|
119
|
+
defaultFillColor: string;
|
|
120
|
+
defaultStrokeColor: string;
|
|
121
|
+
defaultLabelColor: string;
|
|
122
|
+
}>;
|
|
123
|
+
export type DiagramElement = any;
|
|
124
|
+
import BaseRenderer from 'diagram-js/lib/draw/BaseRenderer';
|
package/lib/draw/BpmnRenderer.js
CHANGED
|
@@ -69,6 +69,29 @@ var DEFAULT_FILL_OPACITY = .95,
|
|
|
69
69
|
|
|
70
70
|
var ELEMENT_LABEL_DISTANCE = 10;
|
|
71
71
|
|
|
72
|
+
/**
|
|
73
|
+
* @typedef { Partial<{
|
|
74
|
+
* defaultFillColor: string,
|
|
75
|
+
* defaultStrokeColor: string,
|
|
76
|
+
* defaultLabelColor: string
|
|
77
|
+
* }> } BpmnRendererConfig
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @typedef { import('../model').DiagramElement } DiagramElement
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* A renderer for BPMN elements
|
|
86
|
+
*
|
|
87
|
+
* @param {BpmnRendererConfig} config
|
|
88
|
+
* @param {import('diagram-js/lib/core/EventBus').default} eventBus
|
|
89
|
+
* @param {import('diagram-js/lib/draw/Styles').default} styles
|
|
90
|
+
* @param {import('./PathMap').default} pathMap
|
|
91
|
+
* @param {import('diagram-js/lib/core/Canvas').default} canvas
|
|
92
|
+
* @param {import('./TextRenderer').default} textRenderer
|
|
93
|
+
* @param {number} [priority]
|
|
94
|
+
*/
|
|
72
95
|
export default function BpmnRenderer(
|
|
73
96
|
config, eventBus, styles, pathMap,
|
|
74
97
|
canvas, textRenderer, priority) {
|
|
@@ -1895,10 +1918,23 @@ BpmnRenderer.$inject = [
|
|
|
1895
1918
|
];
|
|
1896
1919
|
|
|
1897
1920
|
|
|
1921
|
+
/**
|
|
1922
|
+
* @param {DiagramElement} element
|
|
1923
|
+
*
|
|
1924
|
+
* @return {boolean}
|
|
1925
|
+
*/
|
|
1898
1926
|
BpmnRenderer.prototype.canRender = function(element) {
|
|
1899
1927
|
return is(element, 'bpmn:BaseElement');
|
|
1900
1928
|
};
|
|
1901
1929
|
|
|
1930
|
+
/**
|
|
1931
|
+
* Draw shape into parentGfx.
|
|
1932
|
+
*
|
|
1933
|
+
* @param {SVGElement} parentGfx
|
|
1934
|
+
* @param {DiagramElement} element
|
|
1935
|
+
*
|
|
1936
|
+
* @return {SVGElement} mainGfx
|
|
1937
|
+
*/
|
|
1902
1938
|
BpmnRenderer.prototype.drawShape = function(parentGfx, element) {
|
|
1903
1939
|
var type = element.type;
|
|
1904
1940
|
var h = this._renderer(type);
|
|
@@ -1907,6 +1943,14 @@ BpmnRenderer.prototype.drawShape = function(parentGfx, element) {
|
|
|
1907
1943
|
return h(parentGfx, element);
|
|
1908
1944
|
};
|
|
1909
1945
|
|
|
1946
|
+
/**
|
|
1947
|
+
* Draw connection into parentGfx.
|
|
1948
|
+
*
|
|
1949
|
+
* @param {SVGElement} parentGfx
|
|
1950
|
+
* @param {DiagramElement} element
|
|
1951
|
+
*
|
|
1952
|
+
* @return {SVGElement} mainGfx
|
|
1953
|
+
*/
|
|
1910
1954
|
BpmnRenderer.prototype.drawConnection = function(parentGfx, element) {
|
|
1911
1955
|
var type = element.type;
|
|
1912
1956
|
var h = this._renderer(type);
|
|
@@ -1915,6 +1959,13 @@ BpmnRenderer.prototype.drawConnection = function(parentGfx, element) {
|
|
|
1915
1959
|
return h(parentGfx, element);
|
|
1916
1960
|
};
|
|
1917
1961
|
|
|
1962
|
+
/**
|
|
1963
|
+
* Get shape path.
|
|
1964
|
+
*
|
|
1965
|
+
* @param {DiagramElement} element
|
|
1966
|
+
*
|
|
1967
|
+
* @return {string} path
|
|
1968
|
+
*/
|
|
1918
1969
|
BpmnRenderer.prototype.getShapePath = function(element) {
|
|
1919
1970
|
|
|
1920
1971
|
if (is(element, 'bpmn:Event')) {
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map containing SVG paths needed by BpmnRenderer
|
|
3
|
+
*/
|
|
4
|
+
export default class PathMap {
|
|
5
|
+
/**
|
|
6
|
+
* Contains a map of path elements
|
|
7
|
+
*
|
|
8
|
+
* <h1>Path definition</h1>
|
|
9
|
+
* A parameterized path is defined like this:
|
|
10
|
+
* <pre>
|
|
11
|
+
* 'GATEWAY_PARALLEL': {
|
|
12
|
+
* d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
|
|
13
|
+
'-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
|
|
14
|
+
* height: 17.5,
|
|
15
|
+
* width: 17.5,
|
|
16
|
+
* heightElements: [2.5, 7.5],
|
|
17
|
+
* widthElements: [2.5, 7.5]
|
|
18
|
+
* }
|
|
19
|
+
* </pre>
|
|
20
|
+
* <p>It's important to specify a correct <b>height and width</b> for the path as the scaling
|
|
21
|
+
* is based on the ratio between the specified height and width in this object and the
|
|
22
|
+
* height and width that is set as scale target (Note x,y coordinates will be scaled with
|
|
23
|
+
* individual ratios).</p>
|
|
24
|
+
* <p>The '<b>heightElements</b>' and '<b>widthElements</b>' array must contain the values that will be scaled.
|
|
25
|
+
* The scaling is based on the computed ratios.
|
|
26
|
+
* Coordinates on the y axis should be in the <b>heightElement</b>'s array, they will be scaled using
|
|
27
|
+
* the computed ratio coefficient.
|
|
28
|
+
* In the parameterized path the scaled values can be accessed through the 'e' object in {} brackets.
|
|
29
|
+
* <ul>
|
|
30
|
+
* <li>The values for the y axis can be accessed in the path string using {e.y0}, {e.y1}, ....</li>
|
|
31
|
+
* <li>The values for the x axis can be accessed in the path string using {e.x0}, {e.x1}, ....</li>
|
|
32
|
+
* </ul>
|
|
33
|
+
* The numbers x0, x1 respectively y0, y1, ... map to the corresponding array index.
|
|
34
|
+
* </p>
|
|
35
|
+
*/
|
|
36
|
+
pathMap: {
|
|
37
|
+
EVENT_MESSAGE: {
|
|
38
|
+
d: string;
|
|
39
|
+
height: number;
|
|
40
|
+
width: number;
|
|
41
|
+
heightElements: number[];
|
|
42
|
+
widthElements: number[];
|
|
43
|
+
};
|
|
44
|
+
EVENT_SIGNAL: {
|
|
45
|
+
d: string;
|
|
46
|
+
height: number;
|
|
47
|
+
width: number;
|
|
48
|
+
heightElements: number[];
|
|
49
|
+
widthElements: number[];
|
|
50
|
+
};
|
|
51
|
+
EVENT_ESCALATION: {
|
|
52
|
+
d: string;
|
|
53
|
+
height: number;
|
|
54
|
+
width: number;
|
|
55
|
+
heightElements: number[];
|
|
56
|
+
widthElements: number[];
|
|
57
|
+
};
|
|
58
|
+
EVENT_CONDITIONAL: {
|
|
59
|
+
d: string;
|
|
60
|
+
height: number;
|
|
61
|
+
width: number;
|
|
62
|
+
heightElements: number[];
|
|
63
|
+
widthElements: number[];
|
|
64
|
+
};
|
|
65
|
+
EVENT_LINK: {
|
|
66
|
+
d: string;
|
|
67
|
+
height: number;
|
|
68
|
+
width: number;
|
|
69
|
+
heightElements: number[];
|
|
70
|
+
widthElements: number[];
|
|
71
|
+
};
|
|
72
|
+
EVENT_ERROR: {
|
|
73
|
+
d: string;
|
|
74
|
+
height: number;
|
|
75
|
+
width: number;
|
|
76
|
+
heightElements: number[];
|
|
77
|
+
widthElements: number[];
|
|
78
|
+
};
|
|
79
|
+
EVENT_CANCEL_45: {
|
|
80
|
+
d: string;
|
|
81
|
+
height: number;
|
|
82
|
+
width: number;
|
|
83
|
+
heightElements: number[];
|
|
84
|
+
widthElements: number[];
|
|
85
|
+
};
|
|
86
|
+
EVENT_COMPENSATION: {
|
|
87
|
+
d: string;
|
|
88
|
+
height: number;
|
|
89
|
+
width: number;
|
|
90
|
+
heightElements: number[];
|
|
91
|
+
widthElements: number[];
|
|
92
|
+
};
|
|
93
|
+
EVENT_TIMER_WH: {
|
|
94
|
+
d: string;
|
|
95
|
+
height: number;
|
|
96
|
+
width: number;
|
|
97
|
+
heightElements: number[];
|
|
98
|
+
widthElements: number[];
|
|
99
|
+
};
|
|
100
|
+
EVENT_TIMER_LINE: {
|
|
101
|
+
d: string;
|
|
102
|
+
height: number;
|
|
103
|
+
width: number;
|
|
104
|
+
heightElements: number[];
|
|
105
|
+
widthElements: number[];
|
|
106
|
+
};
|
|
107
|
+
EVENT_MULTIPLE: {
|
|
108
|
+
d: string;
|
|
109
|
+
height: number;
|
|
110
|
+
width: number;
|
|
111
|
+
heightElements: number[];
|
|
112
|
+
widthElements: number[];
|
|
113
|
+
};
|
|
114
|
+
EVENT_PARALLEL_MULTIPLE: {
|
|
115
|
+
d: string;
|
|
116
|
+
height: number;
|
|
117
|
+
width: number;
|
|
118
|
+
heightElements: number[];
|
|
119
|
+
widthElements: number[];
|
|
120
|
+
};
|
|
121
|
+
GATEWAY_EXCLUSIVE: {
|
|
122
|
+
d: string;
|
|
123
|
+
height: number;
|
|
124
|
+
width: number;
|
|
125
|
+
heightElements: number[];
|
|
126
|
+
widthElements: number[];
|
|
127
|
+
};
|
|
128
|
+
GATEWAY_PARALLEL: {
|
|
129
|
+
d: string;
|
|
130
|
+
height: number;
|
|
131
|
+
width: number;
|
|
132
|
+
heightElements: number[];
|
|
133
|
+
widthElements: number[];
|
|
134
|
+
};
|
|
135
|
+
GATEWAY_EVENT_BASED: {
|
|
136
|
+
d: string;
|
|
137
|
+
height: number;
|
|
138
|
+
width: number;
|
|
139
|
+
heightElements: number[];
|
|
140
|
+
widthElements: number[];
|
|
141
|
+
};
|
|
142
|
+
GATEWAY_COMPLEX: {
|
|
143
|
+
d: string;
|
|
144
|
+
height: number;
|
|
145
|
+
width: number;
|
|
146
|
+
heightElements: number[];
|
|
147
|
+
widthElements: number[];
|
|
148
|
+
};
|
|
149
|
+
DATA_OBJECT_PATH: {
|
|
150
|
+
d: string;
|
|
151
|
+
height: number;
|
|
152
|
+
width: number;
|
|
153
|
+
heightElements: number[];
|
|
154
|
+
widthElements: number[];
|
|
155
|
+
};
|
|
156
|
+
DATA_OBJECT_COLLECTION_PATH: {
|
|
157
|
+
d: string;
|
|
158
|
+
height: number;
|
|
159
|
+
width: number;
|
|
160
|
+
heightElements: any[];
|
|
161
|
+
widthElements: any[];
|
|
162
|
+
};
|
|
163
|
+
DATA_ARROW: {
|
|
164
|
+
d: string;
|
|
165
|
+
height: number;
|
|
166
|
+
width: number;
|
|
167
|
+
heightElements: any[];
|
|
168
|
+
widthElements: any[];
|
|
169
|
+
};
|
|
170
|
+
DATA_STORE: {
|
|
171
|
+
d: string;
|
|
172
|
+
height: number;
|
|
173
|
+
width: number;
|
|
174
|
+
heightElements: number[];
|
|
175
|
+
widthElements: number[];
|
|
176
|
+
};
|
|
177
|
+
TEXT_ANNOTATION: {
|
|
178
|
+
d: string;
|
|
179
|
+
height: number;
|
|
180
|
+
width: number;
|
|
181
|
+
heightElements: number[];
|
|
182
|
+
widthElements: number[];
|
|
183
|
+
};
|
|
184
|
+
MARKER_SUB_PROCESS: {
|
|
185
|
+
d: string;
|
|
186
|
+
height: number;
|
|
187
|
+
width: number;
|
|
188
|
+
heightElements: any[];
|
|
189
|
+
widthElements: any[];
|
|
190
|
+
};
|
|
191
|
+
MARKER_PARALLEL: {
|
|
192
|
+
d: string;
|
|
193
|
+
height: number;
|
|
194
|
+
width: number;
|
|
195
|
+
heightElements: any[];
|
|
196
|
+
widthElements: any[];
|
|
197
|
+
};
|
|
198
|
+
MARKER_SEQUENTIAL: {
|
|
199
|
+
d: string;
|
|
200
|
+
height: number;
|
|
201
|
+
width: number;
|
|
202
|
+
heightElements: any[];
|
|
203
|
+
widthElements: any[];
|
|
204
|
+
};
|
|
205
|
+
MARKER_COMPENSATION: {
|
|
206
|
+
d: string;
|
|
207
|
+
height: number;
|
|
208
|
+
width: number;
|
|
209
|
+
heightElements: any[];
|
|
210
|
+
widthElements: any[];
|
|
211
|
+
};
|
|
212
|
+
MARKER_LOOP: {
|
|
213
|
+
d: string;
|
|
214
|
+
height: number;
|
|
215
|
+
width: number;
|
|
216
|
+
heightElements: any[];
|
|
217
|
+
widthElements: any[];
|
|
218
|
+
};
|
|
219
|
+
MARKER_ADHOC: {
|
|
220
|
+
d: string;
|
|
221
|
+
height: number;
|
|
222
|
+
width: number;
|
|
223
|
+
heightElements: any[];
|
|
224
|
+
widthElements: any[];
|
|
225
|
+
};
|
|
226
|
+
TASK_TYPE_SEND: {
|
|
227
|
+
d: string;
|
|
228
|
+
height: number;
|
|
229
|
+
width: number;
|
|
230
|
+
heightElements: number[];
|
|
231
|
+
widthElements: number[];
|
|
232
|
+
};
|
|
233
|
+
TASK_TYPE_SCRIPT: {
|
|
234
|
+
d: string;
|
|
235
|
+
height: number;
|
|
236
|
+
width: number;
|
|
237
|
+
heightElements: number[];
|
|
238
|
+
widthElements: number[];
|
|
239
|
+
};
|
|
240
|
+
TASK_TYPE_USER_1: {
|
|
241
|
+
d: string;
|
|
242
|
+
};
|
|
243
|
+
TASK_TYPE_USER_2: {
|
|
244
|
+
d: string;
|
|
245
|
+
};
|
|
246
|
+
TASK_TYPE_USER_3: {
|
|
247
|
+
d: string;
|
|
248
|
+
};
|
|
249
|
+
TASK_TYPE_MANUAL: {
|
|
250
|
+
d: string;
|
|
251
|
+
};
|
|
252
|
+
TASK_TYPE_INSTANTIATING_SEND: {
|
|
253
|
+
d: string;
|
|
254
|
+
};
|
|
255
|
+
TASK_TYPE_SERVICE: {
|
|
256
|
+
d: string;
|
|
257
|
+
};
|
|
258
|
+
TASK_TYPE_SERVICE_FILL: {
|
|
259
|
+
d: string;
|
|
260
|
+
};
|
|
261
|
+
TASK_TYPE_BUSINESS_RULE_HEADER: {
|
|
262
|
+
d: string;
|
|
263
|
+
};
|
|
264
|
+
TASK_TYPE_BUSINESS_RULE_MAIN: {
|
|
265
|
+
d: string;
|
|
266
|
+
};
|
|
267
|
+
MESSAGE_FLOW_MARKER: {
|
|
268
|
+
d: string;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* Return raw path for the given ID.
|
|
273
|
+
*
|
|
274
|
+
* @param pathId
|
|
275
|
+
*
|
|
276
|
+
* @return raw path
|
|
277
|
+
*/
|
|
278
|
+
getRawPath: (pathId: string) => string;
|
|
279
|
+
/**
|
|
280
|
+
* Scales the path to the given height and width.
|
|
281
|
+
* <h1>Use case</h1>
|
|
282
|
+
* <p>Use case is to scale the content of elements (event, gateways) based
|
|
283
|
+
* on the element bounding box's size.
|
|
284
|
+
* </p>
|
|
285
|
+
* <h1>Why not transform</h1>
|
|
286
|
+
* <p>Scaling a path with transform() will also scale the stroke and IE does not support
|
|
287
|
+
* the option 'non-scaling-stroke' to prevent this.
|
|
288
|
+
* Also there are use cases where only some parts of a path should be
|
|
289
|
+
* scaled.</p>
|
|
290
|
+
*
|
|
291
|
+
* @param pathId The ID of the path.
|
|
292
|
+
* @param param <p>
|
|
293
|
+
* Example param object scales the path to 60% size of the container (data.width, data.height).
|
|
294
|
+
* <pre>
|
|
295
|
+
* {
|
|
296
|
+
* xScaleFactor: 0.6,
|
|
297
|
+
* yScaleFactor:0.6,
|
|
298
|
+
* containerWidth: data.width,
|
|
299
|
+
* containerHeight: data.height,
|
|
300
|
+
* position: {
|
|
301
|
+
* mx: 0.46,
|
|
302
|
+
* my: 0.2,
|
|
303
|
+
* }
|
|
304
|
+
* }
|
|
305
|
+
* </pre>
|
|
306
|
+
* <ul>
|
|
307
|
+
* <li>targetpathwidth = xScaleFactor * containerWidth</li>
|
|
308
|
+
* <li>targetpathheight = yScaleFactor * containerHeight</li>
|
|
309
|
+
* <li>Position is used to set the starting coordinate of the path. M is computed:
|
|
310
|
+
* <ul>
|
|
311
|
+
* <li>position.x * containerWidth</li>
|
|
312
|
+
* <li>position.y * containerHeight</li>
|
|
313
|
+
* </ul>
|
|
314
|
+
* Center of the container <pre> position: {
|
|
315
|
+
* mx: 0.5,
|
|
316
|
+
* my: 0.5,
|
|
317
|
+
* }</pre>
|
|
318
|
+
* Upper left corner of the container
|
|
319
|
+
* <pre> position: {
|
|
320
|
+
* mx: 0.0,
|
|
321
|
+
* my: 0.0,
|
|
322
|
+
* }</pre>
|
|
323
|
+
* </li>
|
|
324
|
+
* </ul>
|
|
325
|
+
* </p>
|
|
326
|
+
*
|
|
327
|
+
* @return scaled path
|
|
328
|
+
*/
|
|
329
|
+
getScaledPath: (pathId: string, param: any) => string;
|
|
330
|
+
}
|