camunda-bpmn-js 4.13.0 → 4.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -113745,7 +113745,7 @@
113745
113745
  *
113746
113746
  * @return {Array<ModdleElement>|undefined} collection of event definitions or none
113747
113747
  */
113748
- function getEventDefinitions(element, type) {
113748
+ function getEventDefinitions$1(element, type) {
113749
113749
  var eventDefinitions = element.eventDefinitions;
113750
113750
 
113751
113751
  if (!eventDefinitions || !type) {
@@ -113765,7 +113765,7 @@
113765
113765
  * @return {Array<ModdleElement>} collection of error event definitions
113766
113766
  */
113767
113767
  function getErrorEventDefinitions(element) {
113768
- return getEventDefinitions(element, 'bpmn:ErrorEventDefinition');
113768
+ return getEventDefinitions$1(element, 'bpmn:ErrorEventDefinition');
113769
113769
  }
113770
113770
 
113771
113771
  /**
@@ -113776,7 +113776,7 @@
113776
113776
  * @return {Array<ModdleElement>} collection of escalation event definitions
113777
113777
  */
113778
113778
  function getEscalationEventDefinitions(element) {
113779
- return getEventDefinitions(element, 'bpmn:EscalationEventDefinition');
113779
+ return getEventDefinitions$1(element, 'bpmn:EscalationEventDefinition');
113780
113780
  }
113781
113781
 
113782
113782
 
@@ -123204,6 +123204,118 @@
123204
123204
  return find$3(values, value => is$6(value, 'zeebe:IoMapping'));
123205
123205
  }
123206
123206
 
123207
+ const DISALLOWED_START_LISTENER_TYPES = [
123208
+ 'bpmn:StartEvent',
123209
+ 'bpmn:BoundaryEvent'
123210
+ ];
123211
+
123212
+ class CleanUpExecutionListenersBehavior extends CommandInterceptor$1 {
123213
+ constructor(eventBus, modeling) {
123214
+ super(eventBus);
123215
+
123216
+ // remove execution listeners of disallowed type
123217
+ this.postExecuted('shape.replace', function(event) {
123218
+ const element = event.context.newShape;
123219
+
123220
+ const executionListenersContainer = getExecutionListenersContainer(element);
123221
+ if (!executionListenersContainer) {
123222
+ return;
123223
+ }
123224
+
123225
+ const listeners = executionListenersContainer.get('listeners');
123226
+ const newListeners = withoutDisallowedListeners(element, listeners);
123227
+
123228
+ if (newListeners.length !== listeners.length) {
123229
+ modeling.updateModdleProperties(element, executionListenersContainer, { listeners: newListeners });
123230
+ }
123231
+ });
123232
+
123233
+ // remove empty execution listener container
123234
+ this.postExecuted('element.updateModdleProperties', function(event) {
123235
+ const {
123236
+ element,
123237
+ moddleElement
123238
+ } = event.context;
123239
+
123240
+ if (!is$6(moddleElement, 'zeebe:ExecutionListeners')) {
123241
+ return;
123242
+ }
123243
+
123244
+ const listeners = moddleElement.get('listeners');
123245
+ if (listeners.length) {
123246
+ return;
123247
+ }
123248
+
123249
+ const extensionElements = moddleElement.$parent;
123250
+ modeling.updateModdleProperties(element, extensionElements, { values: without$1(extensionElements.get('values'), moddleElement) });
123251
+ });
123252
+ }
123253
+ }
123254
+
123255
+ CleanUpExecutionListenersBehavior.$inject = [
123256
+ 'eventBus',
123257
+ 'modeling'
123258
+ ];
123259
+
123260
+ // helpers //////////
123261
+ function withoutDisallowedListeners(element, listeners) {
123262
+ listeners = withoutDisallowedStartListeners(element, listeners);
123263
+ listeners = withoutDisallowedEndListeners(element, listeners);
123264
+
123265
+ return listeners;
123266
+ }
123267
+
123268
+ function withoutDisallowedStartListeners(element, listeners) {
123269
+ if (isAny$1(element, DISALLOWED_START_LISTENER_TYPES)) {
123270
+ return listeners.filter(listener => listener.eventType !== 'start');
123271
+ }
123272
+
123273
+ return listeners;
123274
+ }
123275
+
123276
+ function withoutDisallowedEndListeners(element, listeners) {
123277
+ if (shouldRemoveEndListeners(element)) {
123278
+ return listeners.filter(listener => listener.eventType !== 'end');
123279
+ }
123280
+
123281
+ return listeners;
123282
+ }
123283
+
123284
+ function shouldRemoveEndListeners(element) {
123285
+ if (
123286
+ is$6(element, 'bpmn:BoundaryEvent') && isCompensationEvent(element) ||
123287
+ is$6(element, 'bpmn:EndEvent') && isErrorEvent(element) ||
123288
+ is$6(element, 'bpmn:Gateway')
123289
+ ) {
123290
+ return true;
123291
+ }
123292
+ }
123293
+
123294
+ function isCompensationEvent(element) {
123295
+ const eventDefinitions = getEventDefinitions(element);
123296
+
123297
+ return find$3(eventDefinitions, function(definition) {
123298
+ return is$6(definition, 'bpmn:CompensateEventDefinition');
123299
+ });
123300
+ }
123301
+
123302
+ function isErrorEvent(element) {
123303
+ const eventDefinitions = getEventDefinitions(element);
123304
+
123305
+ return find$3(eventDefinitions, function(definition) {
123306
+ return is$6(definition, 'bpmn:ErrorEventDefinition');
123307
+ });
123308
+ }
123309
+
123310
+ function getEventDefinitions(element) {
123311
+ const businessObject = getBusinessObject$2(element);
123312
+ return businessObject.get('eventDefinitions') || [];
123313
+ }
123314
+
123315
+ function getExecutionListenersContainer(element) {
123316
+ return getExtensionElementsList$1(element, 'zeebe:ExecutionListeners')[0];
123317
+ }
123318
+
123207
123319
  /**
123208
123320
  * Zeebe BPMN behavior ensuring that zeebe:subscription is removed from bpmn:Message
123209
123321
  * when it has no properties anymore.
@@ -124116,6 +124228,7 @@
124116
124228
  __init__: [
124117
124229
  'cleanUpBusinessRuleTaskBehavior',
124118
124230
  'cleanUpEndEventBehavior',
124231
+ 'cleanUpExecutionListenersBehavior',
124119
124232
  'cleanUpSubscriptionBehavior',
124120
124233
  'cleanUpTimerExpressionBehavior',
124121
124234
  'copyPasteBehavior',
@@ -124127,6 +124240,7 @@
124127
124240
  ],
124128
124241
  cleanUpBusinessRuleTaskBehavior: [ 'type', CleanUpBusinessRuleTaskBehavior ],
124129
124242
  cleanUpEndEventBehavior: [ 'type', CleanUpEndEventBehavior ],
124243
+ cleanUpExecutionListenersBehavior: [ 'type', CleanUpExecutionListenersBehavior ],
124130
124244
  cleanUpSubscriptionBehavior: [ 'type', CleanUpSubscriptionBehavior ],
124131
124245
  cleanUpTimerExpressionBehavior: [ 'type', CleanUpTimerExpressionBehavior ],
124132
124246
  copyPasteBehavior: [ 'type', ZeebeModdleExtension ],
@@ -155393,6 +155507,93 @@
155393
155507
  isAttr: true
155394
155508
  }
155395
155509
  ]
155510
+ },
155511
+ {
155512
+ name: "ExecutionListeners",
155513
+ superClass: [
155514
+ "Element"
155515
+ ],
155516
+ meta: {
155517
+ allowedIn: [
155518
+ "bpmn:Event",
155519
+ "bpmn:Activity",
155520
+ "bpmn:Process",
155521
+ "bpmn:ExclusiveGateway",
155522
+ "bpmn:InclusiveGateway",
155523
+ "bpmn:ParallelGateway",
155524
+ "bpmn:EventBasedGateway"
155525
+ ]
155526
+ },
155527
+ properties: [
155528
+ {
155529
+ name: "listeners",
155530
+ type: "ExecutionListener",
155531
+ isMany: true
155532
+ }
155533
+ ]
155534
+ },
155535
+ {
155536
+ name: "ExecutionListener",
155537
+ superClass: [
155538
+ "Element"
155539
+ ],
155540
+ meta: {
155541
+ allowedIn: [
155542
+ "zeebe:ExecutionListeners"
155543
+ ]
155544
+ },
155545
+ properties: [
155546
+ {
155547
+ name: "eventType",
155548
+ type: "String",
155549
+ isAttr: true
155550
+ },
155551
+ {
155552
+ name: "retries",
155553
+ type: "String",
155554
+ isAttr: true
155555
+ },
155556
+ {
155557
+ name: "type",
155558
+ type: "String",
155559
+ isAttr: true
155560
+ }
155561
+ ]
155562
+ },
155563
+ {
155564
+ name: "VersionTag",
155565
+ superClass: [
155566
+ "Element"
155567
+ ],
155568
+ meta: {
155569
+ allowedIn: [
155570
+ "bpmn:Process"
155571
+ ]
155572
+ },
155573
+ properties: [
155574
+ {
155575
+ name: "value",
155576
+ type: "String",
155577
+ isAttr: true
155578
+ }
155579
+ ]
155580
+ },
155581
+ {
155582
+ name: "BindingTypeSupported",
155583
+ isAbstract: true,
155584
+ "extends": [
155585
+ "zeebe:CalledDecision",
155586
+ "zeebe:CalledElement",
155587
+ "zeebe:FormDefinition"
155588
+ ],
155589
+ properties: [
155590
+ {
155591
+ name: "bindingType",
155592
+ isAttr: true,
155593
+ type: "String",
155594
+ "default": "latest"
155595
+ }
155596
+ ]
155396
155597
  }
155397
155598
  ];
155398
155599
  var zeebeModdle = {