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
|
@@ -15,14 +15,45 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
forEach,
|
|
17
17
|
filter,
|
|
18
|
+
isArray,
|
|
18
19
|
isUndefined
|
|
19
20
|
} from 'min-dash';
|
|
20
21
|
|
|
21
22
|
import * as replaceOptions from '../replace/ReplaceOptions';
|
|
22
23
|
|
|
24
|
+
/**
|
|
25
|
+
* @typedef {import('../features/BpmnFactory').default} BpmnFactory
|
|
26
|
+
* @typedef {import('diagram-js/lib/features/popup-menu/PopupMenu').default} PopupMenu
|
|
27
|
+
* @typedef {import('../features/Modeling').default} Modeling
|
|
28
|
+
* @typedef {import('../features/BpmnReplace').default} BpmnReplace
|
|
29
|
+
* @typedef {import('diagram-js/lib/features/Rules').default} Rules
|
|
30
|
+
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
|
|
31
|
+
*
|
|
32
|
+
* @typedef {import('../../model/Types').Element} Element
|
|
33
|
+
* @typedef {import('../../model/Types').Moddle} Moddle
|
|
34
|
+
*
|
|
35
|
+
* @typedef {import('diagram-js/lib/features/popup-menu/PopupMenuProvider').PopupMenuEntries} PopupMenuEntries
|
|
36
|
+
* @typedef {import('diagram-js/lib/features/popup-menu/PopupMenuProvider').PopupMenuEntry} PopupMenuEntry
|
|
37
|
+
* @typedef {import('diagram-js/lib/features/popup-menu/PopupMenuProvider').PopupMenuEntryAction} PopupMenuEntryAction
|
|
38
|
+
* @typedef {import('diagram-js/lib/features/popup-menu/PopupMenuProvider').PopupMenuHeaderEntries} PopupMenuHeaderEntries
|
|
39
|
+
* @typedef {import('diagram-js/lib/features/popup-menu/PopupMenuProvider').default} PopupMenuProvider
|
|
40
|
+
* @typedef {import('diagram-js/lib/features/popup-menu/PopupMenu').PopupMenuTarget} PopupMenuTarget
|
|
41
|
+
*
|
|
42
|
+
* @typedef {import('./ReplaceOptions').ReplaceOption} ReplaceOption
|
|
43
|
+
*/
|
|
23
44
|
|
|
24
45
|
/**
|
|
25
|
-
*
|
|
46
|
+
* A BPMN-specific popup menu provider.
|
|
47
|
+
*
|
|
48
|
+
* @implements {PopupMenuProvider}
|
|
49
|
+
*
|
|
50
|
+
* @param {BpmnFactory} bpmnFactory
|
|
51
|
+
* @param {PopupMenu} popupMenu
|
|
52
|
+
* @param {Modeling} modeling
|
|
53
|
+
* @param {Moddle} moddle
|
|
54
|
+
* @param {BpmnReplace} bpmnReplace
|
|
55
|
+
* @param {Rules} rules
|
|
56
|
+
* @param {Translate} translate
|
|
26
57
|
*/
|
|
27
58
|
export default function ReplaceMenuProvider(
|
|
28
59
|
bpmnFactory, popupMenu, modeling, moddle,
|
|
@@ -36,7 +67,7 @@ export default function ReplaceMenuProvider(
|
|
|
36
67
|
this._rules = rules;
|
|
37
68
|
this._translate = translate;
|
|
38
69
|
|
|
39
|
-
this.
|
|
70
|
+
this._register();
|
|
40
71
|
}
|
|
41
72
|
|
|
42
73
|
ReplaceMenuProvider.$inject = [
|
|
@@ -49,112 +80,104 @@ ReplaceMenuProvider.$inject = [
|
|
|
49
80
|
'translate'
|
|
50
81
|
];
|
|
51
82
|
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Register replace menu provider in the popup menu
|
|
55
|
-
*/
|
|
56
|
-
ReplaceMenuProvider.prototype.register = function() {
|
|
83
|
+
ReplaceMenuProvider.prototype._register = function() {
|
|
57
84
|
this._popupMenu.registerProvider('bpmn-replace', this);
|
|
58
85
|
};
|
|
59
86
|
|
|
60
|
-
|
|
61
87
|
/**
|
|
62
|
-
*
|
|
63
|
-
* on them. Get for example only elements, which are different from the current one.
|
|
64
|
-
*
|
|
65
|
-
* @param {djs.model.Base} element
|
|
88
|
+
* @param {PopupMenuTarget} target
|
|
66
89
|
*
|
|
67
|
-
* @return {
|
|
90
|
+
* @return {PopupMenuEntries}
|
|
68
91
|
*/
|
|
69
|
-
ReplaceMenuProvider.prototype.
|
|
92
|
+
ReplaceMenuProvider.prototype.getPopupMenuEntries = function(target) {
|
|
70
93
|
|
|
71
|
-
var businessObject =
|
|
94
|
+
var businessObject = target.businessObject;
|
|
72
95
|
|
|
73
96
|
var rules = this._rules;
|
|
74
97
|
|
|
75
|
-
var
|
|
98
|
+
var filteredReplaceOptions = [];
|
|
76
99
|
|
|
77
|
-
if (!rules.allowed('shape.replace', { element:
|
|
78
|
-
return
|
|
100
|
+
if (isArray(target) || !rules.allowed('shape.replace', { element: target })) {
|
|
101
|
+
return {};
|
|
79
102
|
}
|
|
80
103
|
|
|
81
|
-
var differentType = isDifferentType(
|
|
104
|
+
var differentType = isDifferentType(target);
|
|
82
105
|
|
|
83
106
|
if (is(businessObject, 'bpmn:DataObjectReference')) {
|
|
84
|
-
return this._createEntries(
|
|
107
|
+
return this._createEntries(target, replaceOptions.DATA_OBJECT_REFERENCE);
|
|
85
108
|
}
|
|
86
109
|
|
|
87
|
-
if (is(businessObject, 'bpmn:DataStoreReference') && !is(
|
|
88
|
-
return this._createEntries(
|
|
110
|
+
if (is(businessObject, 'bpmn:DataStoreReference') && !is(target.parent, 'bpmn:Collaboration')) {
|
|
111
|
+
return this._createEntries(target, replaceOptions.DATA_STORE_REFERENCE);
|
|
89
112
|
}
|
|
90
113
|
|
|
91
114
|
// start events outside sub processes
|
|
92
115
|
if (is(businessObject, 'bpmn:StartEvent') && !is(businessObject.$parent, 'bpmn:SubProcess')) {
|
|
93
116
|
|
|
94
|
-
|
|
117
|
+
filteredReplaceOptions = filter(replaceOptions.START_EVENT, differentType);
|
|
95
118
|
|
|
96
|
-
return this._createEntries(
|
|
119
|
+
return this._createEntries(target, filteredReplaceOptions);
|
|
97
120
|
}
|
|
98
121
|
|
|
99
122
|
// expanded/collapsed pools
|
|
100
123
|
if (is(businessObject, 'bpmn:Participant')) {
|
|
101
124
|
|
|
102
|
-
|
|
103
|
-
return isExpanded(
|
|
125
|
+
filteredReplaceOptions = filter(replaceOptions.PARTICIPANT, function(replaceOption) {
|
|
126
|
+
return isExpanded(target) !== replaceOption.target.isExpanded;
|
|
104
127
|
});
|
|
105
128
|
|
|
106
|
-
return this._createEntries(
|
|
129
|
+
return this._createEntries(target, filteredReplaceOptions);
|
|
107
130
|
}
|
|
108
131
|
|
|
109
132
|
// start events inside event sub processes
|
|
110
133
|
if (is(businessObject, 'bpmn:StartEvent') && isEventSubProcess(businessObject.$parent)) {
|
|
111
|
-
|
|
134
|
+
filteredReplaceOptions = filter(replaceOptions.EVENT_SUB_PROCESS_START_EVENT, function(replaceOption) {
|
|
112
135
|
|
|
113
|
-
var target =
|
|
136
|
+
var target = replaceOption.target;
|
|
114
137
|
|
|
115
138
|
var isInterrupting = target.isInterrupting !== false;
|
|
116
139
|
|
|
117
|
-
var isInterruptingEqual = getBusinessObject(
|
|
140
|
+
var isInterruptingEqual = getBusinessObject(target).isInterrupting === isInterrupting;
|
|
118
141
|
|
|
119
142
|
// filters elements which types and event definition are equal but have have different interrupting types
|
|
120
|
-
return differentType(
|
|
143
|
+
return differentType(replaceOption) || !differentType(replaceOption) && !isInterruptingEqual;
|
|
121
144
|
|
|
122
145
|
});
|
|
123
146
|
|
|
124
|
-
return this._createEntries(
|
|
147
|
+
return this._createEntries(target, filteredReplaceOptions);
|
|
125
148
|
}
|
|
126
149
|
|
|
127
150
|
// start events inside sub processes
|
|
128
151
|
if (is(businessObject, 'bpmn:StartEvent') && !isEventSubProcess(businessObject.$parent)
|
|
129
152
|
&& is(businessObject.$parent, 'bpmn:SubProcess')) {
|
|
130
|
-
|
|
153
|
+
filteredReplaceOptions = filter(replaceOptions.START_EVENT_SUB_PROCESS, differentType);
|
|
131
154
|
|
|
132
|
-
return this._createEntries(
|
|
155
|
+
return this._createEntries(target, filteredReplaceOptions);
|
|
133
156
|
}
|
|
134
157
|
|
|
135
158
|
// end events
|
|
136
159
|
if (is(businessObject, 'bpmn:EndEvent')) {
|
|
137
160
|
|
|
138
|
-
|
|
139
|
-
var target =
|
|
161
|
+
filteredReplaceOptions = filter(replaceOptions.END_EVENT, function(replaceOption) {
|
|
162
|
+
var target = replaceOption.target;
|
|
140
163
|
|
|
141
164
|
// hide cancel end events outside transactions
|
|
142
165
|
if (target.eventDefinitionType == 'bpmn:CancelEventDefinition' && !is(businessObject.$parent, 'bpmn:Transaction')) {
|
|
143
166
|
return false;
|
|
144
167
|
}
|
|
145
168
|
|
|
146
|
-
return differentType(
|
|
169
|
+
return differentType(replaceOption);
|
|
147
170
|
});
|
|
148
171
|
|
|
149
|
-
return this._createEntries(
|
|
172
|
+
return this._createEntries(target, filteredReplaceOptions);
|
|
150
173
|
}
|
|
151
174
|
|
|
152
175
|
// boundary events
|
|
153
176
|
if (is(businessObject, 'bpmn:BoundaryEvent')) {
|
|
154
177
|
|
|
155
|
-
|
|
178
|
+
filteredReplaceOptions = filter(replaceOptions.BOUNDARY_EVENT, function(replaceOption) {
|
|
156
179
|
|
|
157
|
-
var target =
|
|
180
|
+
var target = replaceOption.target;
|
|
158
181
|
|
|
159
182
|
if (target.eventDefinitionType == 'bpmn:CancelEventDefinition' &&
|
|
160
183
|
!is(businessObject.attachedToRef, 'bpmn:Transaction')) {
|
|
@@ -164,121 +187,129 @@ ReplaceMenuProvider.prototype.getEntries = function(element) {
|
|
|
164
187
|
|
|
165
188
|
var isCancelActivityEqual = businessObject.cancelActivity == cancelActivity;
|
|
166
189
|
|
|
167
|
-
return differentType(
|
|
190
|
+
return differentType(replaceOption) || !differentType(replaceOption) && !isCancelActivityEqual;
|
|
168
191
|
});
|
|
169
192
|
|
|
170
|
-
return this._createEntries(
|
|
193
|
+
return this._createEntries(target, filteredReplaceOptions);
|
|
171
194
|
}
|
|
172
195
|
|
|
173
196
|
// intermediate events
|
|
174
197
|
if (is(businessObject, 'bpmn:IntermediateCatchEvent') ||
|
|
175
198
|
is(businessObject, 'bpmn:IntermediateThrowEvent')) {
|
|
176
199
|
|
|
177
|
-
|
|
200
|
+
filteredReplaceOptions = filter(replaceOptions.INTERMEDIATE_EVENT, differentType);
|
|
178
201
|
|
|
179
|
-
return this._createEntries(
|
|
202
|
+
return this._createEntries(target, filteredReplaceOptions);
|
|
180
203
|
}
|
|
181
204
|
|
|
182
205
|
// gateways
|
|
183
206
|
if (is(businessObject, 'bpmn:Gateway')) {
|
|
184
207
|
|
|
185
|
-
|
|
208
|
+
filteredReplaceOptions = filter(replaceOptions.GATEWAY, differentType);
|
|
186
209
|
|
|
187
|
-
return this._createEntries(
|
|
210
|
+
return this._createEntries(target, filteredReplaceOptions);
|
|
188
211
|
}
|
|
189
212
|
|
|
190
213
|
// transactions
|
|
191
214
|
if (is(businessObject, 'bpmn:Transaction')) {
|
|
192
215
|
|
|
193
|
-
|
|
216
|
+
filteredReplaceOptions = filter(replaceOptions.TRANSACTION, differentType);
|
|
194
217
|
|
|
195
|
-
return this._createEntries(
|
|
218
|
+
return this._createEntries(target, filteredReplaceOptions);
|
|
196
219
|
}
|
|
197
220
|
|
|
198
221
|
// expanded event sub processes
|
|
199
|
-
if (isEventSubProcess(businessObject) && isExpanded(
|
|
222
|
+
if (isEventSubProcess(businessObject) && isExpanded(target)) {
|
|
200
223
|
|
|
201
|
-
|
|
224
|
+
filteredReplaceOptions = filter(replaceOptions.EVENT_SUB_PROCESS, differentType);
|
|
202
225
|
|
|
203
|
-
return this._createEntries(
|
|
226
|
+
return this._createEntries(target, filteredReplaceOptions);
|
|
204
227
|
}
|
|
205
228
|
|
|
206
229
|
// expanded sub processes
|
|
207
|
-
if (is(businessObject, 'bpmn:SubProcess') && isExpanded(
|
|
230
|
+
if (is(businessObject, 'bpmn:SubProcess') && isExpanded(target)) {
|
|
208
231
|
|
|
209
|
-
|
|
232
|
+
filteredReplaceOptions = filter(replaceOptions.SUBPROCESS_EXPANDED, differentType);
|
|
210
233
|
|
|
211
|
-
return this._createEntries(
|
|
234
|
+
return this._createEntries(target, filteredReplaceOptions);
|
|
212
235
|
}
|
|
213
236
|
|
|
214
237
|
// collapsed ad hoc sub processes
|
|
215
|
-
if (is(businessObject, 'bpmn:AdHocSubProcess') && !isExpanded(
|
|
238
|
+
if (is(businessObject, 'bpmn:AdHocSubProcess') && !isExpanded(target)) {
|
|
216
239
|
|
|
217
|
-
|
|
240
|
+
filteredReplaceOptions = filter(replaceOptions.TASK, function(replaceOption) {
|
|
218
241
|
|
|
219
|
-
var target =
|
|
242
|
+
var target = replaceOption.target;
|
|
220
243
|
|
|
221
244
|
var isTargetSubProcess = target.type === 'bpmn:SubProcess';
|
|
222
245
|
|
|
223
246
|
var isTargetExpanded = target.isExpanded === true;
|
|
224
247
|
|
|
225
|
-
return isDifferentType(
|
|
248
|
+
return isDifferentType(target, target) && (!isTargetSubProcess || isTargetExpanded);
|
|
226
249
|
});
|
|
227
250
|
|
|
228
|
-
return this._createEntries(
|
|
251
|
+
return this._createEntries(target, filteredReplaceOptions);
|
|
229
252
|
}
|
|
230
253
|
|
|
231
254
|
// sequence flows
|
|
232
255
|
if (is(businessObject, 'bpmn:SequenceFlow')) {
|
|
233
|
-
return this._createSequenceFlowEntries(
|
|
256
|
+
return this._createSequenceFlowEntries(target, replaceOptions.SEQUENCE_FLOW);
|
|
234
257
|
}
|
|
235
258
|
|
|
236
259
|
// flow nodes
|
|
237
260
|
if (is(businessObject, 'bpmn:FlowNode')) {
|
|
238
|
-
|
|
261
|
+
filteredReplaceOptions = filter(replaceOptions.TASK, differentType);
|
|
239
262
|
|
|
240
|
-
// collapsed
|
|
241
|
-
if (is(businessObject, 'bpmn:SubProcess') && !isExpanded(
|
|
242
|
-
|
|
243
|
-
return
|
|
263
|
+
// collapsed sub process cannot be replaced with itself
|
|
264
|
+
if (is(businessObject, 'bpmn:SubProcess') && !isExpanded(target)) {
|
|
265
|
+
filteredReplaceOptions = filter(filteredReplaceOptions, function(replaceOption) {
|
|
266
|
+
return replaceOption.label !== 'Sub Process (collapsed)';
|
|
244
267
|
});
|
|
245
268
|
}
|
|
246
269
|
|
|
247
|
-
return this._createEntries(
|
|
270
|
+
return this._createEntries(target, filteredReplaceOptions);
|
|
248
271
|
}
|
|
249
272
|
|
|
250
|
-
return
|
|
273
|
+
return {};
|
|
251
274
|
};
|
|
252
275
|
|
|
253
|
-
|
|
254
276
|
/**
|
|
255
|
-
*
|
|
256
|
-
* for multi instance markers and for the ad hoc marker.
|
|
277
|
+
* @param {PopupMenuTarget} target
|
|
257
278
|
*
|
|
258
|
-
* @
|
|
259
|
-
*
|
|
260
|
-
* @return {Array<Object>} a list of menu entry items
|
|
279
|
+
* @return {PopupMenuHeaderEntries}
|
|
261
280
|
*/
|
|
262
|
-
ReplaceMenuProvider.prototype.
|
|
281
|
+
ReplaceMenuProvider.prototype.getPopupMenuHeaderEntries = function(target) {
|
|
263
282
|
|
|
264
|
-
var headerEntries =
|
|
283
|
+
var headerEntries = {};
|
|
265
284
|
|
|
266
|
-
if (is(
|
|
267
|
-
headerEntries =
|
|
285
|
+
if (is(target, 'bpmn:Activity') && !isEventSubProcess(target)) {
|
|
286
|
+
headerEntries = {
|
|
287
|
+
...headerEntries,
|
|
288
|
+
...this._getLoopCharacteristicsHeaderEntries(target)
|
|
289
|
+
};
|
|
268
290
|
}
|
|
269
291
|
|
|
270
|
-
if (is(
|
|
271
|
-
headerEntries =
|
|
292
|
+
if (is(target, 'bpmn:DataObjectReference')) {
|
|
293
|
+
headerEntries = {
|
|
294
|
+
...headerEntries,
|
|
295
|
+
...this._getCollectionHeaderEntries(target)
|
|
296
|
+
};
|
|
272
297
|
}
|
|
273
298
|
|
|
274
|
-
if (is(
|
|
275
|
-
headerEntries =
|
|
299
|
+
if (is(target, 'bpmn:Participant')) {
|
|
300
|
+
headerEntries = {
|
|
301
|
+
...headerEntries,
|
|
302
|
+
...this._getParticipantMultiplicityHeaderEntries(target)
|
|
303
|
+
};
|
|
276
304
|
}
|
|
277
305
|
|
|
278
|
-
if (is(
|
|
279
|
-
!is(
|
|
280
|
-
!isEventSubProcess(
|
|
281
|
-
headerEntries
|
|
306
|
+
if (is(target, 'bpmn:SubProcess') &&
|
|
307
|
+
!is(target, 'bpmn:Transaction') &&
|
|
308
|
+
!isEventSubProcess(target)) {
|
|
309
|
+
headerEntries = {
|
|
310
|
+
...headerEntries,
|
|
311
|
+
...this._getAdHocHeaderEntries(target)
|
|
312
|
+
};
|
|
282
313
|
}
|
|
283
314
|
|
|
284
315
|
return headerEntries;
|
|
@@ -286,50 +317,47 @@ ReplaceMenuProvider.prototype.getHeaderEntries = function(element) {
|
|
|
286
317
|
|
|
287
318
|
|
|
288
319
|
/**
|
|
289
|
-
*
|
|
290
|
-
* according to a filter function.
|
|
320
|
+
* Create popup menu entries for the given target.
|
|
291
321
|
*
|
|
292
|
-
* @param {
|
|
293
|
-
* @param {
|
|
322
|
+
* @param {PopupMenuTarget} target
|
|
323
|
+
* @param {ReplaceOption[]} replaceOptions
|
|
294
324
|
*
|
|
295
|
-
* @return {
|
|
325
|
+
* @return {PopupMenuEntries}
|
|
296
326
|
*/
|
|
297
|
-
ReplaceMenuProvider.prototype._createEntries = function(
|
|
298
|
-
var
|
|
327
|
+
ReplaceMenuProvider.prototype._createEntries = function(target, replaceOptions) {
|
|
328
|
+
var entries = {};
|
|
299
329
|
|
|
300
330
|
var self = this;
|
|
301
331
|
|
|
302
|
-
forEach(replaceOptions, function(
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
menuEntries.push(entry);
|
|
332
|
+
forEach(replaceOptions, function(replaceOption) {
|
|
333
|
+
entries[ replaceOption.actionName ] = self._createEntry(replaceOption, target);
|
|
306
334
|
});
|
|
307
335
|
|
|
308
|
-
return
|
|
336
|
+
return entries;
|
|
309
337
|
};
|
|
310
338
|
|
|
311
339
|
/**
|
|
312
|
-
* Creates
|
|
340
|
+
* Creates popup menu entries for the given sequence flow.
|
|
313
341
|
*
|
|
314
|
-
* @param {
|
|
315
|
-
* @param {
|
|
316
|
-
|
|
317
|
-
* @return {
|
|
342
|
+
* @param {PopupMenuTarget} target
|
|
343
|
+
* @param {ReplaceOption[]} replaceOptions
|
|
344
|
+
*
|
|
345
|
+
* @return {PopupMenuEntries}
|
|
318
346
|
*/
|
|
319
|
-
ReplaceMenuProvider.prototype._createSequenceFlowEntries = function(
|
|
347
|
+
ReplaceMenuProvider.prototype._createSequenceFlowEntries = function(target, replaceOptions) {
|
|
320
348
|
|
|
321
|
-
var businessObject = getBusinessObject(
|
|
349
|
+
var businessObject = getBusinessObject(target);
|
|
322
350
|
|
|
323
|
-
var
|
|
351
|
+
var entries = {};
|
|
324
352
|
|
|
325
353
|
var modeling = this._modeling,
|
|
326
354
|
moddle = this._moddle;
|
|
327
355
|
|
|
328
356
|
var self = this;
|
|
329
357
|
|
|
330
|
-
forEach(replaceOptions, function(
|
|
358
|
+
forEach(replaceOptions, function(replaceOption) {
|
|
331
359
|
|
|
332
|
-
switch (
|
|
360
|
+
switch (replaceOption.actionName) {
|
|
333
361
|
case 'replace-with-default-flow':
|
|
334
362
|
if (businessObject.sourceRef.default !== businessObject &&
|
|
335
363
|
(is(businessObject.sourceRef, 'bpmn:ExclusiveGateway') ||
|
|
@@ -337,97 +365,103 @@ ReplaceMenuProvider.prototype._createSequenceFlowEntries = function(element, rep
|
|
|
337
365
|
is(businessObject.sourceRef, 'bpmn:ComplexGateway') ||
|
|
338
366
|
is(businessObject.sourceRef, 'bpmn:Activity'))) {
|
|
339
367
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
368
|
+
entries = {
|
|
369
|
+
...entries,
|
|
370
|
+
[ replaceOption.actionName ]: self._createEntry(replaceOption, target, function() {
|
|
371
|
+
modeling.updateProperties(target.source, { default: businessObject });
|
|
372
|
+
})
|
|
373
|
+
};
|
|
343
374
|
}
|
|
344
375
|
break;
|
|
345
376
|
case 'replace-with-conditional-flow':
|
|
346
377
|
if (!businessObject.conditionExpression && is(businessObject.sourceRef, 'bpmn:Activity')) {
|
|
347
378
|
|
|
348
|
-
|
|
349
|
-
|
|
379
|
+
entries = {
|
|
380
|
+
...entries,
|
|
381
|
+
[ replaceOption.actionName ]: self._createEntry(replaceOption, target, function() {
|
|
382
|
+
var conditionExpression = moddle.create('bpmn:FormalExpression', { body: '' });
|
|
350
383
|
|
|
351
|
-
|
|
352
|
-
|
|
384
|
+
modeling.updateProperties(target, { conditionExpression: conditionExpression });
|
|
385
|
+
})
|
|
386
|
+
};
|
|
353
387
|
}
|
|
354
388
|
break;
|
|
355
389
|
default:
|
|
356
390
|
|
|
357
|
-
//
|
|
391
|
+
// conditional flow -> sequence flow
|
|
358
392
|
if (is(businessObject.sourceRef, 'bpmn:Activity') && businessObject.conditionExpression) {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
393
|
+
entries = {
|
|
394
|
+
...entries,
|
|
395
|
+
[ replaceOption.actionName ]: self._createEntry(replaceOption, target, function() {
|
|
396
|
+
modeling.updateProperties(target, { conditionExpression: undefined });
|
|
397
|
+
})
|
|
398
|
+
};
|
|
362
399
|
}
|
|
363
400
|
|
|
364
|
-
//
|
|
401
|
+
// default flow -> sequence flow
|
|
365
402
|
if ((is(businessObject.sourceRef, 'bpmn:ExclusiveGateway') ||
|
|
366
403
|
is(businessObject.sourceRef, 'bpmn:InclusiveGateway') ||
|
|
367
404
|
is(businessObject.sourceRef, 'bpmn:ComplexGateway') ||
|
|
368
405
|
is(businessObject.sourceRef, 'bpmn:Activity')) &&
|
|
369
406
|
businessObject.sourceRef.default === businessObject) {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
407
|
+
entries = {
|
|
408
|
+
...entries,
|
|
409
|
+
[ replaceOption.actionName ]: self._createEntry(replaceOption, target, function() {
|
|
410
|
+
modeling.updateProperties(target.source, { default: undefined });
|
|
411
|
+
})
|
|
412
|
+
};
|
|
374
413
|
}
|
|
375
414
|
}
|
|
376
415
|
});
|
|
377
416
|
|
|
378
|
-
return
|
|
417
|
+
return entries;
|
|
379
418
|
};
|
|
380
419
|
|
|
381
|
-
|
|
382
420
|
/**
|
|
383
|
-
*
|
|
421
|
+
* Create a popup menu entry for the given replace option.
|
|
384
422
|
*
|
|
385
|
-
* @param {
|
|
386
|
-
* @param {
|
|
387
|
-
* @param {
|
|
388
|
-
* the menu entry is being triggered.
|
|
423
|
+
* @param {ReplaceOption} replaceOption
|
|
424
|
+
* @param {PopupMenuTarget} target
|
|
425
|
+
* @param {PopupMenuEntryAction} [action]
|
|
389
426
|
*
|
|
390
|
-
* @return {
|
|
427
|
+
* @return {PopupMenuEntry}
|
|
391
428
|
*/
|
|
392
|
-
ReplaceMenuProvider.prototype.
|
|
429
|
+
ReplaceMenuProvider.prototype._createEntry = function(replaceOption, target, action) {
|
|
393
430
|
var translate = this._translate;
|
|
394
431
|
var replaceElement = this._bpmnReplace.replaceElement;
|
|
395
432
|
|
|
396
433
|
var replaceAction = function() {
|
|
397
|
-
return replaceElement(
|
|
434
|
+
return replaceElement(target, replaceOption.target);
|
|
398
435
|
};
|
|
399
436
|
|
|
400
|
-
var label =
|
|
437
|
+
var label = replaceOption.label;
|
|
401
438
|
if (label && typeof label === 'function') {
|
|
402
|
-
label = label(
|
|
439
|
+
label = label(target);
|
|
403
440
|
}
|
|
404
441
|
|
|
405
442
|
action = action || replaceAction;
|
|
406
443
|
|
|
407
|
-
|
|
444
|
+
return {
|
|
408
445
|
label: translate(label),
|
|
409
|
-
className:
|
|
410
|
-
id: definition.actionName,
|
|
446
|
+
className: replaceOption.className,
|
|
411
447
|
action: action
|
|
412
448
|
};
|
|
413
|
-
|
|
414
|
-
return menuEntry;
|
|
415
449
|
};
|
|
416
450
|
|
|
417
451
|
/**
|
|
418
|
-
* Get
|
|
452
|
+
* Get popup menu header entries for the loop characteristics of the given BPMN element.
|
|
419
453
|
*
|
|
420
|
-
* @param {
|
|
454
|
+
* @param {PopupMenuTarget} target
|
|
421
455
|
*
|
|
422
|
-
* @return {
|
|
456
|
+
* @return {PopupMenuHeaderEntries}
|
|
423
457
|
*/
|
|
424
|
-
ReplaceMenuProvider.prototype.
|
|
458
|
+
ReplaceMenuProvider.prototype._getLoopCharacteristicsHeaderEntries = function(target) {
|
|
425
459
|
|
|
426
460
|
var self = this;
|
|
427
461
|
var translate = this._translate;
|
|
428
462
|
|
|
429
463
|
function toggleLoopEntry(event, entry) {
|
|
430
|
-
var newLoopCharacteristics = getBusinessObject(
|
|
464
|
+
var newLoopCharacteristics = getBusinessObject(target).loopCharacteristics;
|
|
431
465
|
|
|
432
466
|
if (entry.active) {
|
|
433
467
|
newLoopCharacteristics = undefined;
|
|
@@ -439,10 +473,10 @@ ReplaceMenuProvider.prototype._getLoopEntries = function(element) {
|
|
|
439
473
|
|
|
440
474
|
newLoopCharacteristics.isSequential = entry.options.isSequential;
|
|
441
475
|
}
|
|
442
|
-
self._modeling.updateProperties(
|
|
476
|
+
self._modeling.updateProperties(target, { loopCharacteristics: newLoopCharacteristics });
|
|
443
477
|
}
|
|
444
478
|
|
|
445
|
-
var businessObject = getBusinessObject(
|
|
479
|
+
var businessObject = getBusinessObject(target),
|
|
446
480
|
loopCharacteristics = businessObject.loopCharacteristics;
|
|
447
481
|
|
|
448
482
|
var isSequential,
|
|
@@ -456,9 +490,8 @@ ReplaceMenuProvider.prototype._getLoopEntries = function(element) {
|
|
|
456
490
|
}
|
|
457
491
|
|
|
458
492
|
|
|
459
|
-
|
|
460
|
-
{
|
|
461
|
-
id: 'toggle-parallel-mi',
|
|
493
|
+
return {
|
|
494
|
+
'toggle-parallel-mi' : {
|
|
462
495
|
className: 'bpmn-icon-parallel-mi-marker',
|
|
463
496
|
title: translate('Parallel Multi Instance'),
|
|
464
497
|
active: isParallel,
|
|
@@ -468,8 +501,7 @@ ReplaceMenuProvider.prototype._getLoopEntries = function(element) {
|
|
|
468
501
|
isSequential: false
|
|
469
502
|
}
|
|
470
503
|
},
|
|
471
|
-
{
|
|
472
|
-
id: 'toggle-sequential-mi',
|
|
504
|
+
'toggle-sequential-mi': {
|
|
473
505
|
className: 'bpmn-icon-sequential-mi-marker',
|
|
474
506
|
title: translate('Sequential Multi Instance'),
|
|
475
507
|
active: isSequential,
|
|
@@ -479,8 +511,7 @@ ReplaceMenuProvider.prototype._getLoopEntries = function(element) {
|
|
|
479
511
|
isSequential: true
|
|
480
512
|
}
|
|
481
513
|
},
|
|
482
|
-
{
|
|
483
|
-
id: 'toggle-loop',
|
|
514
|
+
'toggle-loop': {
|
|
484
515
|
className: 'bpmn-icon-loop-marker',
|
|
485
516
|
title: translate('Loop'),
|
|
486
517
|
active: isLoop,
|
|
@@ -489,57 +520,54 @@ ReplaceMenuProvider.prototype._getLoopEntries = function(element) {
|
|
|
489
520
|
loopCharacteristics: 'bpmn:StandardLoopCharacteristics'
|
|
490
521
|
}
|
|
491
522
|
}
|
|
492
|
-
|
|
493
|
-
return loopEntries;
|
|
523
|
+
};
|
|
494
524
|
};
|
|
495
525
|
|
|
496
526
|
/**
|
|
497
|
-
* Get
|
|
527
|
+
* Get popup menu header entries for the collection property of the given BPMN element.
|
|
498
528
|
*
|
|
499
|
-
* @param {
|
|
529
|
+
* @param {PopupMenuTarget} target
|
|
500
530
|
*
|
|
501
|
-
* @return {
|
|
531
|
+
* @return {PopupMenuHeaderEntries}
|
|
502
532
|
*/
|
|
503
|
-
ReplaceMenuProvider.prototype.
|
|
533
|
+
ReplaceMenuProvider.prototype._getCollectionHeaderEntries = function(target) {
|
|
504
534
|
|
|
505
535
|
var self = this;
|
|
506
536
|
var translate = this._translate;
|
|
507
537
|
|
|
508
|
-
var dataObject =
|
|
538
|
+
var dataObject = target.businessObject.dataObjectRef;
|
|
509
539
|
|
|
510
540
|
if (!dataObject) {
|
|
511
|
-
return
|
|
541
|
+
return {};
|
|
512
542
|
}
|
|
513
543
|
|
|
514
544
|
function toggleIsCollection(event, entry) {
|
|
515
545
|
self._modeling.updateModdleProperties(
|
|
516
|
-
|
|
546
|
+
target,
|
|
517
547
|
dataObject,
|
|
518
548
|
{ isCollection: !entry.active });
|
|
519
549
|
}
|
|
520
550
|
|
|
521
551
|
var isCollection = dataObject.isCollection;
|
|
522
552
|
|
|
523
|
-
|
|
524
|
-
{
|
|
525
|
-
id: 'toggle-is-collection',
|
|
553
|
+
return {
|
|
554
|
+
'toggle-is-collection': {
|
|
526
555
|
className: 'bpmn-icon-parallel-mi-marker',
|
|
527
556
|
title: translate('Collection'),
|
|
528
557
|
active: isCollection,
|
|
529
558
|
action: toggleIsCollection,
|
|
530
559
|
}
|
|
531
|
-
|
|
532
|
-
return dataObjectEntries;
|
|
560
|
+
};
|
|
533
561
|
};
|
|
534
562
|
|
|
535
563
|
/**
|
|
536
|
-
* Get
|
|
564
|
+
* Get popup menu header entries for the participant multiplicity property of the given BPMN element.
|
|
537
565
|
*
|
|
538
|
-
* @param {
|
|
566
|
+
* @param {PopupMenuTarget} target
|
|
539
567
|
*
|
|
540
|
-
* @return {
|
|
568
|
+
* @return {PopupMenuHeaderEntries}
|
|
541
569
|
*/
|
|
542
|
-
ReplaceMenuProvider.prototype.
|
|
570
|
+
ReplaceMenuProvider.prototype._getParticipantMultiplicityHeaderEntries = function(target) {
|
|
543
571
|
|
|
544
572
|
var self = this;
|
|
545
573
|
var bpmnFactory = this._bpmnFactory;
|
|
@@ -554,33 +582,30 @@ ReplaceMenuProvider.prototype._getParticipantMultiplicity = function(element) {
|
|
|
554
582
|
}
|
|
555
583
|
|
|
556
584
|
self._modeling.updateProperties(
|
|
557
|
-
|
|
585
|
+
target,
|
|
558
586
|
{ participantMultiplicity: participantMultiplicity });
|
|
559
587
|
}
|
|
560
588
|
|
|
561
|
-
var participantMultiplicity =
|
|
589
|
+
var participantMultiplicity = target.businessObject.participantMultiplicity;
|
|
562
590
|
|
|
563
|
-
|
|
564
|
-
{
|
|
565
|
-
id: 'toggle-participant-multiplicity',
|
|
591
|
+
return {
|
|
592
|
+
'toggle-participant-multiplicity': {
|
|
566
593
|
className: 'bpmn-icon-parallel-mi-marker',
|
|
567
594
|
title: translate('Participant Multiplicity'),
|
|
568
595
|
active: !!participantMultiplicity,
|
|
569
596
|
action: toggleParticipantMultiplicity,
|
|
570
597
|
}
|
|
571
|
-
|
|
572
|
-
return participantEntries;
|
|
598
|
+
};
|
|
573
599
|
};
|
|
574
600
|
|
|
575
|
-
|
|
576
601
|
/**
|
|
577
|
-
* Get
|
|
602
|
+
* Get popup menu header entries for the ad-hoc property of the given BPMN element.
|
|
578
603
|
*
|
|
579
|
-
* @param {
|
|
604
|
+
* @param {PopupMenuTarget} target
|
|
580
605
|
*
|
|
581
|
-
* @return {
|
|
606
|
+
* @return {PopupMenuHeaderEntries}
|
|
582
607
|
*/
|
|
583
|
-
ReplaceMenuProvider.prototype.
|
|
608
|
+
ReplaceMenuProvider.prototype._getAdHocHeaderEntries = function(element) {
|
|
584
609
|
var translate = this._translate;
|
|
585
610
|
var businessObject = getBusinessObject(element);
|
|
586
611
|
|
|
@@ -588,25 +613,24 @@ ReplaceMenuProvider.prototype._getAdHocEntry = function(element) {
|
|
|
588
613
|
|
|
589
614
|
var replaceElement = this._bpmnReplace.replaceElement;
|
|
590
615
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
616
|
+
return {
|
|
617
|
+
'toggle-adhoc': {
|
|
618
|
+
className: 'bpmn-icon-ad-hoc-marker',
|
|
619
|
+
title: translate('Ad-hoc'),
|
|
620
|
+
active: isAdHoc,
|
|
621
|
+
action: function(event, entry) {
|
|
622
|
+
if (isAdHoc) {
|
|
623
|
+
return replaceElement(element, { type: 'bpmn:SubProcess' }, {
|
|
624
|
+
autoResize: false,
|
|
625
|
+
layoutConnection: false
|
|
626
|
+
});
|
|
627
|
+
} else {
|
|
628
|
+
return replaceElement(element, { type: 'bpmn:AdHocSubProcess' }, {
|
|
629
|
+
autoResize: false,
|
|
630
|
+
layoutConnection: false
|
|
631
|
+
});
|
|
632
|
+
}
|
|
607
633
|
}
|
|
608
634
|
}
|
|
609
635
|
};
|
|
610
|
-
|
|
611
|
-
return adHocEntry;
|
|
612
636
|
};
|