camunda-bpmn-js 0.11.4 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/CHANGELOG.md +22 -5
  2. package/dist/base-modeler.development.js +89 -1060
  3. package/dist/base-modeler.production.min.js +3 -3
  4. package/dist/camunda-cloud-modeler.development.js +734 -1570
  5. package/dist/camunda-cloud-modeler.production.min.js +3 -3
  6. package/dist/camunda-platform-modeler.development.js +291 -1354
  7. package/dist/camunda-platform-modeler.production.min.js +3 -3
  8. package/lib/camunda-cloud/features/modeling/behavior/CleanUpAssignmentDefinitionBehavior.js +78 -0
  9. package/lib/camunda-cloud/features/modeling/behavior/CleanUpBusinessRuleTaskBehavior.js +112 -0
  10. package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeBoundaryEventBehavior.js +51 -55
  11. package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +56 -59
  12. package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +69 -127
  13. package/lib/camunda-cloud/features/modeling/behavior/UpdatePropagateAllChildVariablesBehavior.js +76 -128
  14. package/lib/camunda-cloud/features/modeling/behavior/index.js +6 -0
  15. package/lib/camunda-cloud/features/properties-provider/parts/implementation/InputOutput.js +21 -7
  16. package/lib/camunda-cloud/features/rules/BpmnRules.js +1 -1
  17. package/lib/camunda-cloud/helper/CalledElementHelper.js +43 -41
  18. package/lib/camunda-cloud/helper/FormsHelper.js +38 -50
  19. package/lib/camunda-cloud/helper/InputOutputHelper.js +92 -106
  20. package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js +24 -47
  21. package/lib/camunda-platform/features/modeling/behavior/DeleteRetryTimeCycleBehavior.js +39 -81
  22. package/lib/camunda-platform/features/modeling/behavior/UpdateCamundaExclusiveBehavior.js +31 -65
  23. package/lib/camunda-platform/features/modeling/behavior/UpdateInputOutputBehavior.js +42 -76
  24. package/lib/camunda-platform/features/modeling/behavior/UpdateResultVariableBehavior.js +21 -26
  25. package/lib/camunda-platform/features/modeling/behavior/UserTaskFormsBehavior.js +16 -10
  26. package/lib/camunda-platform/helper/InputOutputHelper.js +29 -0
  27. package/package.json +5 -5
@@ -3231,6 +3231,13 @@
3231
3231
  return collection.indexOf(element);
3232
3232
  }
3233
3233
 
3234
+ var Collections = /*#__PURE__*/Object.freeze({
3235
+ __proto__: null,
3236
+ remove: remove$2,
3237
+ add: add$1,
3238
+ indexOf: indexOf$1
3239
+ });
3240
+
3234
3241
  /**
3235
3242
  * Computes the distance between two points
3236
3243
  *
@@ -19778,6 +19785,11 @@
19778
19785
  translate: [ 'value', translate$1 ]
19779
19786
  };
19780
19787
 
19788
+ var translate$3 = /*#__PURE__*/Object.freeze({
19789
+ __proto__: null,
19790
+ 'default': translate$2
19791
+ });
19792
+
19781
19793
  var DEFAULT_LABEL_SIZE$1 = {
19782
19794
  width: 90,
19783
19795
  height: 20
@@ -30671,537 +30683,6 @@
30671
30683
  connectionPreview: [ 'type', ConnectionPreview ]
30672
30684
  };
30673
30685
 
30674
- function getOriginal$1(event) {
30675
- return event.originalEvent || event.srcEvent;
30676
- }
30677
-
30678
- function isButton$1(event, button) {
30679
- return (getOriginal$1(event) || event).button === button;
30680
- }
30681
-
30682
- function isPrimaryButton$1(event) {
30683
-
30684
- // button === 0 -> left áka primary mouse button
30685
- return isButton$1(event, 0);
30686
- }
30687
-
30688
- function isAuxiliaryButton$1(event) {
30689
-
30690
- // button === 1 -> auxiliary áka wheel button
30691
- return isButton$1(event, 1);
30692
- }
30693
-
30694
- function toSVGPoints$1(points) {
30695
- var result = '';
30696
-
30697
- for (var i = 0, p; (p = points[i]); i++) {
30698
- result += p.x + ',' + p.y + ' ';
30699
- }
30700
-
30701
- return result;
30702
- }
30703
-
30704
- function createLine$1(points, attrs) {
30705
-
30706
- var line = create('polyline');
30707
- attr$1(line, { points: toSVGPoints$1(points) });
30708
-
30709
- if (attrs) {
30710
- attr$1(line, attrs);
30711
- }
30712
-
30713
- return line;
30714
- }
30715
-
30716
- function updateLine$1(gfx, points) {
30717
- attr$1(gfx, { points: toSVGPoints$1(points) });
30718
-
30719
- return gfx;
30720
- }
30721
-
30722
- function allowAll$1(event) { return true; }
30723
-
30724
- function allowPrimaryAndAuxiliary$1(event) {
30725
- return isPrimaryButton$1(event) || isAuxiliaryButton$1(event);
30726
- }
30727
-
30728
- var LOW_PRIORITY$6 = 500;
30729
-
30730
-
30731
- /**
30732
- * A plugin that provides interaction events for diagram elements.
30733
- *
30734
- * It emits the following events:
30735
- *
30736
- * * element.click
30737
- * * element.contextmenu
30738
- * * element.dblclick
30739
- * * element.hover
30740
- * * element.mousedown
30741
- * * element.mousemove
30742
- * * element.mouseup
30743
- * * element.out
30744
- *
30745
- * Each event is a tuple { element, gfx, originalEvent }.
30746
- *
30747
- * Canceling the event via Event#preventDefault()
30748
- * prevents the original DOM operation.
30749
- *
30750
- * @param {EventBus} eventBus
30751
- */
30752
- function InteractionEvents$1(eventBus, elementRegistry, styles) {
30753
-
30754
- var self = this;
30755
-
30756
- /**
30757
- * Fire an interaction event.
30758
- *
30759
- * @param {string} type local event name, e.g. element.click.
30760
- * @param {DOMEvent} event native event
30761
- * @param {djs.model.Base} [element] the diagram element to emit the event on;
30762
- * defaults to the event target
30763
- */
30764
- function fire(type, event, element) {
30765
-
30766
- if (isIgnored(type, event)) {
30767
- return;
30768
- }
30769
-
30770
- var target, gfx, returnValue;
30771
-
30772
- if (!element) {
30773
- target = event.delegateTarget || event.target;
30774
-
30775
- if (target) {
30776
- gfx = target;
30777
- element = elementRegistry.get(gfx);
30778
- }
30779
- } else {
30780
- gfx = elementRegistry.getGraphics(element);
30781
- }
30782
-
30783
- if (!gfx || !element) {
30784
- return;
30785
- }
30786
-
30787
- returnValue = eventBus.fire(type, {
30788
- element: element,
30789
- gfx: gfx,
30790
- originalEvent: event
30791
- });
30792
-
30793
- if (returnValue === false) {
30794
- event.stopPropagation();
30795
- event.preventDefault();
30796
- }
30797
- }
30798
-
30799
- // TODO(nikku): document this
30800
- var handlers = {};
30801
-
30802
- function mouseHandler(localEventName) {
30803
- return handlers[localEventName];
30804
- }
30805
-
30806
- function isIgnored(localEventName, event) {
30807
-
30808
- var filter = ignoredFilters[localEventName] || isPrimaryButton$1;
30809
-
30810
- // only react on left mouse button interactions
30811
- // except for interaction events that are enabled
30812
- // for secundary mouse button
30813
- return !filter(event);
30814
- }
30815
-
30816
- var bindings = {
30817
- click: 'element.click',
30818
- contextmenu: 'element.contextmenu',
30819
- dblclick: 'element.dblclick',
30820
- mousedown: 'element.mousedown',
30821
- mousemove: 'element.mousemove',
30822
- mouseover: 'element.hover',
30823
- mouseout: 'element.out',
30824
- mouseup: 'element.mouseup',
30825
- };
30826
-
30827
- var ignoredFilters = {
30828
- 'element.contextmenu': allowAll$1,
30829
- 'element.mousedown': allowPrimaryAndAuxiliary$1,
30830
- 'element.mouseup': allowPrimaryAndAuxiliary$1,
30831
- 'element.click': allowPrimaryAndAuxiliary$1,
30832
- 'element.dblclick': allowPrimaryAndAuxiliary$1
30833
- };
30834
-
30835
-
30836
- // manual event trigger //////////
30837
-
30838
- /**
30839
- * Trigger an interaction event (based on a native dom event)
30840
- * on the target shape or connection.
30841
- *
30842
- * @param {string} eventName the name of the triggered DOM event
30843
- * @param {MouseEvent} event
30844
- * @param {djs.model.Base} targetElement
30845
- */
30846
- function triggerMouseEvent(eventName, event, targetElement) {
30847
-
30848
- // i.e. element.mousedown...
30849
- var localEventName = bindings[eventName];
30850
-
30851
- if (!localEventName) {
30852
- throw new Error('unmapped DOM event name <' + eventName + '>');
30853
- }
30854
-
30855
- return fire(localEventName, event, targetElement);
30856
- }
30857
-
30858
-
30859
- var ELEMENT_SELECTOR = 'svg, .djs-element';
30860
-
30861
- // event handling ///////
30862
-
30863
- function registerEvent(node, event, localEvent, ignoredFilter) {
30864
-
30865
- var handler = handlers[localEvent] = function(event) {
30866
- fire(localEvent, event);
30867
- };
30868
-
30869
- if (ignoredFilter) {
30870
- ignoredFilters[localEvent] = ignoredFilter;
30871
- }
30872
-
30873
- handler.$delegate = delegate.bind(node, ELEMENT_SELECTOR, event, handler);
30874
- }
30875
-
30876
- function unregisterEvent(node, event, localEvent) {
30877
-
30878
- var handler = mouseHandler(localEvent);
30879
-
30880
- if (!handler) {
30881
- return;
30882
- }
30883
-
30884
- delegate.unbind(node, event, handler.$delegate);
30885
- }
30886
-
30887
- function registerEvents(svg) {
30888
- forEach(bindings, function(val, key) {
30889
- registerEvent(svg, key, val);
30890
- });
30891
- }
30892
-
30893
- function unregisterEvents(svg) {
30894
- forEach(bindings, function(val, key) {
30895
- unregisterEvent(svg, key, val);
30896
- });
30897
- }
30898
-
30899
- eventBus.on('canvas.destroy', function(event) {
30900
- unregisterEvents(event.svg);
30901
- });
30902
-
30903
- eventBus.on('canvas.init', function(event) {
30904
- registerEvents(event.svg);
30905
- });
30906
-
30907
-
30908
- // hit box updating ////////////////
30909
-
30910
- eventBus.on([ 'shape.added', 'connection.added' ], function(event) {
30911
- var element = event.element,
30912
- gfx = event.gfx;
30913
-
30914
- eventBus.fire('interactionEvents.createHit', { element: element, gfx: gfx });
30915
- });
30916
-
30917
- // Update djs-hit on change.
30918
- // A low priortity is necessary, because djs-hit of labels has to be updated
30919
- // after the label bounds have been updated in the renderer.
30920
- eventBus.on([
30921
- 'shape.changed',
30922
- 'connection.changed'
30923
- ], LOW_PRIORITY$6, function(event) {
30924
-
30925
- var element = event.element,
30926
- gfx = event.gfx;
30927
-
30928
- eventBus.fire('interactionEvents.updateHit', { element: element, gfx: gfx });
30929
- });
30930
-
30931
- eventBus.on('interactionEvents.createHit', LOW_PRIORITY$6, function(event) {
30932
- var element = event.element,
30933
- gfx = event.gfx;
30934
-
30935
- self.createDefaultHit(element, gfx);
30936
- });
30937
-
30938
- eventBus.on('interactionEvents.updateHit', function(event) {
30939
- var element = event.element,
30940
- gfx = event.gfx;
30941
-
30942
- self.updateDefaultHit(element, gfx);
30943
- });
30944
-
30945
-
30946
- // hit styles ////////////
30947
-
30948
- var STROKE_HIT_STYLE = createHitStyle('djs-hit djs-hit-stroke');
30949
-
30950
- var CLICK_STROKE_HIT_STYLE = createHitStyle('djs-hit djs-hit-click-stroke');
30951
-
30952
- var ALL_HIT_STYLE = createHitStyle('djs-hit djs-hit-all');
30953
-
30954
- var HIT_TYPES = {
30955
- 'all': ALL_HIT_STYLE,
30956
- 'click-stroke': CLICK_STROKE_HIT_STYLE,
30957
- 'stroke': STROKE_HIT_STYLE
30958
- };
30959
-
30960
- function createHitStyle(classNames, attrs) {
30961
-
30962
- attrs = assign({
30963
- stroke: 'white',
30964
- strokeWidth: 15
30965
- }, attrs || {});
30966
-
30967
- return styles.cls(classNames, [ 'no-fill', 'no-border' ], attrs);
30968
- }
30969
-
30970
-
30971
- // style helpers ///////////////
30972
-
30973
- function applyStyle(hit, type) {
30974
-
30975
- var attrs = HIT_TYPES[type];
30976
-
30977
- if (!attrs) {
30978
- throw new Error('invalid hit type <' + type + '>');
30979
- }
30980
-
30981
- attr$1(hit, attrs);
30982
-
30983
- return hit;
30984
- }
30985
-
30986
- function appendHit(gfx, hit) {
30987
- append(gfx, hit);
30988
- }
30989
-
30990
-
30991
- // API
30992
-
30993
- /**
30994
- * Remove hints on the given graphics.
30995
- *
30996
- * @param {SVGElement} gfx
30997
- */
30998
- this.removeHits = function(gfx) {
30999
- var hits = all('.djs-hit', gfx);
31000
-
31001
- forEach(hits, remove$1);
31002
- };
31003
-
31004
- /**
31005
- * Create default hit for the given element.
31006
- *
31007
- * @param {djs.model.Base} element
31008
- * @param {SVGElement} gfx
31009
- *
31010
- * @return {SVGElement} created hit
31011
- */
31012
- this.createDefaultHit = function(element, gfx) {
31013
- var waypoints = element.waypoints,
31014
- isFrame = element.isFrame,
31015
- boxType;
31016
-
31017
- if (waypoints) {
31018
- return this.createWaypointsHit(gfx, waypoints);
31019
- } else {
31020
-
31021
- boxType = isFrame ? 'stroke' : 'all';
31022
-
31023
- return this.createBoxHit(gfx, boxType, {
31024
- width: element.width,
31025
- height: element.height
31026
- });
31027
- }
31028
- };
31029
-
31030
- /**
31031
- * Create hits for the given waypoints.
31032
- *
31033
- * @param {SVGElement} gfx
31034
- * @param {Array<Point>} waypoints
31035
- *
31036
- * @return {SVGElement}
31037
- */
31038
- this.createWaypointsHit = function(gfx, waypoints) {
31039
-
31040
- var hit = createLine$1(waypoints);
31041
-
31042
- applyStyle(hit, 'stroke');
31043
-
31044
- appendHit(gfx, hit);
31045
-
31046
- return hit;
31047
- };
31048
-
31049
- /**
31050
- * Create hits for a box.
31051
- *
31052
- * @param {SVGElement} gfx
31053
- * @param {string} hitType
31054
- * @param {Object} attrs
31055
- *
31056
- * @return {SVGElement}
31057
- */
31058
- this.createBoxHit = function(gfx, type, attrs) {
31059
-
31060
- attrs = assign({
31061
- x: 0,
31062
- y: 0
31063
- }, attrs);
31064
-
31065
- var hit = create('rect');
31066
-
31067
- applyStyle(hit, type);
31068
-
31069
- attr$1(hit, attrs);
31070
-
31071
- appendHit(gfx, hit);
31072
-
31073
- return hit;
31074
- };
31075
-
31076
- /**
31077
- * Update default hit of the element.
31078
- *
31079
- * @param {djs.model.Base} element
31080
- * @param {SVGElement} gfx
31081
- *
31082
- * @return {SVGElement} updated hit
31083
- */
31084
- this.updateDefaultHit = function(element, gfx) {
31085
-
31086
- var hit = query('.djs-hit', gfx);
31087
-
31088
- if (!hit) {
31089
- return;
31090
- }
31091
-
31092
- if (element.waypoints) {
31093
- updateLine$1(hit, element.waypoints);
31094
- } else {
31095
- attr$1(hit, {
31096
- width: element.width,
31097
- height: element.height
31098
- });
31099
- }
31100
-
31101
- return hit;
31102
- };
31103
-
31104
- this.fire = fire;
31105
-
31106
- this.triggerMouseEvent = triggerMouseEvent;
31107
-
31108
- this.mouseHandler = mouseHandler;
31109
-
31110
- this.registerEvent = registerEvent;
31111
- this.unregisterEvent = unregisterEvent;
31112
- }
31113
-
31114
-
31115
- InteractionEvents$1.$inject = [
31116
- 'eventBus',
31117
- 'elementRegistry',
31118
- 'styles'
31119
- ];
31120
-
31121
-
31122
- /**
31123
- * An event indicating that the mouse hovered over an element
31124
- *
31125
- * @event element.hover
31126
- *
31127
- * @type {Object}
31128
- * @property {djs.model.Base} element
31129
- * @property {SVGElement} gfx
31130
- * @property {Event} originalEvent
31131
- */
31132
-
31133
- /**
31134
- * An event indicating that the mouse has left an element
31135
- *
31136
- * @event element.out
31137
- *
31138
- * @type {Object}
31139
- * @property {djs.model.Base} element
31140
- * @property {SVGElement} gfx
31141
- * @property {Event} originalEvent
31142
- */
31143
-
31144
- /**
31145
- * An event indicating that the mouse has clicked an element
31146
- *
31147
- * @event element.click
31148
- *
31149
- * @type {Object}
31150
- * @property {djs.model.Base} element
31151
- * @property {SVGElement} gfx
31152
- * @property {Event} originalEvent
31153
- */
31154
-
31155
- /**
31156
- * An event indicating that the mouse has double clicked an element
31157
- *
31158
- * @event element.dblclick
31159
- *
31160
- * @type {Object}
31161
- * @property {djs.model.Base} element
31162
- * @property {SVGElement} gfx
31163
- * @property {Event} originalEvent
31164
- */
31165
-
31166
- /**
31167
- * An event indicating that the mouse has gone down on an element.
31168
- *
31169
- * @event element.mousedown
31170
- *
31171
- * @type {Object}
31172
- * @property {djs.model.Base} element
31173
- * @property {SVGElement} gfx
31174
- * @property {Event} originalEvent
31175
- */
31176
-
31177
- /**
31178
- * An event indicating that the mouse has gone up on an element.
31179
- *
31180
- * @event element.mouseup
31181
- *
31182
- * @type {Object}
31183
- * @property {djs.model.Base} element
31184
- * @property {SVGElement} gfx
31185
- * @property {Event} originalEvent
31186
- */
31187
-
31188
- /**
31189
- * An event indicating that the context menu action is triggered
31190
- * via mouse or touch controls.
31191
- *
31192
- * @event element.contextmenu
31193
- *
31194
- * @type {Object}
31195
- * @property {djs.model.Base} element
31196
- * @property {SVGElement} gfx
31197
- * @property {Event} originalEvent
31198
- */
31199
-
31200
- var InteractionEventsModule$1 = {
31201
- __init__: [ 'interactionEvents' ],
31202
- interactionEvents: [ 'type', InteractionEvents$1 ]
31203
- };
31204
-
31205
30686
  var min = Math.min,
31206
30687
  max$1 = Math.max;
31207
30688
 
@@ -31835,7 +31316,7 @@
31835
31316
 
31836
31317
  var DirectEditingModule = {
31837
31318
  __depends__: [
31838
- InteractionEventsModule$1
31319
+ InteractionEventsModule
31839
31320
  ],
31840
31321
  __init__: [ 'directEditing' ],
31841
31322
  directEditing: [ 'type', DirectEditing ]
@@ -32784,7 +32265,7 @@
32784
32265
  return !!element.labelTarget;
32785
32266
  }
32786
32267
 
32787
- var LOW_PRIORITY$7 = 750;
32268
+ var LOW_PRIORITY$6 = 750;
32788
32269
 
32789
32270
 
32790
32271
  function CreatePreview(
@@ -32829,7 +32310,7 @@
32829
32310
  return dragGroup;
32830
32311
  }
32831
32312
 
32832
- eventBus.on('create.move', LOW_PRIORITY$7, function(event) {
32313
+ eventBus.on('create.move', LOW_PRIORITY$6, function(event) {
32833
32314
 
32834
32315
  var hover = event.hover,
32835
32316
  context = event.context,
@@ -34176,12 +33657,12 @@
34176
33657
  });
34177
33658
  }
34178
33659
 
34179
- var LOW_PRIORITY$8 = 750;
33660
+ var LOW_PRIORITY$7 = 750;
34180
33661
 
34181
33662
 
34182
33663
  function BpmnCopyPaste(bpmnFactory, eventBus, moddleCopy) {
34183
33664
 
34184
- eventBus.on('copyPaste.copyElement', LOW_PRIORITY$8, function(context) {
33665
+ eventBus.on('copyPaste.copyElement', LOW_PRIORITY$7, function(context) {
34185
33666
  var descriptor = context.descriptor,
34186
33667
  element = context.element;
34187
33668
 
@@ -34528,9 +34009,9 @@
34528
34009
  return;
34529
34010
  }
34530
34011
 
34531
- // disallow copying IDs if already assigned
34532
- if (propertyDescriptor.isId && this._moddle.ids.assigned(property)) {
34533
- return;
34012
+ // copy id
34013
+ if (propertyDescriptor.isId) {
34014
+ return this._copyId(property, parent);
34534
34015
  }
34535
34016
 
34536
34017
  // copy arrays
@@ -34571,6 +34052,18 @@
34571
34052
  return property;
34572
34053
  };
34573
34054
 
34055
+ ModdleCopy.prototype._copyId = function(id, element) {
34056
+
34057
+ // disallow if already taken
34058
+ if (this._moddle.ids.assigned(id)) {
34059
+ return;
34060
+ } else {
34061
+
34062
+ this._moddle.ids.claim(id, element);
34063
+ return id;
34064
+ }
34065
+ };
34066
+
34574
34067
  // helpers //////////
34575
34068
 
34576
34069
  function getPropertyNames(descriptor, keepDefaultProperties) {
@@ -37977,7 +37470,7 @@
37977
37470
  }
37978
37471
 
37979
37472
  var LOWER_PRIORITY = 1200;
37980
- var LOW_PRIORITY$9 = 800;
37473
+ var LOW_PRIORITY$8 = 800;
37981
37474
 
37982
37475
  /**
37983
37476
  * Basic grid snapping that covers connecting, creating, moving, resizing shapes, moving bendpoints
@@ -37991,7 +37484,7 @@
37991
37484
 
37992
37485
  var self = this;
37993
37486
 
37994
- eventBus.on('diagram.init', LOW_PRIORITY$9, function() {
37487
+ eventBus.on('diagram.init', LOW_PRIORITY$8, function() {
37995
37488
  self.setActive(active);
37996
37489
  });
37997
37490
 
@@ -38882,7 +38375,7 @@
38882
38375
  return true;
38883
38376
  };
38884
38377
 
38885
- var InteractionEventsModule$2 = {
38378
+ var InteractionEventsModule$1 = {
38886
38379
  __init__: [ 'bpmnInteractionEvents' ],
38887
38380
  bpmnInteractionEvents: [ 'type', BpmnInteractionEvents ]
38888
38381
  };
@@ -39537,7 +39030,7 @@
39537
39030
  var MARKER_RESIZING = 'djs-resizing',
39538
39031
  MARKER_RESIZE_NOT_OK = 'resize-not-ok';
39539
39032
 
39540
- var LOW_PRIORITY$a = 500;
39033
+ var LOW_PRIORITY$9 = 500;
39541
39034
 
39542
39035
 
39543
39036
  /**
@@ -39598,7 +39091,7 @@
39598
39091
  }
39599
39092
 
39600
39093
  // add and update previews
39601
- eventBus.on('resize.move', LOW_PRIORITY$a, function(event) {
39094
+ eventBus.on('resize.move', LOW_PRIORITY$9, function(event) {
39602
39095
  updateFrame(event.context);
39603
39096
  });
39604
39097
 
@@ -40695,7 +40188,7 @@
40695
40188
  'modeling'
40696
40189
  ];
40697
40190
 
40698
- var LOW_PRIORITY$b = 500;
40191
+ var LOW_PRIORITY$a = 500;
40699
40192
 
40700
40193
 
40701
40194
  /**
@@ -40708,7 +40201,7 @@
40708
40201
 
40709
40202
  var self = this;
40710
40203
 
40711
- this.postExecuted('elements.create', LOW_PRIORITY$b, function(context) {
40204
+ this.postExecuted('elements.create', LOW_PRIORITY$a, function(context) {
40712
40205
  var elements = context.elements;
40713
40206
 
40714
40207
  elements = elements.filter(function(shape) {
@@ -40731,7 +40224,7 @@
40731
40224
  }, true);
40732
40225
 
40733
40226
 
40734
- this.preExecute('elements.move', LOW_PRIORITY$b, function(context) {
40227
+ this.preExecute('elements.move', LOW_PRIORITY$a, function(context) {
40735
40228
  var shapes = context.shapes,
40736
40229
  host = context.newHost;
40737
40230
 
@@ -40857,7 +40350,7 @@
40857
40350
 
40858
40351
  inherits_browser(BoundaryEventBehavior, CommandInterceptor);
40859
40352
 
40860
- var LOW_PRIORITY$c = 500;
40353
+ var LOW_PRIORITY$b = 500;
40861
40354
 
40862
40355
 
40863
40356
  /**
@@ -40971,7 +40464,7 @@
40971
40464
  }
40972
40465
  });
40973
40466
 
40974
- eventBus.on('copyPaste.pasteElement', LOW_PRIORITY$c, function(context) {
40467
+ eventBus.on('copyPaste.pasteElement', LOW_PRIORITY$b, function(context) {
40975
40468
  var descriptor = context.descriptor,
40976
40469
  businessObject = descriptor.businessObject;
40977
40470
 
@@ -41794,7 +41287,7 @@
41794
41287
  }
41795
41288
  }
41796
41289
 
41797
- var LOW_PRIORITY$d = 500;
41290
+ var LOW_PRIORITY$c = 500;
41798
41291
 
41799
41292
 
41800
41293
  /**
@@ -41863,7 +41356,7 @@
41863
41356
  /**
41864
41357
  * Adjust sizes of other lanes after lane deletion
41865
41358
  */
41866
- this.postExecuted('shape.delete', LOW_PRIORITY$d, function(event) {
41359
+ this.postExecuted('shape.delete', LOW_PRIORITY$c, function(event) {
41867
41360
 
41868
41361
  var context = event.context,
41869
41362
  hints = context.hints,
@@ -41892,7 +41385,7 @@
41892
41385
 
41893
41386
  inherits_browser(DeleteLaneBehavior, CommandInterceptor);
41894
41387
 
41895
- var LOW_PRIORITY$e = 500;
41388
+ var LOW_PRIORITY$d = 500;
41896
41389
 
41897
41390
 
41898
41391
  /**
@@ -41905,7 +41398,7 @@
41905
41398
 
41906
41399
  var self = this;
41907
41400
 
41908
- this.postExecuted('elements.create', LOW_PRIORITY$e, function(context) {
41401
+ this.postExecuted('elements.create', LOW_PRIORITY$d, function(context) {
41909
41402
  var elements = context.elements;
41910
41403
 
41911
41404
  elements.filter(function(shape) {
@@ -41919,7 +41412,7 @@
41919
41412
  });
41920
41413
  }, true);
41921
41414
 
41922
- this.preExecute('elements.move', LOW_PRIORITY$e, function(context) {
41415
+ this.preExecute('elements.move', LOW_PRIORITY$d, function(context) {
41923
41416
  var shapes = context.shapes,
41924
41417
  newHost = context.newHost;
41925
41418
 
@@ -43711,7 +43204,7 @@
43711
43204
  }
43712
43205
 
43713
43206
  function getWaypointsInsideBounds(waypoints, bounds) {
43714
- var originalWaypoints = map(waypoints, getOriginal$2);
43207
+ var originalWaypoints = map(waypoints, getOriginal$1);
43715
43208
 
43716
43209
  return filter(originalWaypoints, function(waypoint) {
43717
43210
  return isInsideBounds(waypoint, bounds);
@@ -43728,7 +43221,7 @@
43728
43221
  return getOrientation(bounds, point, 1) === 'intersect';
43729
43222
  }
43730
43223
 
43731
- function getOriginal$2(point) {
43224
+ function getOriginal$1(point) {
43732
43225
  return point.original || point;
43733
43226
  }
43734
43227
 
@@ -44615,7 +44108,7 @@
44615
44108
  };
44616
44109
  }
44617
44110
 
44618
- var LOW_PRIORITY$f = 500;
44111
+ var LOW_PRIORITY$e = 500;
44619
44112
 
44620
44113
 
44621
44114
  function ToggleElementCollapseBehaviour(
@@ -44673,7 +44166,7 @@
44673
44166
  };
44674
44167
  }
44675
44168
 
44676
- this.executed([ 'shape.toggleCollapse' ], LOW_PRIORITY$f, function(e) {
44169
+ this.executed([ 'shape.toggleCollapse' ], LOW_PRIORITY$e, function(e) {
44677
44170
 
44678
44171
  var context = e.context,
44679
44172
  shape = context.shape;
@@ -44696,7 +44189,7 @@
44696
44189
  }
44697
44190
  });
44698
44191
 
44699
- this.reverted([ 'shape.toggleCollapse' ], LOW_PRIORITY$f, function(e) {
44192
+ this.reverted([ 'shape.toggleCollapse' ], LOW_PRIORITY$e, function(e) {
44700
44193
 
44701
44194
  var context = e.context;
44702
44195
  var shape = context.shape;
@@ -44711,7 +44204,7 @@
44711
44204
  }
44712
44205
  });
44713
44206
 
44714
- this.postExecuted([ 'shape.toggleCollapse' ], LOW_PRIORITY$f, function(e) {
44207
+ this.postExecuted([ 'shape.toggleCollapse' ], LOW_PRIORITY$e, function(e) {
44715
44208
  var shape = e.context.shape,
44716
44209
  defaultSize = elementFactory._getDefaultSize(shape),
44717
44210
  newBounds;
@@ -44799,7 +44292,7 @@
44799
44292
 
44800
44293
  UnclaimIdBehavior.$inject = [ 'canvas', 'injector', 'moddle', 'modeling' ];
44801
44294
 
44802
- var LOW_PRIORITY$g = 500,
44295
+ var LOW_PRIORITY$f = 500,
44803
44296
  HIGH_PRIORITY$c = 5000;
44804
44297
 
44805
44298
 
@@ -44881,7 +44374,7 @@
44881
44374
  initContext();
44882
44375
  });
44883
44376
 
44884
- this.postExecuted(laneRefUpdateEvents, LOW_PRIORITY$g, function(event) {
44377
+ this.postExecuted(laneRefUpdateEvents, LOW_PRIORITY$f, function(event) {
44885
44378
  releaseContext();
44886
44379
  });
44887
44380
 
@@ -47220,7 +46713,7 @@
47220
46713
  return collection;
47221
46714
  }
47222
46715
 
47223
- var LOW_PRIORITY$h = 250,
46716
+ var LOW_PRIORITY$g = 250,
47224
46717
  HIGH_PRIORITY$e = 1400;
47225
46718
 
47226
46719
 
@@ -47251,7 +46744,7 @@
47251
46744
  });
47252
46745
 
47253
46746
  // add labels to visual's group
47254
- movePreview && eventBus.on('shape.move.start', LOW_PRIORITY$h, function(e) {
46747
+ movePreview && eventBus.on('shape.move.start', LOW_PRIORITY$g, function(e) {
47255
46748
 
47256
46749
  var context = e.context,
47257
46750
  shapes = context.shapes;
@@ -47380,7 +46873,7 @@
47380
46873
  labelSupport: [ 'type', LabelSupport ]
47381
46874
  };
47382
46875
 
47383
- var LOW_PRIORITY$i = 251,
46876
+ var LOW_PRIORITY$h = 251,
47384
46877
  HIGH_PRIORITY$f = 1401;
47385
46878
 
47386
46879
  var MARKER_ATTACH$1 = 'attach-ok';
@@ -47422,7 +46915,7 @@
47422
46915
  });
47423
46916
 
47424
46917
  // add attachers to the visual's group
47425
- movePreview && eventBus.on('shape.move.start', LOW_PRIORITY$i, function(e) {
46918
+ movePreview && eventBus.on('shape.move.start', LOW_PRIORITY$h, function(e) {
47426
46919
 
47427
46920
  var context = e.context,
47428
46921
  shapes = context.shapes,
@@ -47704,7 +47197,7 @@
47704
47197
  attachSupport: [ 'type', AttachSupport ]
47705
47198
  };
47706
47199
 
47707
- var LOW_PRIORITY$j = 250;
47200
+ var LOW_PRIORITY$i = 250;
47708
47201
 
47709
47202
  /**
47710
47203
  * The tool manager acts as middle-man between the available tool's and the Palette,
@@ -47780,7 +47273,7 @@
47780
47273
  eventsToRegister.push(event + '.canceled');
47781
47274
  });
47782
47275
 
47783
- eventBus.on(eventsToRegister, LOW_PRIORITY$j, function(event) {
47276
+ eventBus.on(eventsToRegister, LOW_PRIORITY$i, function(event) {
47784
47277
 
47785
47278
  // We defer the de-activation of the tool to the .activate phase,
47786
47279
  // so we're able to check if we want to toggle off the current
@@ -48409,7 +47902,7 @@
48409
47902
  var MARKER_DRAGGING = 'djs-dragging',
48410
47903
  MARKER_RESIZING$1 = 'djs-resizing';
48411
47904
 
48412
- var LOW_PRIORITY$k = 250;
47905
+ var LOW_PRIORITY$j = 250;
48413
47906
 
48414
47907
  var max$6 = Math.max;
48415
47908
 
@@ -48484,7 +47977,7 @@
48484
47977
  });
48485
47978
 
48486
47979
  // add and update move/resize previews
48487
- eventBus.on('spaceTool.move', LOW_PRIORITY$k, function(event) {
47980
+ eventBus.on('spaceTool.move', LOW_PRIORITY$j, function(event) {
48488
47981
 
48489
47982
  var context = event.context,
48490
47983
  line = context.line,
@@ -54614,7 +54107,7 @@
54614
54107
  connectionDocking: [ 'type', CroppingConnectionDocking ]
54615
54108
  };
54616
54109
 
54617
- var LOW_PRIORITY$l = 500,
54110
+ var LOW_PRIORITY$k = 500,
54618
54111
  MEDIUM_PRIORITY = 1250,
54619
54112
  HIGH_PRIORITY$h = 1500;
54620
54113
 
@@ -54713,7 +54206,7 @@
54713
54206
  // to let others modify the move event before we update
54714
54207
  // the context
54715
54208
  //
54716
- eventBus.on('shape.move.move', LOW_PRIORITY$l, function(event) {
54209
+ eventBus.on('shape.move.move', LOW_PRIORITY$k, function(event) {
54717
54210
 
54718
54211
  var context = event.context,
54719
54212
  validatedShapes = context.validatedShapes,
@@ -54859,7 +54352,7 @@
54859
54352
  });
54860
54353
  }
54861
54354
 
54862
- var LOW_PRIORITY$m = 499;
54355
+ var LOW_PRIORITY$l = 499;
54863
54356
 
54864
54357
  var MARKER_DRAGGING$1 = 'djs-dragging',
54865
54358
  MARKER_OK$3 = 'drop-ok',
@@ -54937,7 +54430,7 @@
54937
54430
  // assign a low priority to this handler
54938
54431
  // to let others modify the move context before
54939
54432
  // we draw things
54940
- eventBus.on('shape.move.start', LOW_PRIORITY$m, function(event) {
54433
+ eventBus.on('shape.move.start', LOW_PRIORITY$l, function(event) {
54941
54434
  var context = event.context,
54942
54435
  dragShapes = context.shapes,
54943
54436
  allDraggedElements = context.allDraggedElements;
@@ -54984,7 +54477,7 @@
54984
54477
  });
54985
54478
 
54986
54479
  // update previews
54987
- eventBus.on('shape.move.move', LOW_PRIORITY$m, function(event) {
54480
+ eventBus.on('shape.move.move', LOW_PRIORITY$l, function(event) {
54988
54481
 
54989
54482
  var context = event.context,
54990
54483
  dragGroup = context.dragGroup,
@@ -56326,7 +55819,7 @@
56326
55819
  paletteProvider: [ 'type', PaletteProvider ]
56327
55820
  };
56328
55821
 
56329
- var LOW_PRIORITY$n = 250;
55822
+ var LOW_PRIORITY$m = 250;
56330
55823
 
56331
55824
 
56332
55825
  function BpmnReplacePreview(
@@ -56407,7 +55900,7 @@
56407
55900
  });
56408
55901
  }
56409
55902
 
56410
- eventBus.on('shape.move.move', LOW_PRIORITY$n, function(event) {
55903
+ eventBus.on('shape.move.move', LOW_PRIORITY$m, function(event) {
56411
55904
 
56412
55905
  var context = event.context,
56413
55906
  canExecute = context.canExecute;
@@ -58337,7 +57830,7 @@
58337
57830
  DistributeElementsModule$1,
58338
57831
  EditorActionsModule$1,
58339
57832
  GridSnappingModule$1,
58340
- InteractionEventsModule$2,
57833
+ InteractionEventsModule$1,
58341
57834
  KeyboardModule$1,
58342
57835
  KeyboardMoveSelectionModule,
58343
57836
  LabelEditingModule,
@@ -58363,24 +57856,6 @@
58363
57856
  Modeler.prototype._modelingModules
58364
57857
  );
58365
57858
 
58366
- /**
58367
- * SVGs for elements are generated by the {@link GraphicsFactory}.
58368
- *
58369
- * This utility gives quick access to the important semantic
58370
- * parts of an element.
58371
- */
58372
-
58373
- /**
58374
- * Returns the visual part of a diagram element
58375
- *
58376
- * @param {Snap<SVGElement>} gfx
58377
- *
58378
- * @return {Snap<SVGElement>}
58379
- */
58380
- function getVisual$1(gfx) {
58381
- return gfx.childNodes[0];
58382
- }
58383
-
58384
57859
  var MINIMAP_VIEWBOX_PADDING = 50;
58385
57860
 
58386
57861
  var RANGE$1 = { min: 0.2, max: 4 },
@@ -58388,7 +57863,7 @@
58388
57863
 
58389
57864
  var DELTA_THRESHOLD$1 = 0.1;
58390
57865
 
58391
- var LOW_PRIORITY$o = 250;
57866
+ var LOW_PRIORITY$n = 250;
58392
57867
 
58393
57868
 
58394
57869
  /**
@@ -58662,7 +58137,7 @@
58662
58137
  });
58663
58138
 
58664
58139
  // update on elements changed
58665
- eventBus.on('elements.changed', LOW_PRIORITY$o, function(context) {
58140
+ eventBus.on('elements.changed', LOW_PRIORITY$n, function(context) {
58666
58141
  var elements = context.elements;
58667
58142
 
58668
58143
  elements.forEach(function(element) {
@@ -59033,7 +58508,7 @@
59033
58508
  visual;
59034
58509
 
59035
58510
  if (gfx) {
59036
- visual = getVisual$1(gfx);
58511
+ visual = getVisual(gfx);
59037
58512
 
59038
58513
  if (visual) {
59039
58514
  var elementGfx = clone(visual);
@@ -59634,416 +59109,6 @@
59634
59109
  ]
59635
59110
  };
59636
59111
 
59637
- var DEFAULT_PRIORITY$6 = 1000;
59638
-
59639
- /**
59640
- * A utility that can be used to plug-in into the command execution for
59641
- * extension and/or validation.
59642
- *
59643
- * @param {EventBus} eventBus
59644
- *
59645
- * @example
59646
- *
59647
- * import inherits from 'inherits';
59648
- *
59649
- * import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
59650
- *
59651
- * function CommandLogger(eventBus) {
59652
- * CommandInterceptor.call(this, eventBus);
59653
- *
59654
- * this.preExecute(function(event) {
59655
- * console.log('command pre-execute', event);
59656
- * });
59657
- * }
59658
- *
59659
- * inherits(CommandLogger, CommandInterceptor);
59660
- *
59661
- */
59662
- function CommandInterceptor$1(eventBus) {
59663
- this._eventBus = eventBus;
59664
- }
59665
-
59666
- CommandInterceptor$1.$inject = [ 'eventBus' ];
59667
-
59668
- function unwrapEvent$1(fn, that) {
59669
- return function(event) {
59670
- return fn.call(that || null, event.context, event.command, event);
59671
- };
59672
- }
59673
-
59674
- /**
59675
- * Register an interceptor for a command execution
59676
- *
59677
- * @param {string|Array<string>} [events] list of commands to register on
59678
- * @param {string} [hook] command hook, i.e. preExecute, executed to listen on
59679
- * @param {number} [priority] the priority on which to hook into the execution
59680
- * @param {Function} handlerFn interceptor to be invoked with (event)
59681
- * @param {boolean} unwrap if true, unwrap the event and pass (context, command, event) to the
59682
- * listener instead
59683
- * @param {Object} [that] Pass context (`this`) to the handler function
59684
- */
59685
- CommandInterceptor$1.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) {
59686
-
59687
- if (isFunction(hook) || isNumber(hook)) {
59688
- that = unwrap;
59689
- unwrap = handlerFn;
59690
- handlerFn = priority;
59691
- priority = hook;
59692
- hook = null;
59693
- }
59694
-
59695
- if (isFunction(priority)) {
59696
- that = unwrap;
59697
- unwrap = handlerFn;
59698
- handlerFn = priority;
59699
- priority = DEFAULT_PRIORITY$6;
59700
- }
59701
-
59702
- if (isObject(unwrap)) {
59703
- that = unwrap;
59704
- unwrap = false;
59705
- }
59706
-
59707
- if (!isFunction(handlerFn)) {
59708
- throw new Error('handlerFn must be a function');
59709
- }
59710
-
59711
- if (!isArray(events)) {
59712
- events = [ events ];
59713
- }
59714
-
59715
- var eventBus = this._eventBus;
59716
-
59717
- forEach(events, function(event) {
59718
-
59719
- // concat commandStack(.event)?(.hook)?
59720
- var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');
59721
-
59722
- eventBus.on(fullEvent, priority, unwrap ? unwrapEvent$1(handlerFn, that) : handlerFn, that);
59723
- });
59724
- };
59725
-
59726
-
59727
- var hooks$1 = [
59728
- 'canExecute',
59729
- 'preExecute',
59730
- 'preExecuted',
59731
- 'execute',
59732
- 'executed',
59733
- 'postExecute',
59734
- 'postExecuted',
59735
- 'revert',
59736
- 'reverted'
59737
- ];
59738
-
59739
- /*
59740
- * Install hook shortcuts
59741
- *
59742
- * This will generate the CommandInterceptor#(preExecute|...|reverted) methods
59743
- * which will in term forward to CommandInterceptor#on.
59744
- */
59745
- forEach(hooks$1, function(hook) {
59746
-
59747
- /**
59748
- * {canExecute|preExecute|preExecuted|execute|executed|postExecute|postExecuted|revert|reverted}
59749
- *
59750
- * A named hook for plugging into the command execution
59751
- *
59752
- * @param {string|Array<string>} [events] list of commands to register on
59753
- * @param {number} [priority] the priority on which to hook into the execution
59754
- * @param {Function} handlerFn interceptor to be invoked with (event)
59755
- * @param {boolean} [unwrap=false] if true, unwrap the event and pass (context, command, event) to the
59756
- * listener instead
59757
- * @param {Object} [that] Pass context (`this`) to the handler function
59758
- */
59759
- CommandInterceptor$1.prototype[hook] = function(events, priority, handlerFn, unwrap, that) {
59760
-
59761
- if (isFunction(events) || isNumber(events)) {
59762
- that = unwrap;
59763
- unwrap = handlerFn;
59764
- handlerFn = priority;
59765
- priority = events;
59766
- events = null;
59767
- }
59768
-
59769
- this.on(events, hook, priority, handlerFn, unwrap, that);
59770
- };
59771
- });
59772
-
59773
- /**
59774
- * Failsafe remove an element from a collection
59775
- *
59776
- * @param {Array<Object>} [collection]
59777
- * @param {Object} [element]
59778
- *
59779
- * @return {number} the previous index of the element
59780
- */
59781
- function remove$3(collection, element) {
59782
-
59783
- if (!collection || !element) {
59784
- return -1;
59785
- }
59786
-
59787
- var idx = collection.indexOf(element);
59788
-
59789
- if (idx !== -1) {
59790
- collection.splice(idx, 1);
59791
- }
59792
-
59793
- return idx;
59794
- }
59795
-
59796
- /**
59797
- * Fail save add an element to the given connection, ensuring
59798
- * it does not yet exist.
59799
- *
59800
- * @param {Array<Object>} collection
59801
- * @param {Object} element
59802
- * @param {number} idx
59803
- */
59804
- function add$2(collection, element, idx) {
59805
-
59806
- if (!collection || !element) {
59807
- return;
59808
- }
59809
-
59810
- if (typeof idx !== 'number') {
59811
- idx = -1;
59812
- }
59813
-
59814
- var currentIdx = collection.indexOf(element);
59815
-
59816
- if (currentIdx !== -1) {
59817
-
59818
- if (currentIdx === idx) {
59819
-
59820
- // nothing to do, position has not changed
59821
- return;
59822
- } else {
59823
-
59824
- if (idx !== -1) {
59825
-
59826
- // remove from current position
59827
- collection.splice(currentIdx, 1);
59828
- } else {
59829
-
59830
- // already exists in collection
59831
- return;
59832
- }
59833
- }
59834
- }
59835
-
59836
- if (idx !== -1) {
59837
-
59838
- // insert at specified position
59839
- collection.splice(idx, 0, element);
59840
- } else {
59841
-
59842
- // push to end
59843
- collection.push(element);
59844
- }
59845
- }
59846
-
59847
-
59848
- /**
59849
- * Fail save get the index of an element in a collection.
59850
- *
59851
- * @param {Array<Object>} collection
59852
- * @param {Object} element
59853
- *
59854
- * @return {number} the index or -1 if collection or element do
59855
- * not exist or the element is not contained.
59856
- */
59857
- function indexOf$2(collection, element) {
59858
-
59859
- if (!collection || !element) {
59860
- return -1;
59861
- }
59862
-
59863
- return collection.indexOf(element);
59864
- }
59865
-
59866
- var Collections = /*#__PURE__*/Object.freeze({
59867
- __proto__: null,
59868
- remove: remove$3,
59869
- add: add$2,
59870
- indexOf: indexOf$2
59871
- });
59872
-
59873
- /**
59874
- * Remove from the beginning of a collection until it is empty.
59875
- *
59876
- * This is a null-safe operation that ensures elements
59877
- * are being removed from the given collection until the
59878
- * collection is empty.
59879
- *
59880
- * The implementation deals with the fact that a remove operation
59881
- * may touch, i.e. remove multiple elements in the collection
59882
- * at a time.
59883
- *
59884
- * @param {Array<Object>} [collection]
59885
- * @param {Function} removeFn
59886
- *
59887
- * @return {Array<Object>} the cleared collection
59888
- */
59889
- function saveClear$1(collection, removeFn) {
59890
-
59891
- if (typeof removeFn !== 'function') {
59892
- throw new Error('removeFn iterator must be a function');
59893
- }
59894
-
59895
- if (!collection) {
59896
- return;
59897
- }
59898
-
59899
- var e;
59900
-
59901
- while ((e = collection[0])) {
59902
- removeFn(e);
59903
- }
59904
-
59905
- return collection;
59906
- }
59907
-
59908
- /**
59909
- * Returns the surrounding bbox for all elements in
59910
- * the array or the element primitive.
59911
- *
59912
- * @param {Array<djs.model.Shape>|djs.model.Shape} elements
59913
- * @param {boolean} stopRecursion
59914
- */
59915
- function getBBox$1(elements, stopRecursion) {
59916
-
59917
- stopRecursion = !!stopRecursion;
59918
- if (!isArray(elements)) {
59919
- elements = [elements];
59920
- }
59921
-
59922
- var minX,
59923
- minY,
59924
- maxX,
59925
- maxY;
59926
-
59927
- forEach(elements, function(element) {
59928
-
59929
- // If element is a connection the bbox must be computed first
59930
- var bbox = element;
59931
- if (element.waypoints && !stopRecursion) {
59932
- bbox = getBBox$1(element.waypoints, true);
59933
- }
59934
-
59935
- var x = bbox.x,
59936
- y = bbox.y,
59937
- height = bbox.height || 0,
59938
- width = bbox.width || 0;
59939
-
59940
- if (x < minX || minX === undefined) {
59941
- minX = x;
59942
- }
59943
- if (y < minY || minY === undefined) {
59944
- minY = y;
59945
- }
59946
-
59947
- if ((x + width) > maxX || maxX === undefined) {
59948
- maxX = x + width;
59949
- }
59950
- if ((y + height) > maxY || maxY === undefined) {
59951
- maxY = y + height;
59952
- }
59953
- });
59954
-
59955
- return {
59956
- x: minX,
59957
- y: minY,
59958
- height: maxY - minY,
59959
- width: maxX - minX
59960
- };
59961
- }
59962
-
59963
- var DEFAULT_CHILD_BOX_PADDING$1 = 20;
59964
-
59965
- function asPadding$1(mayBePadding, defaultValue) {
59966
- if (typeof mayBePadding !== 'undefined') {
59967
- return mayBePadding;
59968
- } else {
59969
- return DEFAULT_CHILD_BOX_PADDING$1;
59970
- }
59971
- }
59972
-
59973
- function addPadding$2(bbox, padding) {
59974
- var left, right, top, bottom;
59975
-
59976
- if (typeof padding === 'object') {
59977
- left = asPadding$1(padding.left);
59978
- right = asPadding$1(padding.right);
59979
- top = asPadding$1(padding.top);
59980
- bottom = asPadding$1(padding.bottom);
59981
- } else {
59982
- left = right = top = bottom = asPadding$1(padding);
59983
- }
59984
-
59985
- return {
59986
- x: bbox.x - left,
59987
- y: bbox.y - top,
59988
- width: bbox.width + left + right,
59989
- height: bbox.height + top + bottom
59990
- };
59991
- }
59992
-
59993
-
59994
- /**
59995
- * Is the given element part of the resize
59996
- * targets min boundary box?
59997
- *
59998
- * This is the default implementation which excludes
59999
- * connections and labels.
60000
- *
60001
- * @param {djs.model.Base} element
60002
- */
60003
- function isBBoxChild$1(element) {
60004
-
60005
- // exclude connections
60006
- if (element.waypoints) {
60007
- return false;
60008
- }
60009
-
60010
- // exclude labels
60011
- if (element.type === 'label') {
60012
- return false;
60013
- }
60014
-
60015
- return true;
60016
- }
60017
-
60018
- /**
60019
- * Return children bounding computed from a shapes children
60020
- * or a list of prefiltered children.
60021
- *
60022
- * @param {djs.model.Shape|Array<djs.model.Shape>} shapeOrChildren
60023
- * @param {number|Object} padding
60024
- *
60025
- * @return {Bounds}
60026
- */
60027
- function computeChildrenBBox$1(shapeOrChildren, padding) {
60028
-
60029
- var elements;
60030
-
60031
- // compute based on shape
60032
- if (shapeOrChildren.length === undefined) {
60033
-
60034
- // grab all the children that are part of the
60035
- // parents children box
60036
- elements = filter(shapeOrChildren.children, isBBoxChild$1);
60037
-
60038
- } else {
60039
- elements = shapeOrChildren;
60040
- }
60041
-
60042
- if (elements.length) {
60043
- return addPadding$2(getBBox$1(elements), padding);
60044
- }
60045
- }
60046
-
60047
59112
  /**
60048
59113
  * Similar to the bpmn-js/lib/import/Importer we emit
60049
59114
  * import life-cycle events:
@@ -60166,7 +59231,7 @@
60166
59231
 
60167
59232
  var visibleElements = filterVisible$1(subProcess.children);
60168
59233
 
60169
- var visibleBBox = computeChildrenBBox$1(visibleElements);
59234
+ var visibleBBox = computeChildrenBBox(visibleElements);
60170
59235
 
60171
59236
  var visibleBBoxMid = {
60172
59237
  x: visibleBBox.x + visibleBBox.width / 2,
@@ -60192,7 +59257,7 @@
60192
59257
  var self = this;
60193
59258
 
60194
59259
  function deleteElements(elements) {
60195
- saveClear$1(elements, function(element) {
59260
+ saveClear(elements, function(element) {
60196
59261
  deleteElement(element);
60197
59262
  });
60198
59263
  }
@@ -60270,12 +59335,12 @@
60270
59335
 
60271
59336
  // (1) add to target plane
60272
59337
  sourcePlaneElements.forEach(function(sourcePlaneElement) {
60273
- add$2(targetPlaneElements, sourcePlaneElement);
59338
+ add$1(targetPlaneElements, sourcePlaneElement);
60274
59339
  });
60275
59340
 
60276
59341
  // (2) remove from source plane
60277
59342
  sourcePlaneElements.slice().forEach(function(sourcePlaneElement) {
60278
- remove$3(sourceDiagram.plane.planeElement, sourcePlaneElement);
59343
+ remove$2(sourceDiagram.plane.planeElement, sourcePlaneElement);
60279
59344
 
60280
59345
  sourcePlaneElement.$parent = targetDiagram.plane;
60281
59346
  });
@@ -60316,7 +59381,7 @@
60316
59381
  var self = this;
60317
59382
 
60318
59383
  function deleteElements(elements) {
60319
- saveClear$1(elements, function(element) {
59384
+ saveClear(elements, function(element) {
60320
59385
  deleteElement(element);
60321
59386
  });
60322
59387
  }
@@ -60353,7 +59418,7 @@
60353
59418
  var definitions = this._bpmnjs.getDefinitions(),
60354
59419
  diagrams = definitions.diagrams;
60355
59420
 
60356
- add$2(diagrams, targetDiagram);
59421
+ add$1(diagrams, targetDiagram);
60357
59422
  }
60358
59423
 
60359
59424
  var sourceDiagram = this.findDiagram(this._canvas.getRootElement().id);
@@ -60417,7 +59482,7 @@
60417
59482
  var definitions = this._bpmnjs.getDefinitions(),
60418
59483
  diagrams = definitions.diagrams;
60419
59484
 
60420
- remove$3(diagrams, subProcessDiagram);
59485
+ remove$2(diagrams, subProcessDiagram);
60421
59486
  }
60422
59487
 
60423
59488
  // (4) try to import
@@ -60477,12 +59542,12 @@
60477
59542
 
60478
59543
  // (1) add to target plane
60479
59544
  sourcePlaneElements.forEach(function(sourcePlaneElement) {
60480
- add$2(targetPlaneElements, sourcePlaneElement);
59545
+ add$1(targetPlaneElements, sourcePlaneElement);
60481
59546
  });
60482
59547
 
60483
59548
  // (2) remove from source plane
60484
59549
  sourcePlaneElements.slice().forEach(function(sourcePlaneElement) {
60485
- remove$3(sourceDiagram.plane.planeElement, sourcePlaneElement);
59550
+ remove$2(sourceDiagram.plane.planeElement, sourcePlaneElement);
60486
59551
 
60487
59552
  sourcePlaneElement.$parent = targetDiagram.plane;
60488
59553
  });
@@ -60503,7 +59568,7 @@
60503
59568
  const HIGH_PRIORITY$k = 2000;
60504
59569
 
60505
59570
 
60506
- class SignavioBehavior extends CommandInterceptor$1 {
59571
+ class SignavioBehavior extends CommandInterceptor {
60507
59572
 
60508
59573
  constructor(
60509
59574
  bpmnjs, bpmnImporter, canvas,
@@ -64354,42 +63419,6 @@
64354
63419
  __init__: [ CommandInitializer ]
64355
63420
  };
64356
63421
 
64357
- /**
64358
- * A simple translation stub to be used for multi-language support
64359
- * in diagrams. Can be easily replaced with a more sophisticated
64360
- * solution.
64361
- *
64362
- * @example
64363
- *
64364
- * // use it inside any diagram component by injecting `translate`.
64365
- *
64366
- * function MyService(translate) {
64367
- * alert(translate('HELLO {you}', { you: 'You!' }));
64368
- * }
64369
- *
64370
- * @param {string} template to interpolate
64371
- * @param {Object} [replacements] a map with substitutes
64372
- *
64373
- * @return {string} the translated string
64374
- */
64375
- function translate$3(template, replacements) {
64376
-
64377
- replacements = replacements || {};
64378
-
64379
- return template.replace(/{([^}]+)}/g, function(_, key) {
64380
- return replacements[key] || '{' + key + '}';
64381
- });
64382
- }
64383
-
64384
- var translate$4 = {
64385
- translate: [ 'value', translate$3 ]
64386
- };
64387
-
64388
- var translate$5 = /*#__PURE__*/Object.freeze({
64389
- __proto__: null,
64390
- 'default': translate$4
64391
- });
64392
-
64393
63422
  var require$$0$1 = /*@__PURE__*/getAugmentedNamespace(index_esm$2);
64394
63423
 
64395
63424
  var require$$2 = /*@__PURE__*/getAugmentedNamespace(index_esm);
@@ -66698,7 +65727,7 @@
66698
65727
  var HIDE_CLASS = 'bpp-hidden';
66699
65728
  var DEBOUNCE_DELAY = 300;
66700
65729
 
66701
- var DEFAULT_PRIORITY$7 = 1000;
65730
+ var DEFAULT_PRIORITY$6 = 1000;
66702
65731
 
66703
65732
  function isToggle(node) {
66704
65733
  return node.type === 'checkbox' || node.type === 'radio';
@@ -66926,7 +65955,7 @@
66926
65955
 
66927
65956
  if (!provider) {
66928
65957
  provider = priority;
66929
- priority = DEFAULT_PRIORITY$7;
65958
+ priority = DEFAULT_PRIORITY$6;
66930
65959
  }
66931
65960
 
66932
65961
  if (typeof provider.getTabs !== 'function') {
@@ -68051,7 +67080,7 @@
68051
67080
  return string.replace(/\r\n|\r|\n/g, '\n');
68052
67081
  }
68053
67082
 
68054
- var require$$1 = /*@__PURE__*/getAugmentedNamespace(translate$5);
67083
+ var require$$1 = /*@__PURE__*/getAugmentedNamespace(translate$3);
68055
67084
 
68056
67085
  var lib = {
68057
67086
  __depends__: [
@@ -68064,7 +67093,7 @@
68064
67093
 
68065
67094
  var bpmnJsPropertiesPanel = lib;
68066
67095
 
68067
- var DEFAULT_PRIORITY$8 = 1000;
67096
+ var DEFAULT_PRIORITY$7 = 1000;
68068
67097
 
68069
67098
 
68070
67099
  /**
@@ -68085,7 +67114,7 @@
68085
67114
  function PropertiesActivator(eventBus, priority) {
68086
67115
  var self = this;
68087
67116
 
68088
- priority = priority || DEFAULT_PRIORITY$8;
67117
+ priority = priority || DEFAULT_PRIORITY$7;
68089
67118
 
68090
67119
  eventBus.on('propertiesPanel.isEntryVisible', priority, function(context) {
68091
67120
  var element = context.element,
@@ -73040,78 +72069,252 @@
73040
72069
  Modeler$1.prototype._extensionModules
73041
72070
  );
73042
72071
 
73043
- const HIGH_PRIORITY$l = 15000;
72072
+ const HIGH_PRIORITY$l = 5000;
72073
+
73044
72074
 
73045
72075
  /**
73046
- * BPMN specific create zeebe boundary event behavior
72076
+ * Zeebe BPMN behavior for ensuring that there are not empty (ie. without properties)
72077
+ * zeebe:assignmentDefinitions after modeling operations. Will also remove related
72078
+ * extensionElements, if they remain empty afterwards (could be a seperate
72079
+ * behavior in the future, if needed)
73047
72080
  */
73048
- function CreateZeebeBoundaryEventBehavior(
73049
- eventBus, elementFactory, bpmnFactory) {
72081
+ class CleanUpBusinessRuleTaskBehavior extends CommandInterceptor {
72082
+ constructor(eventBus, modeling) {
72083
+ super(eventBus);
73050
72084
 
73051
- CommandInterceptor$1.call(this, eventBus);
72085
+ /**
72086
+ * Remove zeebe:assignmentDefinition when it has no defined properties left after the operation
72087
+ */
72088
+ this.postExecuted([
72089
+ 'properties-panel.update-businessobject',
72090
+ 'element.updateModdleProperties'
72091
+ ] , HIGH_PRIORITY$l, function(context) {
72092
+ const {
72093
+ element,
72094
+ businessObject,
72095
+ moddleElement
72096
+ } = context;
73052
72097
 
73053
- /**
73054
- * replace intermediate catch event with boundary event when
73055
- * attaching it to a shape
73056
- */
73057
- this.preExecute('shape.create', HIGH_PRIORITY$l, function(context) {
73058
- const {
73059
- shape,
73060
- host
73061
- } = context;
72098
+ // (1) harmonize property names from commands
72099
+ const assignmentDefintion = businessObject || moddleElement;
73062
72100
 
73063
- const businessObject = getBusinessObject(shape);
72101
+ if (
72102
+ is$1(element, 'bpmn:UserTask')
72103
+ && assignmentDefintion
72104
+ && is$1(assignmentDefintion, 'zeebe:AssignmentDefinition')
72105
+ && assignmentDefintion.assignee === undefined
72106
+ && assignmentDefintion.candidateGroups === undefined
72107
+ ) {
72108
+ const extensionElements = getBusinessObject(element).extensionElements;
73064
72109
 
73065
- let attrs = {
73066
- cancelActivity: true
73067
- };
72110
+ // (2) remove zeebe:assignmentDefintion
72111
+ removeFromExtensionElements(element, extensionElements, modeling,
72112
+ (ele) => !is$1(ele, 'zeebe:AssignmentDefinition'));
73068
72113
 
73069
- let newBusinessObject,
73070
- hostBusinessObject,
73071
- boundaryEvent,
73072
- eventDefinitions;
72114
+ // (3) if extensionElements are empty afterwards, remove them as well
72115
+ if (extensionElements.values.length === 0) {
72116
+ modeling.updateModdleProperties(element, getBusinessObject(element),
72117
+ { extensionElements: undefined });
72118
+ }
72119
+ }
72120
+ }, true);
73073
72121
 
73074
- if (!host || !is$1(shape, 'bpmn:IntermediateCatchEvent')) {
73075
- return;
73076
- }
72122
+ }
72123
+ }
73077
72124
 
73078
- hostBusinessObject = getBusinessObject(host);
72125
+ CleanUpBusinessRuleTaskBehavior.$inject = [
72126
+ 'eventBus',
72127
+ 'modeling'
72128
+ ];
73079
72129
 
73080
- attrs = {
73081
- attachedToRef: hostBusinessObject,
73082
- ...attrs
73083
- };
73084
72130
 
73085
- eventDefinitions = businessObject.eventDefinitions;
72131
+ // helper ////////////////////
73086
72132
 
73087
- newBusinessObject = bpmnFactory.create('bpmn:BoundaryEvent', attrs);
72133
+ function removeFromExtensionElements(element, extensionElements, modeling, filterFun) {
72134
+ const values = extensionElements.get('values').filter(filterFun);
73088
72135
 
73089
- boundaryEvent = {
73090
- type: 'bpmn:BoundaryEvent',
73091
- businessObject: newBusinessObject,
73092
- };
72136
+ modeling.updateModdleProperties(element, extensionElements, {
72137
+ values
72138
+ });
72139
+ }
72140
+
72141
+ const HIGH_PRIORITY$m = 5000;
72142
+
72143
+
72144
+ /**
72145
+ * Zeebe BPMN behavior for ensuring that a BusinessRuleTask:
72146
+ * 1) Either has a taskDefinition ExtensionElement OR
72147
+ * 2) Or has a calledDecision ExtensionElement
72148
+ * 2.1) If it has a calledDecision ExtensionElement, it shall not have taskHeaders
72149
+ */
72150
+ class CleanUpBusinessRuleTaskBehavior$1 extends CommandInterceptor {
72151
+ constructor(eventBus, modeling) {
72152
+ super(eventBus);
72153
+
72154
+ /**
72155
+ * Remove zeebe:calledDecision when zeebe:taskDefinition is added
72156
+ */
72157
+ this.postExecute([
72158
+ 'properties-panel.update-businessobject-list',
72159
+ 'element.updateModdleProperties'
72160
+ ] , HIGH_PRIORITY$m, function(context) {
72161
+ const {
72162
+ element,
72163
+ currentObject,
72164
+ objectsToAdd,
72165
+ moddleElement,
72166
+ properties
72167
+ } = context;
72168
+
72169
+ // (1) map properties from both commands
72170
+ const extensionElement = currentObject || moddleElement,
72171
+ newValues = objectsToAdd || (properties && properties.values);
72172
+
72173
+ // (2) check conditions and potentially update
72174
+ if (
72175
+ is$1(element, 'bpmn:BusinessRuleTask')
72176
+ && extensionElement
72177
+ && is$1(extensionElement, 'bpmn:ExtensionElements')
72178
+ && extensionElement.get('values').some((ele) => is$1(ele, 'zeebe:CalledDecision'))
72179
+ && newValues
72180
+ && newValues.some((ele) => is$1(ele, 'zeebe:TaskDefinition'))
72181
+ ) {
72182
+ removeCalledDecision(element, extensionElement, modeling);
72183
+ }
72184
+ }, true);
72185
+
72186
+ /**
72187
+ * Remove zeebe:taskDefinition and zeebe:taskHeaders when zeebe:calledDecision
72188
+ */
72189
+ this.postExecute([
72190
+ 'properties-panel.update-businessobject-list',
72191
+ 'element.updateModdleProperties'
72192
+ ] , HIGH_PRIORITY$m, function(context) {
72193
+ const {
72194
+ element,
72195
+ currentObject,
72196
+ objectsToAdd,
72197
+ moddleElement,
72198
+ properties
72199
+ } = context;
72200
+
72201
+ // (1) map properties from both commands
72202
+ const extensionElement = currentObject || moddleElement,
72203
+ newValues = objectsToAdd || (properties && properties.values);
72204
+
72205
+ // (2) check conditions and potentially update
72206
+ if (
72207
+ is$1(element, 'bpmn:BusinessRuleTask')
72208
+ && extensionElement
72209
+ && is$1(extensionElement, 'bpmn:ExtensionElements')
72210
+ && extensionElement.get('values').some(
72211
+ (ele) => is$1(ele, 'zeebe:TaskDefinition') || is$1(ele, 'zeebe:TaskHeaders'))
72212
+ && newValues
72213
+ && newValues.some((ele) => is$1(ele, 'zeebe:CalledDecision'))
72214
+ ) {
72215
+ removeTaskDefintionAndHeaders(element, extensionElement, modeling);
72216
+ }
72217
+ }, true);
72218
+
72219
+ }
72220
+ }
72221
+
72222
+ CleanUpBusinessRuleTaskBehavior$1.$inject = [
72223
+ 'eventBus',
72224
+ 'modeling'
72225
+ ];
72226
+
72227
+
72228
+ // helper ////////////////////
72229
+
72230
+ function removeFromExtensionElements$1(element, extensionElements, modeling, filterFun) {
72231
+ const values = extensionElements.get('values').filter(filterFun);
72232
+
72233
+ modeling.updateModdleProperties(element, extensionElements, {
72234
+ values
72235
+ });
72236
+ }
72237
+
72238
+ function removeCalledDecision(element, extensionElements, modeling) {
72239
+ removeFromExtensionElements$1(element, extensionElements, modeling,
72240
+ (ele) => !is$1(ele, 'zeebe:CalledDecision'));
72241
+ }
72242
+
72243
+ function removeTaskDefintionAndHeaders(element, extensionElements, modeling) {
72244
+ removeFromExtensionElements$1(element, extensionElements, modeling,
72245
+ (ele) => !is$1(ele, 'zeebe:TaskDefinition') && !is$1(ele, 'zeebe:TaskHeaders'));
72246
+ }
72247
+
72248
+ const HIGH_PRIORITY$n = 5000;
72249
+
72250
+
72251
+ /**
72252
+ * Zeebe BPMN specific behavior for creating boundary events.
72253
+ */
72254
+ class CreateZeebeBoundaryEventBehavior extends CommandInterceptor {
72255
+ constructor(bpmnFactory, elementFactory, eventBus) {
72256
+ super(eventBus);
72257
+
72258
+ /**
72259
+ * Replace intermediate catch event with boundary event when attaching it to a shape.
72260
+ */
72261
+ this.preExecute('shape.create', HIGH_PRIORITY$n, function(context) {
72262
+ const {
72263
+ shape,
72264
+ host
72265
+ } = context;
72266
+
72267
+ const businessObject = getBusinessObject(shape);
72268
+
72269
+ let attrs = {
72270
+ cancelActivity: true
72271
+ };
72272
+
72273
+ let newBusinessObject,
72274
+ hostBusinessObject,
72275
+ boundaryEvent,
72276
+ eventDefinitions;
72277
+
72278
+ if (!host || !is$1(shape, 'bpmn:IntermediateCatchEvent')) {
72279
+ return;
72280
+ }
72281
+
72282
+ hostBusinessObject = getBusinessObject(host);
72283
+
72284
+ attrs = {
72285
+ ...attrs,
72286
+ attachedToRef: hostBusinessObject
72287
+ };
72288
+
72289
+ eventDefinitions = businessObject.eventDefinitions;
72290
+
72291
+ newBusinessObject = bpmnFactory.create('bpmn:BoundaryEvent', attrs);
73093
72292
 
73094
- if (eventDefinitions && eventDefinitions[0]) {
73095
72293
  boundaryEvent = {
73096
- ...boundaryEvent,
73097
- eventDefinitionType: eventDefinitions[0].$type
72294
+ type: 'bpmn:BoundaryEvent',
72295
+ businessObject: newBusinessObject,
73098
72296
  };
73099
- }
73100
72297
 
73101
- context.shape = elementFactory.createShape(boundaryEvent);
72298
+ if (eventDefinitions && eventDefinitions[0]) {
72299
+ boundaryEvent = {
72300
+ ...boundaryEvent,
72301
+ eventDefinitionType: eventDefinitions[0].$type
72302
+ };
72303
+ }
73102
72304
 
73103
- }, true);
73104
- }
72305
+ context.shape = elementFactory.createShape(boundaryEvent);
72306
+
72307
+ }, true);
73105
72308
 
72309
+ }
72310
+ }
73106
72311
 
73107
72312
  CreateZeebeBoundaryEventBehavior.$inject = [
73108
- 'eventBus',
72313
+ 'bpmnFactory',
73109
72314
  'elementFactory',
73110
- 'bpmnFactory'
72315
+ 'eventBus'
73111
72316
  ];
73112
72317
 
73113
- inherits_browser(CreateZeebeBoundaryEventBehavior, CommandInterceptor$1);
73114
-
73115
72318
  function isZeebeServiceTask(element) {
73116
72319
  if (!is$1(element, 'zeebe:ZeebeServiceTask')) return false;
73117
72320
 
@@ -73122,6 +72325,113 @@
73122
72325
  return true;
73123
72326
  }
73124
72327
 
72328
+ /**
72329
+ * Get zeebe:IoMapping from an element.
72330
+ *
72331
+ * @param {djs.model.Base|ModdleElement} element
72332
+ *
72333
+ * @return {ModdleElement}
72334
+ */
72335
+ function getIoMapping(element) {
72336
+ const businessObject = getBusinessObject(element);
72337
+
72338
+ const extensionElements = businessObject.get('extensionElements');
72339
+
72340
+ if (!extensionElements) {
72341
+ return;
72342
+ }
72343
+
72344
+ return extensionElements.get('values').find((value) => {
72345
+ return is$1(value, 'zeebe:IoMapping');
72346
+ });
72347
+ }
72348
+
72349
+ /**
72350
+ * Get zeebe:InputParameters from an element.
72351
+ *
72352
+ * @param {djs.model.Base|ModdleElement} element
72353
+ *
72354
+ * @return {Array<ModdleElement>}
72355
+ */
72356
+ function getInputParameters(element) {
72357
+ const ioMapping = getIoMapping(element);
72358
+
72359
+ if (ioMapping) {
72360
+ return ioMapping.get('zeebe:inputParameters');
72361
+ }
72362
+
72363
+ return [];
72364
+ }
72365
+
72366
+ /**
72367
+ * Get zeebe:OutputParameters from an element.
72368
+ *
72369
+ * @param {djs.model.Base|ModdleElement} element
72370
+ *
72371
+ * @return {Array<ModdleElement>}
72372
+ */
72373
+ function getOutputParameters(element) {
72374
+ const ioMapping = getIoMapping(element);
72375
+
72376
+ if (ioMapping) {
72377
+ return ioMapping.get('zeebe:outputParameters');
72378
+ }
72379
+
72380
+ return [];
72381
+ }
72382
+
72383
+ /**
72384
+ * Check whether element supports zeebe:Input or zeebe:Output.
72385
+ *
72386
+ * @param {djs.model.Base|ModdleElement} element
72387
+ *
72388
+ * @return {boolean}
72389
+ */
72390
+ function isInputOutputSupported(element) {
72391
+ return areInputParametersSupported(element) || areOutputParametersSupported(element);
72392
+ }
72393
+
72394
+ /**
72395
+ * Check whether element supports zeebe:Input.
72396
+ *
72397
+ * @param {djs.model.Base|ModdleElement} element
72398
+ *
72399
+ * @return {boolean}
72400
+ */
72401
+ function areInputParametersSupported(element) {
72402
+ return isAny(element, [
72403
+ 'bpmn:CallActivity',
72404
+ 'bpmn:SubProcess',
72405
+ 'bpmn:UserTask'
72406
+ ]) || isZeebeServiceTask(element);
72407
+ }
72408
+
72409
+ /**
72410
+ * Check whether element supports zeebe:Output.
72411
+ *
72412
+ * @param {djs.model.Base|ModdleElement} element
72413
+ *
72414
+ * @return {boolean}
72415
+ */
72416
+ function areOutputParametersSupported(element) {
72417
+ return isAny(element, [
72418
+ 'bpmn:CallActivity',
72419
+ 'bpmn:Event',
72420
+ 'bpmn:ReceiveTask',
72421
+ 'bpmn:SubProcess',
72422
+ 'bpmn:UserTask',
72423
+ 'zeebe:ZeebeServiceTask'
72424
+ ]);
72425
+ }
72426
+
72427
+ function createElement(type, parent, factory, properties) {
72428
+ return ElementHelper_1.createElement(type, properties, parent, factory);
72429
+ }
72430
+
72431
+ function createIoMapping(parent, bpmnFactory, properties) {
72432
+ return createElement('zeebe:IoMapping', parent, bpmnFactory, properties);
72433
+ }
72434
+
73125
72435
  var is$g = require$$0.is;
73126
72436
 
73127
72437
  var ExtensionElementsHelper = {};
@@ -73172,406 +72482,223 @@
73172
72482
 
73173
72483
  var ExtensionElementsHelper_1 = ExtensionElementsHelper;
73174
72484
 
73175
- function getElements(bo, type, prop) {
73176
- const elems = ExtensionElementsHelper_1.getExtensionElements(bo, type);
73177
- return !prop ? elems : (elems[0] || {})[prop] || [];
73178
- }
73179
-
73180
- function getParameters(element, prop) {
73181
- const inputOutput = getInputOutput(element);
73182
- return (inputOutput && inputOutput.get(prop)) || [];
73183
- }
73184
-
73185
- /**
73186
- * Get a inputOutput from the business object
73187
- *
73188
- * @param {djs.model.Base} element
73189
- *
73190
- * @return {ModdleElement} the inputOutput object
73191
- */
73192
- function getInputOutput(element) {
73193
- const bo = getBusinessObject(element);
73194
- return (getElements(bo, 'zeebe:IoMapping') || [])[0];
73195
- }
73196
-
73197
-
73198
- /**
73199
- * Return all input parameters existing in the business object, and
73200
- * an empty array if none exist.
73201
- *
73202
- * @param {djs.model.Base} element
73203
- *
73204
- * @return {Array} a list of input parameter objects
73205
- */
73206
- function getInputParameters(element) {
73207
- return getParameters.apply(this, [ element, 'inputParameters' ]);
73208
- }
73209
-
73210
- /**
73211
- * Return all output parameters existing in the business object, and
73212
- * an empty array if none exist.
73213
- *
73214
- * @param {djs.model.Base} element
73215
- *
73216
- * @return {Array} a list of output parameter objects
73217
- */
73218
- function getOutputParameters(element) {
73219
- return getParameters.apply(this, [ element, 'outputParameters' ]);
73220
- }
73221
-
73222
- /**
73223
- * Returns 'true' if the given element supports inputOutput
73224
- *
73225
- * @param {djs.model.Base} element
73226
- *
73227
- * @return {boolean} a boolean value
73228
- */
73229
- function isInputOutputSupported(element) {
73230
- return areOutputParametersSupported(element) || areInputParametersSupported(element);
73231
- }
73232
-
73233
- /**
73234
- * Returns 'true' if the given element supports input parameters
73235
- *
73236
- * @param {djs.model.Base} element
73237
- *
73238
- * @return {boolean} a boolean value
73239
- */
73240
- function areInputParametersSupported(element) {
73241
- return isAny(element, [
73242
- 'bpmn:UserTask',
73243
- 'bpmn:SubProcess',
73244
- 'bpmn:CallActivity'
73245
- ]) || isZeebeServiceTask(element);
73246
- }
73247
-
73248
- /**
73249
- * Returns 'true' if the given element supports output parameters
73250
- *
73251
- * @param {djs.model.Base} element
73252
- *
73253
- * @return {boolean} a boolean value
73254
- */
73255
- function areOutputParametersSupported(element) {
73256
- return isAny(element, [
73257
- 'zeebe:ZeebeServiceTask',
73258
- 'bpmn:UserTask',
73259
- 'bpmn:SubProcess',
73260
- 'bpmn:ReceiveTask',
73261
- 'bpmn:CallActivity',
73262
- 'bpmn:Event'
73263
- ]);
73264
- }
73265
-
73266
- function createElement(type, parent, factory, properties) {
73267
- return ElementHelper_1.createElement(type, properties, parent, factory);
73268
- }
73269
-
73270
- function createIOMapping(parent, bpmnFactory, properties) {
73271
- return createElement('zeebe:IoMapping', parent, bpmnFactory, properties);
73272
- }
73273
-
73274
72485
  /**
73275
- * Get getter function for IOMapping parameters according to provided property name
72486
+ * Get default value for zeebe:propagateAllChildVariables.
73276
72487
  *
73277
- * @param {string} property
72488
+ * @param {djs.model.Base|ModdleElement} element
73278
72489
  *
73279
- * @returns {Function} Getter function for the IOMapping parameters according to provided property name
72490
+ * @returns {boolean}
73280
72491
  */
73281
- function determineParamGetFunc(property) {
73282
- if (property == 'inputParameters') {
73283
- return getInputParameters;
73284
- }
73285
-
73286
- if (property == 'outputParameters') {
73287
- return getOutputParameters;
72492
+ function getPropagateAllChildVariablesDefault(element) {
72493
+ if (!is$1(element, 'bpmn:CallActivity')) {
72494
+ return;
73288
72495
  }
73289
- }
73290
72496
 
73291
- /**
73292
- * Determine default value for propagateAllChildVariables attribute
73293
- * @param {Object} element representing a bpmn:CallActivity
73294
- *
73295
- * @returns {boolean}
73296
- */
73297
- function determinePropAllChildVariablesDefault(element) {
73298
72497
  const outputParameters = getOutputParameters(element);
73299
72498
 
73300
72499
  if (outputParameters) {
73301
- return (outputParameters.length > 0) ? false : true;
72500
+ return !outputParameters.length;
73302
72501
  }
73303
72502
  }
73304
72503
 
73305
72504
  /**
73306
- * Get the 'zeebe:CalledElement' extension element for a given business Object
73307
- * @param {Object} bo businessObject
73308
- *
73309
- * @returns {Object} the calledElement Moddle Object or undefined if zeebe:CalledElement does not exist
73310
- */
72505
+ * Get zeebe:CalledElement of an element.
72506
+ *
72507
+ * @param {djs.model.Base|ModdleElement} element
72508
+ *
72509
+ * @returns {ModdleElement}
72510
+ */
73311
72511
  function getCalledElement(element) {
73312
72512
  const calledElements = getCalledElements(element);
73313
- return calledElements[0];
72513
+
72514
+ return calledElements[ 0 ];
73314
72515
  }
73315
72516
 
73316
72517
  function getCalledElements(element) {
73317
- const bo = getBusinessObject(element);
73318
- const extElements = ExtensionElementsHelper_1.getExtensionElements(bo, 'zeebe:CalledElement');
73319
- return extElements;
72518
+ const businessObject = getBusinessObject(element);
72519
+
72520
+ return ExtensionElementsHelper_1.getExtensionElements(businessObject, 'zeebe:CalledElement');
73320
72521
  }
73321
72522
 
73322
72523
  /**
73323
- * Check whether the propagateAllChildVariables attribute is set on an element.
73324
- * Note that a default logic will be determine if it is not explicitly set.
73325
- * @param {Object} element
73326
- *
73327
- * @returns {boolean}
73328
- */
72524
+ * Check whether zeebe:propagateAllChildVariables is set on an element.
72525
+ * Fall back to default if zeebe:propagateAllChildVariables not set.
72526
+ *
72527
+ * @param {djs.model.Base|ModdleElement} element
72528
+ *
72529
+ * @returns {boolean}
72530
+ */
73329
72531
  function isPropagateAllChildVariables(element) {
73330
72532
  if (!is$1(element, 'bpmn:CallActivity')) {
73331
- return undefined;
72533
+ return;
73332
72534
  }
73333
72535
 
73334
- const bo = getBusinessObject(element),
73335
- calledElement = getCalledElement(bo);
72536
+ const businessObject = getBusinessObject(element),
72537
+ calledElement = getCalledElement(businessObject);
73336
72538
 
73337
- return calledElement && has(calledElement, 'propagateAllChildVariables') ?
73338
- calledElement.get('propagateAllChildVariables') :
73339
- determinePropAllChildVariablesDefault(element);
72539
+ if (calledElement && has(calledElement, 'propagateAllChildVariables')) {
72540
+ return calledElement.get('propagateAllChildVariables');
72541
+ } else {
72542
+ return getPropagateAllChildVariablesDefault(element);
72543
+ }
73340
72544
  }
73341
72545
 
73342
- const HIGH_PRIORITY$m = 15000;
72546
+ const HIGH_PRIORITY$o = 5000;
72547
+
73343
72548
 
73344
72549
  /**
73345
- * BPMN specific create zeebe call activity behavior
72550
+ * Zeebe BPMN specific behavior for creating call activities.
73346
72551
  */
73347
- function CreateZeebeCallActivityBehavior(
73348
- eventBus, bpmnFactory) {
72552
+ class CreateZeebeCallActivityBehavior extends CommandInterceptor {
72553
+ constructor(bpmnFactory, eventBus, modeling) {
72554
+ super(eventBus);
73349
72555
 
73350
- CommandInterceptor$1.call(this, eventBus);
72556
+ /**
72557
+ * Add zeebe:CalledElement extension element with zeebe:propagateAllChildVariables attribute = false
72558
+ * when creating bpmn:CallActivity.
72559
+ */
72560
+ this.postExecuted('shape.create', HIGH_PRIORITY$o, function(context) {
72561
+ const { shape } = context;
73351
72562
 
73352
- /**
73353
- * add a zeebe:calledElement extensionElement with
73354
- * propagateAllChildVariables attribute = false when creating
73355
- * a bpmn:callActivity
73356
- */
73357
- this.postExecuted('shape.create', HIGH_PRIORITY$m, function(context) {
73358
- const {
73359
- shape
73360
- } = context;
72563
+ if (!is$1(shape, 'bpmn:CallActivity')) {
72564
+ return;
72565
+ }
73361
72566
 
73362
- if (!is$1(shape, 'bpmn:CallActivity')) {
73363
- return;
73364
- }
72567
+ const businessObject = getBusinessObject(shape);
73365
72568
 
73366
- const bo = getBusinessObject(shape);
72569
+ let calledElement = getCalledElement(businessObject);
73367
72570
 
73368
- // Reuse ExtensionElement if existing
73369
- const extensionElements = bo.get('extensionElements') ||
73370
- ElementHelper_1.createElement('bpmn:ExtensionElements', { values: [] }, bo, bpmnFactory);
72571
+ if (!calledElement) {
72572
+ calledElement = bpmnFactory.create('zeebe:CalledElement', {
72573
+ propagateAllChildVariables: false
72574
+ });
73371
72575
 
73372
- // Ensure we have a calledElement
73373
- let calledElement = getCalledElement(bo);
72576
+ let extensionElements = businessObject.get('extensionElements');
73374
72577
 
73375
- if (!calledElement) {
73376
- calledElement = bpmnFactory.create('zeebe:CalledElement', {});
73377
- calledElement.propagateAllChildVariables = false;
72578
+ if (!extensionElements) {
72579
+ extensionElements = ElementHelper_1.createElement('bpmn:ExtensionElements', { values: [] }, businessObject, bpmnFactory);
73378
72580
 
73379
- extensionElements.get('values').push(
73380
- calledElement
73381
- );
72581
+ modeling.updateProperties(shape, { extensionElements });
72582
+ }
73382
72583
 
73383
- bo.extensionElements = extensionElements;
72584
+ modeling.updateModdleProperties(shape, extensionElements, {
72585
+ values: [
72586
+ ...(extensionElements.values || []),
72587
+ calledElement
72588
+ ]
72589
+ });
72590
+ } else if (!has(calledElement, 'propagateAllChildVariables')) {
73384
72591
 
73385
- // Handle existing callActivities
73386
- } else if (!has(calledElement, 'propagateAllChildVariables')) {
73387
- calledElement.propagateAllChildVariables = false;
73388
- }
72592
+ // if zeebe:CalledElement exist set zeebe:propagateAllChildVariables to false
72593
+ modeling.updateModdleProperties(shape, calledElement, {
72594
+ propagateAllChildVariables: false
72595
+ });
72596
+ }
72597
+ }, true);
73389
72598
 
73390
- }, true);
72599
+ }
73391
72600
  }
73392
72601
 
73393
-
73394
72602
  CreateZeebeCallActivityBehavior.$inject = [
72603
+ 'bpmnFactory',
73395
72604
  'eventBus',
73396
- 'bpmnFactory'
72605
+ 'modeling'
73397
72606
  ];
73398
72607
 
73399
- inherits_browser(CreateZeebeCallActivityBehavior, CommandInterceptor$1);
73400
-
73401
- const HIGH_PRIORITY$n = 15000;
72608
+ const HIGH_PRIORITY$p = 5000;
73402
72609
 
73403
72610
 
73404
72611
  /**
73405
- * UpdatePropagateAllChildVariablesBehavior reacts to either (1) toggling on propagateAllChildVariables
73406
- * when there are outputParameters present or (2) to adding outputParameters when
73407
- * propagateAllChildVariables is set to true.
73408
- * It will ensure that the propagateAllChildVariables attribute on calledElement
73409
- * extensionElements for callActivities is always consistent with outputParameter mappings
72612
+ * Zeebe BPMN behavior for updating zeebe:propagateAllChildVariables.
73410
72613
  */
73411
- function UpdatePropagateAllChildVariablesBehavior(
73412
- eventBus) {
73413
-
73414
- CommandInterceptor$1.call(this, eventBus);
73415
-
73416
- // Behavior when toggling propagateAllChildVariables /////////////////////////
73417
- /**
73418
- * remove outputParameters from zeebe:IoMapping when setting propgateAlLChildVariables
73419
- * to true in the proeprties panel
73420
- */
73421
- this.executed('properties-panel.update-businessobject' , HIGH_PRIORITY$n, function(context) {
73422
- const {
73423
- element,
73424
- properties
73425
- } = context;
73426
-
73427
- // (1) Don't execute this behavior if we are not in a call activity or not
73428
- // have properties to update or not update the propagateAllChildVariables
73429
- // to false
73430
- if (!is$1(element, 'bpmn:CallActivity') ||
73431
- !properties ||
73432
- !!properties.propagateAllChildVariables === false) {
73433
- return;
73434
- }
73435
-
73436
- // (2) Check whether we have outputParameters
73437
- const outputParameters = getOutputParameters(element),
73438
- inputParameters = getInputParameters(element);
73439
-
73440
- if (!outputParameters ||
73441
- outputParameters.length === 0) {
73442
- return;
73443
- }
73444
-
73445
- // (3) Store old outputParameters and remove them
73446
- context.oldOutputParameters = outputParameters;
73447
-
73448
- const inputOutput = getInputOutput(element);
73449
- inputOutput.outputParameters = [];
73450
-
73451
- // (4) if we also have no inputParameters, store IOMapping and remove it
73452
- if (!inputParameters || inputParameters.length === 0) {
73453
- const extensionElements = getBusinessObject(element).extensionElements;
73454
- context.oldExtensionElements = extensionElements.values;
73455
-
73456
- extensionElements.values = extensionElements.values.filter(ele => ele.$type !== 'zeebe:IoMapping');
73457
- }
73458
- }, true);
73459
-
73460
- // Revert behavior when toggling propagateAllChildVariables //////////////////
73461
- this.reverted('properties-panel.update-businessobject', HIGH_PRIORITY$n, function(context) {
73462
- const {
73463
- element,
73464
- oldOutputParameters,
73465
- oldExtensionElements
73466
- } = context;
73467
-
73468
- // (1) Only intercept the revert, if the behavior became active
73469
- if (oldOutputParameters) {
72614
+ class UpdatePropagateAllChildVariablesBehavior extends CommandInterceptor {
72615
+ constructor(eventBus, modeling) {
72616
+ super(eventBus);
73470
72617
 
73471
- // (2) If we removed the IOMapping, bring it back first
73472
- if (oldExtensionElements) {
73473
- const extensionElements = getBusinessObject(element).extensionElements;
72618
+ /**
72619
+ * Remove zeebe:OutputParameters when zeebe:propagateAllChildVariables is set to true.
72620
+ */
72621
+ this.postExecute('properties-panel.update-businessobject' , HIGH_PRIORITY$p, function(context) {
72622
+ const {
72623
+ element,
72624
+ properties
72625
+ } = context;
73474
72626
 
73475
- extensionElements.values = oldExtensionElements;
72627
+ if (
72628
+ !is$1(element, 'bpmn:CallActivity')
72629
+ || !properties
72630
+ || !!properties.propagateAllChildVariables === false
72631
+ ) {
72632
+ return;
73476
72633
  }
73477
72634
 
73478
- // (3) Bring back the outputParameters
73479
- const inputOutput = getInputOutput(element);
73480
- inputOutput.outputParameters = oldOutputParameters;
73481
- }
73482
- }, true);
73483
-
72635
+ const inputParameters = getInputParameters(element),
72636
+ outputParameters = getOutputParameters(element);
73484
72637
 
73485
- // Behavior when adding outputParameters ////////////////////////////////////
73486
- /**
73487
- * un-toggle propgateAlLChildVariables when adding output parameters
73488
- */
73489
- this.executed('properties-panel.update-businessobject-list' , HIGH_PRIORITY$n, function(context) {
73490
- const {
73491
- element,
73492
- objectsToAdd
73493
- } = context;
72638
+ if (!outputParameters || !outputParameters.length) {
72639
+ return;
72640
+ }
73494
72641
 
72642
+ const ioMapping = getIoMapping(element);
73495
72643
 
73496
- // (1) Exit if we are not in a CallActivity, not adding an OutputParameter or not
73497
- // having set propagateAllChildVariables to false
73498
- if (!is$1(element, 'bpmn:CallActivity') ||
73499
- !objectsToAdd ||
73500
- objectsToAdd.length === 0 ||
73501
- objectsToAdd.filter(obj => is$1(obj, 'zeebe:Output')).length === 0 ||
73502
- isPropagateAllChildVariables(element) === false) {
73503
- return;
73504
- }
72644
+ modeling.updateModdleProperties(element, ioMapping, {
72645
+ 'zeebe:outputParameters': []
72646
+ });
73505
72647
 
73506
- // (2) Store the old propAllChildVariables value and update it then
73507
- const bo = getBusinessObject(element),
73508
- calledElement = getCalledElement(bo);
72648
+ if (!inputParameters || !inputParameters.length) {
72649
+ const businessObject = getBusinessObject(element),
72650
+ extensionElements = businessObject.get('extensionElements');
73509
72651
 
73510
- context.oldPropagateAllChildVariables = true;
72652
+ const values = extensionElements.get('values').filter((element) => {
72653
+ return !is$1(element, 'zeebe:IoMapping');
72654
+ });
73511
72655
 
73512
- calledElement.propagateAllChildVariables = false;
73513
- }, true);
72656
+ modeling.updateModdleProperties(element, extensionElements, {
72657
+ values
72658
+ });
72659
+ }
72660
+ }, true);
73514
72661
 
73515
- // Revert behavior when adding outputParmaeters ////////////////////////////////////
73516
- this.reverted('properties-panel.update-businessobject-list' , HIGH_PRIORITY$n, function(context) {
73517
- const {
73518
- element,
73519
- oldPropagateAllChildVariables
73520
- } = context;
73521
72662
 
73522
- // (1) Only intercept the revert, if the behavior became active
73523
- if (oldPropagateAllChildVariables) {
73524
- const bo = getBusinessObject(element),
73525
- calledElement = getCalledElement(bo);
72663
+ /**
72664
+ * Set zeebe:propagateAllChildVariables to false on zeebe:Output added.
72665
+ */
72666
+ this.postExecute('properties-panel.update-businessobject-list' , HIGH_PRIORITY$p, function(context) {
72667
+ const {
72668
+ currentObject,
72669
+ element,
72670
+ objectsToAdd,
72671
+ propertyName
72672
+ } = context;
72673
+
72674
+ if (!is$1(element, 'bpmn:CallActivity')
72675
+ || !is$1(currentObject, 'zeebe:IoMapping')
72676
+ || (propertyName !== 'outputParameters' && propertyName !== 'zeebe:outputParameters')
72677
+ || !objectsToAdd
72678
+ || !objectsToAdd.length
72679
+ || !objectsToAdd.find((object) => is$1(object, 'zeebe:Output'))
72680
+ || !isPropagateAllChildVariables(element)) {
72681
+ return;
72682
+ }
73526
72683
 
73527
- calledElement.propagateAllChildVariables = oldPropagateAllChildVariables;
73528
- }
73529
- }, true);
72684
+ const businessObject = getBusinessObject(element),
72685
+ calledElement = getCalledElement(businessObject);
73530
72686
 
72687
+ modeling.updateModdleProperties(element, calledElement, {
72688
+ 'zeebe:propagateAllChildVariables': false
72689
+ });
72690
+ }, true);
73531
72691
 
72692
+ }
73532
72693
  }
73533
72694
 
73534
-
73535
72695
  UpdatePropagateAllChildVariablesBehavior.$inject = [
73536
- 'eventBus'
72696
+ 'eventBus',
72697
+ 'modeling'
73537
72698
  ];
73538
72699
 
72700
+ const USER_TASK_FORM_PREFIX = 'UserTaskForm_';
73539
72701
 
73540
- inherits_browser(UpdatePropagateAllChildVariablesBehavior, CommandInterceptor$1);
73541
-
73542
- const USER_TASK_FORM_PREFIX = 'userTaskForm_';
73543
-
73544
-
73545
- function getUserTaskForm(element, parent) {
73546
-
73547
- const rootElement = parent || getRootElement$1(element);
73548
-
73549
- // (1) get form definition from user task
73550
- const formDefinition = getFormDefinition(element);
73551
-
73552
- if (!formDefinition) {
73553
- return;
73554
- }
73555
-
73556
- const formKey = formDefinition.get('formKey');
73557
-
73558
- // (2) retrieve user task form via form key
73559
- const userTaskForm = findUserTaskForm(formKey, rootElement);
73560
-
73561
- return userTaskForm;
73562
- }
73563
-
73564
- function getFormDefinition(element) {
73565
- const businessObject = getBusinessObject(element);
73566
-
73567
- const formDefinitions = ExtensionElementsHelper_1.getExtensionElements(businessObject, 'zeebe:FormDefinition');
73568
-
73569
- return formDefinitions[0];
73570
- }
73571
-
73572
- function createFormKey(formId) {
73573
- return 'camunda-forms:bpmn:' + formId;
73574
- }
73575
72702
 
73576
72703
  function createFormDefinition(properties, extensionElements, bpmnFactory) {
73577
72704
  return ElementHelper_1.createElement(
@@ -73582,6 +72709,14 @@
73582
72709
  );
73583
72710
  }
73584
72711
 
72712
+ function createFormId() {
72713
+ return nextId_1(USER_TASK_FORM_PREFIX);
72714
+ }
72715
+
72716
+ function createFormKey(formId) {
72717
+ return `camunda-forms:bpmn:${ formId }`;
72718
+ }
72719
+
73585
72720
  function createUserTaskForm(properties, extensionElements, bpmnFactory) {
73586
72721
  return ElementHelper_1.createElement(
73587
72722
  'zeebe:UserTaskForm',
@@ -73591,19 +72726,22 @@
73591
72726
  );
73592
72727
  }
73593
72728
 
73594
- function createFormId() {
73595
- return nextId_1(USER_TASK_FORM_PREFIX);
73596
- }
72729
+ function findUserTaskForm(formKey, rootElement) {
72730
+ const userTaskForms = ExtensionElementsHelper_1.getExtensionElements(rootElement, 'zeebe:UserTaskForm');
73597
72731
 
72732
+ return find(userTaskForms, function(userTaskForm) {
72733
+ const id = userTaskForm.get('zeebe:id');
73598
72734
 
73599
- // helpers /////////////////////
72735
+ return createFormKey(id) === formKey;
72736
+ });
72737
+ }
73600
72738
 
73601
- function findUserTaskForm(formKey, rootElement) {
73602
- const forms = ExtensionElementsHelper_1.getExtensionElements(rootElement, 'zeebe:UserTaskForm');
72739
+ function getFormDefinition(element) {
72740
+ const businessObject = getBusinessObject(element);
73603
72741
 
73604
- return find(forms, function(userTaskForm) {
73605
- return createFormKey(userTaskForm.id) === formKey;
73606
- });
72742
+ const formDefinitions = ExtensionElementsHelper_1.getExtensionElements(businessObject, 'zeebe:FormDefinition');
72743
+
72744
+ return formDefinitions[ 0 ];
73607
72745
  }
73608
72746
 
73609
72747
  function getRootElement$1(element) {
@@ -73617,162 +72755,125 @@
73617
72755
  return parent;
73618
72756
  }
73619
72757
 
73620
- /**
73621
- * Zeebe specific form definition behavior.
73622
- */
73623
- function FormDefinitionBehavior(
73624
- eventBus, bpmnFactory) {
73625
-
73626
- CommandInterceptor$1.call(this, eventBus);
73627
-
73628
- /**
73629
- * ensures a zeebe:userTaskForm is cleaned up when user task got removed
73630
- */
73631
- this.executed('shape.delete', function(context) {
73632
- const {
73633
- shape,
73634
- oldParent
73635
- } = context;
72758
+ function getUserTaskForm(element, parent) {
72759
+ const rootElement = parent || getRootElement$1(element);
73636
72760
 
73637
- const rootElement = getRootElement$2(oldParent);
72761
+ const formDefinition = getFormDefinition(element);
73638
72762
 
73639
- const userTaskForm = getUserTaskForm(shape, rootElement);
72763
+ if (!formDefinition) {
72764
+ return;
72765
+ }
73640
72766
 
73641
- const rootExtensionElements = rootElement.get('extensionElements');
72767
+ const formKey = formDefinition.get('zeebe:formKey');
73642
72768
 
73643
- if (!is$1(shape, 'bpmn:UserTask') || !userTaskForm) {
73644
- return;
73645
- }
72769
+ return findUserTaskForm(formKey, rootElement);
72770
+ }
73646
72771
 
73647
- remove$3(rootExtensionElements.get('values'), userTaskForm);
72772
+ /**
72773
+ * Zeebe BPMN specific form definition behavior.
72774
+ */
72775
+ class FormDefinitionBehavior extends CommandInterceptor {
72776
+ constructor(bpmnFactory, eventBus, modeling) {
72777
+ super(eventBus);
73648
72778
 
73649
- context.removedUserTaskForm = userTaskForm;
73650
- }, true);
72779
+ /**
72780
+ * Remove zeebe:UserTaskForm on user task removed.
72781
+ */
72782
+ this.postExecute('shape.delete', function(context) {
72783
+ const {
72784
+ oldParent,
72785
+ shape
72786
+ } = context;
73651
72787
 
73652
- this.revert('shape.delete', function(context) {
73653
- const {
73654
- removedUserTaskForm,
73655
- oldParent
73656
- } = context;
72788
+ const rootElement = getRootElement$2(oldParent);
73657
72789
 
73658
- const rootElement = getRootElement$2(oldParent);
72790
+ const userTaskForm = getUserTaskForm(shape, rootElement);
73659
72791
 
73660
- const rootExtensionElements = rootElement.get('extensionElements');
72792
+ if (!is$1(shape, 'bpmn:UserTask') || !userTaskForm) {
72793
+ return;
72794
+ }
73661
72795
 
73662
- if (!removedUserTaskForm) {
73663
- return;
73664
- }
72796
+ const rootExtensionElements = rootElement.get('extensionElements');
73665
72797
 
73666
- add$2(rootExtensionElements.get('values'), removedUserTaskForm);
73667
- }, true);
72798
+ const values = rootExtensionElements.get('values').filter((element) => {
72799
+ return element !== userTaskForm;
72800
+ });
73668
72801
 
72802
+ modeling.updateModdleProperties(shape, rootExtensionElements, { values });
72803
+ }, true);
73669
72804
 
73670
- /**
73671
- * create fresh new copied form definition + user task form
73672
- */
73673
- this.executed('shape.create', function(context) {
73674
- const {
73675
- shape,
73676
- } = context;
73677
72805
 
73678
- const oldFormDefinition = getFormDefinition(shape);
72806
+ /**
72807
+ * Create new zeebe:FormDefinition and zeebe:UserTaskForm on user task created.
72808
+ */
72809
+ this.postExecute('shape.create', function(context) {
72810
+ const { shape } = context;
73679
72811
 
73680
- if (!is$1(shape, 'bpmn:UserTask') || !oldFormDefinition) {
73681
- return;
73682
- }
72812
+ const oldFormDefinition = getFormDefinition(shape);
73683
72813
 
73684
- const oldUserTaskForm = getUserTaskForm(shape);
72814
+ if (!is$1(shape, 'bpmn:UserTask') || !oldFormDefinition) {
72815
+ return;
72816
+ }
73685
72817
 
73686
- const rootElement = getRootElement$2(shape);
72818
+ const oldUserTaskForm = getUserTaskForm(shape);
73687
72819
 
73688
- const businessObject = getBusinessObject(shape);
72820
+ const rootElement = getRootElement$2(shape);
73689
72821
 
73690
- const extensionElements = businessObject.get('extensionElements');
72822
+ const businessObject = getBusinessObject(shape);
73691
72823
 
73692
- let rootExtensionElements = rootElement.get('extensionElements');
72824
+ const extensionElements = businessObject.get('extensionElements');
73693
72825
 
73694
- // (1) ensure extension elements in root
73695
- if (!rootExtensionElements) {
72826
+ let rootExtensionElements = rootElement.get('extensionElements');
73696
72827
 
73697
- rootExtensionElements = ElementHelper_1.createElement(
73698
- 'bpmn:ExtensionElements',
73699
- { values: [] },
73700
- rootElement,
73701
- bpmnFactory
73702
- );
72828
+ // (1) ensure extension elements exists
72829
+ if (!rootExtensionElements) {
72830
+ rootExtensionElements = ElementHelper_1.createElement('bpmn:ExtensionElements', { values: [] }, rootElement, bpmnFactory);
73703
72831
 
73704
- rootElement.set('extensionElements', rootExtensionElements);
73705
- }
72832
+ modeling.updateModdleProperties(shape, rootElement, { extensionElements: rootExtensionElements });
72833
+ }
73706
72834
 
73707
- // (2) remove existing form definition
73708
- context.oldFormDefinition = oldFormDefinition;
72835
+ // (2) remove existing form definition
72836
+ let values = extensionElements.get('values').filter((element) => {
72837
+ return element !== oldFormDefinition;
72838
+ });
73709
72839
 
73710
- remove$3(extensionElements.get('values'), oldFormDefinition);
72840
+ // (3) create new form definition
72841
+ const formId = createFormId();
73711
72842
 
73712
- const formId = createFormId();
72843
+ const newFormDefinition = createFormDefinition({ formKey: createFormKey(formId) }, extensionElements, bpmnFactory);
73713
72844
 
73714
- // (3) create new form definition
73715
- const formDefinition = createFormDefinition(
73716
- {
73717
- formKey: createFormKey(formId)
73718
- },
73719
- extensionElements,
73720
- bpmnFactory
73721
- );
72845
+ values = [
72846
+ ...values,
72847
+ newFormDefinition
72848
+ ];
73722
72849
 
73723
- add$2(extensionElements.get('values'), formDefinition);
72850
+ modeling.updateModdleProperties(shape, extensionElements, {
72851
+ values
72852
+ });
73724
72853
 
73725
- // (4) create new user task form
73726
- const userTaskForm = createUserTaskForm(
73727
- {
72854
+ // (4) create new user task form
72855
+ const userTaskForm = createUserTaskForm({
73728
72856
  id: formId,
73729
72857
  body: oldUserTaskForm ? oldUserTaskForm.get('body') : ''
73730
- },
73731
- rootExtensionElements,
73732
- bpmnFactory
73733
- );
73734
-
73735
- add$2(rootExtensionElements.get('values'), userTaskForm);
73736
- }, true);
73737
-
73738
- this.revert('shape.create', function(context) {
73739
- const {
73740
- shape,
73741
- oldFormDefinition
73742
- } = context;
73743
-
73744
- const businessObject = getBusinessObject(shape);
73745
-
73746
- const extensionElements = businessObject.get('extensionElements');
73747
-
73748
- const formDefinition = getFormDefinition(shape);
73749
-
73750
- const userTaskForm = getUserTaskForm(shape);
72858
+ }, rootExtensionElements, bpmnFactory);
73751
72859
 
73752
- const rootElement = getRootElement$2(shape);
73753
-
73754
- const rootExtensionElements = rootElement.get('extensionElements');
73755
-
73756
- if (!is$1(shape, 'bpmn:UserTask') || !userTaskForm) {
73757
- return;
73758
- }
73759
-
73760
- // we need to cover the old form definition to make <redo> possible
73761
- remove$3(extensionElements.get('values'), formDefinition);
73762
- add$2(extensionElements.get('values'), oldFormDefinition);
73763
-
73764
- remove$3(rootExtensionElements.get('values'), userTaskForm);
73765
- }, true);
72860
+ modeling.updateModdleProperties(shape, rootExtensionElements, {
72861
+ values: [
72862
+ ...(rootExtensionElements.get('values') || []),
72863
+ userTaskForm
72864
+ ]
72865
+ });
72866
+ }, true);
73766
72867
 
72868
+ }
73767
72869
  }
73768
72870
 
73769
72871
  FormDefinitionBehavior.$inject = [
72872
+ 'bpmnFactory',
73770
72873
  'eventBus',
73771
- 'bpmnFactory'
72874
+ 'modeling'
73772
72875
  ];
73773
72876
 
73774
- inherits_browser(FormDefinitionBehavior, CommandInterceptor$1);
73775
-
73776
72877
 
73777
72878
  // helpers //////////////
73778
72879
 
@@ -73789,11 +72890,15 @@
73789
72890
 
73790
72891
  var zeebeModelingBehaviors = {
73791
72892
  __init__: [
72893
+ 'cleanUpAssignmentDefinitionBehavior',
72894
+ 'cleanUpBusinessRuleTaskBehavior',
73792
72895
  'createZeebeBoundaryEventBehavior',
73793
72896
  'createZeebeCallActivityBehavior',
73794
72897
  'updatePropagateAllChildVariablesBehavior',
73795
72898
  'formDefinitionBehavior'
73796
72899
  ],
72900
+ cleanUpAssignmentDefinitionBehavior: [ 'type', CleanUpBusinessRuleTaskBehavior ],
72901
+ cleanUpBusinessRuleTaskBehavior: [ 'type', CleanUpBusinessRuleTaskBehavior$1 ],
73797
72902
  createZeebeBoundaryEventBehavior: [ 'type', CreateZeebeBoundaryEventBehavior ],
73798
72903
  createZeebeCallActivityBehavior: [ 'type', CreateZeebeCallActivityBehavior ],
73799
72904
  updatePropagateAllChildVariablesBehavior: [ 'type', UpdatePropagateAllChildVariablesBehavior ],
@@ -73822,11 +72927,11 @@
73822
72927
  'create.group'
73823
72928
  ];
73824
72929
 
73825
- const LOW_PRIORITY$p = 500;
72930
+ const LOW_PRIORITY$o = 500;
73826
72931
  class PaletteProvider$1 {
73827
72932
 
73828
72933
  constructor(palette) {
73829
- palette.registerProvider(LOW_PRIORITY$p, this);
72934
+ palette.registerProvider(LOW_PRIORITY$o, this);
73830
72935
  }
73831
72936
 
73832
72937
  getPaletteEntries(element) {
@@ -73870,7 +72975,7 @@
73870
72975
  'lane-insert-below'
73871
72976
  ];
73872
72977
 
73873
- const LOW_PRIORITY$q = 500;
72978
+ const LOW_PRIORITY$p = 500;
73874
72979
 
73875
72980
  class ContextPadProvider$1 {
73876
72981
 
@@ -73882,7 +72987,7 @@
73882
72987
  contextPadProvider.autoPlace = injector.get('autoPlace', false);
73883
72988
  }
73884
72989
 
73885
- contextPad.registerProvider(LOW_PRIORITY$q, this);
72990
+ contextPad.registerProvider(LOW_PRIORITY$p, this);
73886
72991
  }
73887
72992
 
73888
72993
  getContextPadEntries(element) {
@@ -74022,7 +73127,7 @@
74022
73127
  zeebeReplaceMenuProvider: [ 'type', ReplaceMenuProvider$1 ]
74023
73128
  };
74024
73129
 
74025
- const HIGH_PRIORITY$o = 15000;
73130
+ const HIGH_PRIORITY$q = 5000;
74026
73131
 
74027
73132
  /**
74028
73133
  * Zeebe rule provider that allows to create boundary events with catch events
@@ -74040,7 +73145,7 @@
74040
73145
 
74041
73146
  init() {
74042
73147
  super.init();
74043
- this.addRule('shape.attach', HIGH_PRIORITY$o,(context) => {
73148
+ this.addRule('shape.attach', HIGH_PRIORITY$q,(context) => {
74044
73149
  return this.canAttach(
74045
73150
  context.shape,
74046
73151
  context.target,
@@ -74468,12 +73573,12 @@
74468
73573
  }
74469
73574
 
74470
73575
  // Get the IOMapping
74471
- let inputOutput = getInputOutput(element);
73576
+ let inputOutput = getIoMapping(element);
74472
73577
 
74473
73578
  if (!inputOutput) {
74474
73579
  const parent = extensionElements;
74475
73580
 
74476
- inputOutput = createIOMapping(parent, bpmnFactory, {
73581
+ inputOutput = createIoMapping(parent, bpmnFactory, {
74477
73582
  inputParameters: [],
74478
73583
  outputParameters: []
74479
73584
  });
@@ -74528,7 +73633,7 @@
74528
73633
  function getIOMappingEntries(element, bpmnFactory, translate, options) {
74529
73634
 
74530
73635
  // Get the IOMapping and determine whether we are dealing with input or output parameters
74531
- const inputOutput = getInputOutput(element),
73636
+ const inputOutput = getIoMapping(element),
74532
73637
  params = determineParamGetFunc(options.prop)(element, false);
74533
73638
 
74534
73639
  if (!params.length) {
@@ -74597,6 +73702,19 @@
74597
73702
  }
74598
73703
  }
74599
73704
 
73705
+
73706
+ // helpers //////////
73707
+
73708
+ function determineParamGetFunc(property) {
73709
+ if (property == 'inputParameters') {
73710
+ return getInputParameters;
73711
+ }
73712
+
73713
+ if (property == 'outputParameters') {
73714
+ return getOutputParameters;
73715
+ }
73716
+ }
73717
+
74600
73718
  function inputOutput$1(group, element, bpmnFactory, translate, options) {
74601
73719
 
74602
73720
  const inputOutputEntry = inputOutput(element, bpmnFactory, translate, options);
@@ -76101,7 +75219,7 @@
76101
75219
 
76102
75220
  var propertiesProviderModule = {
76103
75221
  __depends__: [
76104
- translate$4
75222
+ translate$2
76105
75223
  ],
76106
75224
  __init__: [ 'propertiesProvider' ],
76107
75225
  propertiesProvider: [ 'type', ZeebePropertiesProvider ]
@@ -76388,6 +75506,52 @@
76388
75506
  isAttr: true
76389
75507
  }
76390
75508
  ]
75509
+ },
75510
+ {
75511
+ name: "CalledDecision",
75512
+ superClass: [
75513
+ "Element"
75514
+ ],
75515
+ meta: {
75516
+ allowedIn: [
75517
+ "bpmn:BusinessRuleTask"
75518
+ ]
75519
+ },
75520
+ properties: [
75521
+ {
75522
+ name: "decisionId",
75523
+ type: "String",
75524
+ isAttr: true
75525
+ },
75526
+ {
75527
+ name: "resultVariable",
75528
+ type: "String",
75529
+ isAttr: true
75530
+ }
75531
+ ]
75532
+ },
75533
+ {
75534
+ name: "AssignmentDefinition",
75535
+ superClass: [
75536
+ "Element"
75537
+ ],
75538
+ meta: {
75539
+ allowedIn: [
75540
+ "bpmn:UserTask"
75541
+ ]
75542
+ },
75543
+ properties: [
75544
+ {
75545
+ name: "assignee",
75546
+ type: "String",
75547
+ isAttr: true
75548
+ },
75549
+ {
75550
+ name: "candidateGroups",
75551
+ type: "String",
75552
+ isAttr: true
75553
+ }
75554
+ ]
76391
75555
  }
76392
75556
  ];
76393
75557
  var zeebeModdle = {