camunda-bpmn-js 0.12.1 → 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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,11 @@ All notable changes to [camunda-bpmn-js](https://github.com/camunda/camunda-bpmn
6
6
 
7
7
  ___Note:__ Yet to be released changes appear here._
8
8
 
9
+ ## 0.12.2
10
+
11
+ * `FEAT`: behavior for Cloud to ensure that no empty `zeebe:AssignmentDefinitions`
12
+ remain in the model after modeling or propertyPanel operations ([e26c486](https://github.com/camunda/camunda-bpmn-js/commit/e26c486bac3b54202fdf6c2b09d64483b52a2298))
13
+
9
14
  ## 0.12.1
10
15
 
11
16
  * `DEPS`: update to `zeebe-bpmn-moddle@0.10.0`
@@ -72072,13 +72072,82 @@
72072
72072
  const HIGH_PRIORITY$l = 5000;
72073
72073
 
72074
72074
 
72075
+ /**
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)
72080
+ */
72081
+ class CleanUpBusinessRuleTaskBehavior extends CommandInterceptor {
72082
+ constructor(eventBus, modeling) {
72083
+ super(eventBus);
72084
+
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;
72097
+
72098
+ // (1) harmonize property names from commands
72099
+ const assignmentDefintion = businessObject || moddleElement;
72100
+
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;
72109
+
72110
+ // (2) remove zeebe:assignmentDefintion
72111
+ removeFromExtensionElements(element, extensionElements, modeling,
72112
+ (ele) => !is$1(ele, 'zeebe:AssignmentDefinition'));
72113
+
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);
72121
+
72122
+ }
72123
+ }
72124
+
72125
+ CleanUpBusinessRuleTaskBehavior.$inject = [
72126
+ 'eventBus',
72127
+ 'modeling'
72128
+ ];
72129
+
72130
+
72131
+ // helper ////////////////////
72132
+
72133
+ function removeFromExtensionElements(element, extensionElements, modeling, filterFun) {
72134
+ const values = extensionElements.get('values').filter(filterFun);
72135
+
72136
+ modeling.updateModdleProperties(element, extensionElements, {
72137
+ values
72138
+ });
72139
+ }
72140
+
72141
+ const HIGH_PRIORITY$m = 5000;
72142
+
72143
+
72075
72144
  /**
72076
72145
  * Zeebe BPMN behavior for ensuring that a BusinessRuleTask:
72077
72146
  * 1) Either has a taskDefinition ExtensionElement OR
72078
72147
  * 2) Or has a calledDecision ExtensionElement
72079
72148
  * 2.1) If it has a calledDecision ExtensionElement, it shall not have taskHeaders
72080
72149
  */
72081
- class CleanUpBusinessRuleTaskBehavior extends CommandInterceptor {
72150
+ class CleanUpBusinessRuleTaskBehavior$1 extends CommandInterceptor {
72082
72151
  constructor(eventBus, modeling) {
72083
72152
  super(eventBus);
72084
72153
 
@@ -72088,7 +72157,7 @@
72088
72157
  this.postExecute([
72089
72158
  'properties-panel.update-businessobject-list',
72090
72159
  'element.updateModdleProperties'
72091
- ] , HIGH_PRIORITY$l, function(context) {
72160
+ ] , HIGH_PRIORITY$m, function(context) {
72092
72161
  const {
72093
72162
  element,
72094
72163
  currentObject,
@@ -72120,7 +72189,7 @@
72120
72189
  this.postExecute([
72121
72190
  'properties-panel.update-businessobject-list',
72122
72191
  'element.updateModdleProperties'
72123
- ] , HIGH_PRIORITY$l, function(context) {
72192
+ ] , HIGH_PRIORITY$m, function(context) {
72124
72193
  const {
72125
72194
  element,
72126
72195
  currentObject,
@@ -72150,7 +72219,7 @@
72150
72219
  }
72151
72220
  }
72152
72221
 
72153
- CleanUpBusinessRuleTaskBehavior.$inject = [
72222
+ CleanUpBusinessRuleTaskBehavior$1.$inject = [
72154
72223
  'eventBus',
72155
72224
  'modeling'
72156
72225
  ];
@@ -72158,7 +72227,7 @@
72158
72227
 
72159
72228
  // helper ////////////////////
72160
72229
 
72161
- function removeFromExtensionElements(element, extensionElements, modeling, filterFun) {
72230
+ function removeFromExtensionElements$1(element, extensionElements, modeling, filterFun) {
72162
72231
  const values = extensionElements.get('values').filter(filterFun);
72163
72232
 
72164
72233
  modeling.updateModdleProperties(element, extensionElements, {
@@ -72167,16 +72236,16 @@
72167
72236
  }
72168
72237
 
72169
72238
  function removeCalledDecision(element, extensionElements, modeling) {
72170
- removeFromExtensionElements(element, extensionElements, modeling,
72239
+ removeFromExtensionElements$1(element, extensionElements, modeling,
72171
72240
  (ele) => !is$1(ele, 'zeebe:CalledDecision'));
72172
72241
  }
72173
72242
 
72174
72243
  function removeTaskDefintionAndHeaders(element, extensionElements, modeling) {
72175
- removeFromExtensionElements(element, extensionElements, modeling,
72244
+ removeFromExtensionElements$1(element, extensionElements, modeling,
72176
72245
  (ele) => !is$1(ele, 'zeebe:TaskDefinition') && !is$1(ele, 'zeebe:TaskHeaders'));
72177
72246
  }
72178
72247
 
72179
- const HIGH_PRIORITY$m = 5000;
72248
+ const HIGH_PRIORITY$n = 5000;
72180
72249
 
72181
72250
 
72182
72251
  /**
@@ -72189,7 +72258,7 @@
72189
72258
  /**
72190
72259
  * Replace intermediate catch event with boundary event when attaching it to a shape.
72191
72260
  */
72192
- this.preExecute('shape.create', HIGH_PRIORITY$m, function(context) {
72261
+ this.preExecute('shape.create', HIGH_PRIORITY$n, function(context) {
72193
72262
  const {
72194
72263
  shape,
72195
72264
  host
@@ -72474,7 +72543,7 @@
72474
72543
  }
72475
72544
  }
72476
72545
 
72477
- const HIGH_PRIORITY$n = 5000;
72546
+ const HIGH_PRIORITY$o = 5000;
72478
72547
 
72479
72548
 
72480
72549
  /**
@@ -72488,7 +72557,7 @@
72488
72557
  * Add zeebe:CalledElement extension element with zeebe:propagateAllChildVariables attribute = false
72489
72558
  * when creating bpmn:CallActivity.
72490
72559
  */
72491
- this.postExecuted('shape.create', HIGH_PRIORITY$n, function(context) {
72560
+ this.postExecuted('shape.create', HIGH_PRIORITY$o, function(context) {
72492
72561
  const { shape } = context;
72493
72562
 
72494
72563
  if (!is$1(shape, 'bpmn:CallActivity')) {
@@ -72536,7 +72605,7 @@
72536
72605
  'modeling'
72537
72606
  ];
72538
72607
 
72539
- const HIGH_PRIORITY$o = 5000;
72608
+ const HIGH_PRIORITY$p = 5000;
72540
72609
 
72541
72610
 
72542
72611
  /**
@@ -72549,7 +72618,7 @@
72549
72618
  /**
72550
72619
  * Remove zeebe:OutputParameters when zeebe:propagateAllChildVariables is set to true.
72551
72620
  */
72552
- this.postExecute('properties-panel.update-businessobject' , HIGH_PRIORITY$o, function(context) {
72621
+ this.postExecute('properties-panel.update-businessobject' , HIGH_PRIORITY$p, function(context) {
72553
72622
  const {
72554
72623
  element,
72555
72624
  properties
@@ -72594,7 +72663,7 @@
72594
72663
  /**
72595
72664
  * Set zeebe:propagateAllChildVariables to false on zeebe:Output added.
72596
72665
  */
72597
- this.postExecute('properties-panel.update-businessobject-list' , HIGH_PRIORITY$o, function(context) {
72666
+ this.postExecute('properties-panel.update-businessobject-list' , HIGH_PRIORITY$p, function(context) {
72598
72667
  const {
72599
72668
  currentObject,
72600
72669
  element,
@@ -72821,13 +72890,15 @@
72821
72890
 
72822
72891
  var zeebeModelingBehaviors = {
72823
72892
  __init__: [
72893
+ 'cleanUpAssignmentDefinitionBehavior',
72824
72894
  'cleanUpBusinessRuleTaskBehavior',
72825
72895
  'createZeebeBoundaryEventBehavior',
72826
72896
  'createZeebeCallActivityBehavior',
72827
72897
  'updatePropagateAllChildVariablesBehavior',
72828
72898
  'formDefinitionBehavior'
72829
72899
  ],
72830
- cleanUpBusinessRuleTaskBehavior: [ 'type', CleanUpBusinessRuleTaskBehavior ],
72900
+ cleanUpAssignmentDefinitionBehavior: [ 'type', CleanUpBusinessRuleTaskBehavior ],
72901
+ cleanUpBusinessRuleTaskBehavior: [ 'type', CleanUpBusinessRuleTaskBehavior$1 ],
72831
72902
  createZeebeBoundaryEventBehavior: [ 'type', CreateZeebeBoundaryEventBehavior ],
72832
72903
  createZeebeCallActivityBehavior: [ 'type', CreateZeebeCallActivityBehavior ],
72833
72904
  updatePropagateAllChildVariablesBehavior: [ 'type', UpdatePropagateAllChildVariablesBehavior ],
@@ -73056,7 +73127,7 @@
73056
73127
  zeebeReplaceMenuProvider: [ 'type', ReplaceMenuProvider$1 ]
73057
73128
  };
73058
73129
 
73059
- const HIGH_PRIORITY$p = 5000;
73130
+ const HIGH_PRIORITY$q = 5000;
73060
73131
 
73061
73132
  /**
73062
73133
  * Zeebe rule provider that allows to create boundary events with catch events
@@ -73074,7 +73145,7 @@
73074
73145
 
73075
73146
  init() {
73076
73147
  super.init();
73077
- this.addRule('shape.attach', HIGH_PRIORITY$p,(context) => {
73148
+ this.addRule('shape.attach', HIGH_PRIORITY$q,(context) => {
73078
73149
  return this.canAttach(
73079
73150
  context.shape,
73080
73151
  context.target,