camunda-bpmn-js 0.11.5 → 0.13.0-alpha.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/assets/base-modeler.css +1 -1
  3. package/dist/assets/camunda-platform-modeler.css +2 -1
  4. package/dist/assets/diagram-js.css +2 -0
  5. package/dist/assets/element-templates.css +75 -0
  6. package/dist/assets/properties-panel.css +889 -0
  7. package/dist/base-modeler.development.js +8542 -12092
  8. package/dist/base-modeler.production.min.js +8 -3
  9. package/dist/camunda-cloud-modeler.development.js +12089 -14412
  10. package/dist/camunda-cloud-modeler.production.min.js +8 -3
  11. package/dist/camunda-platform-modeler.development.js +22532 -25950
  12. package/dist/camunda-platform-modeler.production.min.js +8 -3
  13. package/lib/base/Modeler.js +5 -3
  14. package/lib/camunda-cloud/Modeler.js +5 -3
  15. package/lib/camunda-cloud/features/modeling/behavior/CleanUpAssignmentDefinitionBehavior.js +78 -0
  16. package/lib/camunda-cloud/features/modeling/behavior/CleanUpBusinessRuleTaskBehavior.js +112 -0
  17. package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeBoundaryEventBehavior.js +51 -55
  18. package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +57 -60
  19. package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +70 -128
  20. package/lib/camunda-cloud/features/modeling/behavior/UpdatePropagateAllChildVariablesBehavior.js +76 -128
  21. package/lib/camunda-cloud/features/modeling/behavior/index.js +6 -0
  22. package/lib/camunda-cloud/features/rules/BpmnRules.js +1 -1
  23. package/lib/camunda-cloud/helper/CalledElementHelper.js +43 -41
  24. package/lib/camunda-cloud/helper/ElementHelper.js +18 -0
  25. package/lib/camunda-cloud/helper/ExtensionElementsHelper.js +17 -0
  26. package/lib/camunda-cloud/helper/FormsHelper.js +41 -53
  27. package/lib/camunda-cloud/helper/InputOutputHelper.js +93 -111
  28. package/lib/camunda-cloud/helper/Utils.js +10 -0
  29. package/lib/camunda-cloud/helper/ZeebeServiceTaskHelper.js +22 -5
  30. package/lib/camunda-platform/Modeler.js +7 -3
  31. package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js +24 -47
  32. package/lib/camunda-platform/features/modeling/behavior/DeleteRetryTimeCycleBehavior.js +39 -81
  33. package/lib/camunda-platform/features/modeling/behavior/UpdateCamundaExclusiveBehavior.js +31 -65
  34. package/lib/camunda-platform/features/modeling/behavior/UpdateInputOutputBehavior.js +42 -76
  35. package/lib/camunda-platform/features/modeling/behavior/UpdateResultVariableBehavior.js +21 -26
  36. package/lib/camunda-platform/features/modeling/behavior/UserTaskFormsBehavior.js +16 -10
  37. package/lib/camunda-platform/helper/InputOutputHelper.js +29 -0
  38. package/package.json +6 -5
  39. package/styles/base-modeler.css +1 -1
  40. package/styles/camunda-platform-modeler.css +2 -1
  41. package/dist/assets/bpmn-js-properties-panel.css +0 -778
  42. package/lib/camunda-cloud/features/properties-provider/ZeebePropertiesProvider.js +0 -201
  43. package/lib/camunda-cloud/features/properties-provider/index.js +0 -11
  44. package/lib/camunda-cloud/features/properties-provider/parts/CallActivityProps.js +0 -90
  45. package/lib/camunda-cloud/features/properties-provider/parts/ErrorProps.js +0 -13
  46. package/lib/camunda-cloud/features/properties-provider/parts/FormProps.js +0 -14
  47. package/lib/camunda-cloud/features/properties-provider/parts/HeadersProps.js +0 -52
  48. package/lib/camunda-cloud/features/properties-provider/parts/InputOutputProps.js +0 -8
  49. package/lib/camunda-cloud/features/properties-provider/parts/MessageProps.js +0 -51
  50. package/lib/camunda-cloud/features/properties-provider/parts/MultiInstanceProps.js +0 -25
  51. package/lib/camunda-cloud/features/properties-provider/parts/SequenceFlowProps.js +0 -149
  52. package/lib/camunda-cloud/features/properties-provider/parts/TaskDefinitionProps.js +0 -135
  53. package/lib/camunda-cloud/features/properties-provider/parts/TimerEventProps.js +0 -77
  54. package/lib/camunda-cloud/features/properties-provider/parts/implementation/ElementReferenceExtensionElementProperty.js +0 -110
  55. package/lib/camunda-cloud/features/properties-provider/parts/implementation/FormDefinition.js +0 -207
  56. package/lib/camunda-cloud/features/properties-provider/parts/implementation/Headers.js +0 -208
  57. package/lib/camunda-cloud/features/properties-provider/parts/implementation/InputOutput.js +0 -260
  58. package/lib/camunda-cloud/features/properties-provider/parts/implementation/InputOutputParameter.js +0 -147
  59. package/lib/camunda-cloud/features/properties-provider/parts/implementation/MultiInstanceLoopCharacteristics.js +0 -176
  60. package/lib/camunda-cloud/features/properties-provider/parts/implementation/OutputParameterToggle.js +0 -97
  61. package/lib/camunda-cloud/features/properties-provider/parts/implementation/TimerDurationDefinition.js +0 -69
  62. package/lib/camunda-cloud/features/properties-provider/parts/implementation/TimerEventDefinition.js +0 -132
@@ -1,32 +1,27 @@
1
- import inherits from 'inherits';
2
-
3
1
  import {
4
2
  getBusinessObject,
5
3
  is
6
4
  } from 'bpmn-js/lib/util/ModelUtil';
7
5
 
8
- import {
9
- find
10
- } from 'min-dash';
11
-
12
6
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
13
7
 
14
- const HIGH_PRIORITY = 15000;
8
+ const HIGH_PRIORITY = 5000;
15
9
 
16
10
 
17
11
  /**
18
- * Camunda BPMN specific `camunda:FailedJobRetryTimeCycle` behavior.
19
- *
20
- * When `camunda:asyncAfter` or `camunda:asyncBefore` are set to false
21
- * on an element, then `camunda:FailedJobRetryTimeCycle` shall be removed. This ensures
22
- * that the BPMN diagram XML reflects the behavior of Camunda Platform engine.
12
+ * Camunda BPMN specific camunda:FailedJobRetryTimeCycle behavior.
23
13
  */
24
- export default function DeleteRetryTimeCycleBehavior(eventBus) {
25
-
26
- CommandInterceptor.call(this, eventBus);
27
-
28
- this.executed([ 'properties-panel.update-businessobject', 'element.updateProperties' ],
29
- HIGH_PRIORITY, function(context) {
14
+ export default class DeleteRetryTimeCycleBehavior extends CommandInterceptor {
15
+ constructor(eventBus, modeling) {
16
+ super(eventBus);
17
+
18
+ /**
19
+ * Remove camunda:FailedJobRetryTimeCycle if camunda:asyncAfter or camunda:asyncBefore is set to false.
20
+ */
21
+ this.postExecute([
22
+ 'element.updateProperties',
23
+ 'properties-panel.update-businessobject'
24
+ ], HIGH_PRIORITY, function(context) {
30
25
  const {
31
26
  element,
32
27
  properties
@@ -35,92 +30,55 @@ export default function DeleteRetryTimeCycleBehavior(eventBus) {
35
30
  const businessObject = getBusinessObject(element),
36
31
  extensionElements = businessObject.extensionElements;
37
32
 
38
- // (1.1) Execute if...
39
- if (is(element, 'camunda:AsyncCapable') && // ...asyncCapable
40
- properties && // ...properties updated
41
- (properties['camunda:asyncBefore'] === false || // ...update async (1)
42
- properties['camunda:asyncAfter'] === false) && // ...update async (2)
43
- (extensionElements && extensionElements.values.length) && // ...we have extensionElements
44
- (extensionElements.values.find(ele => is(ele, 'camunda:FailedJobRetryTimeCycle'))) && // ...we have retryTimeCycle
45
- !getTimerEventDefinition(element) // ...we don't have a TimerEventDefinition
33
+ if (
34
+ !is(element, 'camunda:AsyncCapable')
35
+ || (properties[ 'camunda:asyncBefore' ] !== false && properties[ 'camunda:asyncAfter' ] !== false)
36
+ || !extensionElements
37
+ || !extensionElements.get('values').length
38
+ || !extensionElements.get('values').find((value) => is(value, 'camunda:FailedJobRetryTimeCycle'))
39
+ || getTimerEventDefinition(element)
40
+ || isAsyncBefore(businessObject)
41
+ || isAsyncAfter(businessObject)
46
42
  ) {
47
-
48
- // (1.2) ... but don't execute if one async is still true
49
- if (isAsyncBefore(businessObject) || isAsyncAfter(businessObject)) {
50
- return;
51
- }
52
-
53
- // (2) Delete the camunda:FailedJobRetryTimeCycle and save them for revert
54
- context.deleteRetryCycleOldExtElements = extensionElements.values;
55
-
56
- extensionElements.values = extensionElements.values.filter(
57
- ele => !is(ele, 'camunda:FailedJobRetryTimeCycle'));
43
+ return;
58
44
  }
59
45
 
60
- }, true);
61
-
62
- this.reverted([ 'properties-panel.update-businessobject', 'element.updateProperties' ],
63
- HIGH_PRIORITY, function({ context }) {
64
- const {
65
- element,
66
- deleteRetryCycleOldExtElements: oldExtensionElements
67
- } = context;
68
-
69
- const businessObject = getBusinessObject(element);
46
+ const values = extensionElements.get('values').filter((element) => {
47
+ return !is(element, 'camunda:FailedJobRetryTimeCycle');
48
+ });
70
49
 
71
- // Only intercept the revert, if the behavior became active
72
- if (oldExtensionElements) {
73
- const extensionElements = businessObject.extensionElements;
50
+ modeling.updateModdleProperties(element, extensionElements, { values });
51
+ }, true);
74
52
 
75
- extensionElements.values = oldExtensionElements;
76
- }
77
- });
53
+ }
78
54
  }
79
55
 
80
-
81
56
  DeleteRetryTimeCycleBehavior.$inject = [
82
- 'eventBus'
57
+ 'eventBus',
58
+ 'modeling'
83
59
  ];
84
60
 
85
- inherits(DeleteRetryTimeCycleBehavior, CommandInterceptor);
86
61
 
62
+ // helpers //////////
87
63
 
88
- // helper //////////////////
89
-
90
- /**
91
- * Returns true if the attribute 'camunda:asyncBefore' is set
92
- * to true.
93
- *
94
- * @param {ModdleElement} bo
95
- *
96
- * @return {boolean} a boolean value
97
- */
98
- function isAsyncBefore(bo) {
99
- return !!(bo.get('camunda:asyncBefore') || bo.get('camunda:async'));
64
+ function isAsyncBefore(businessObject) {
65
+ return !!(businessObject.get('camunda:asyncBefore') || businessObject.get('camunda:async'));
100
66
  }
101
67
 
102
- /**
103
- * Returns true if the attribute 'camunda:asyncAfter' is set
104
- * to true.
105
- *
106
- * @param {ModdleElement} bo
107
- *
108
- * @return {boolean} a boolean value
109
- */
110
- function isAsyncAfter(bo) {
111
- return !!bo.get('camunda:asyncAfter');
68
+ function isAsyncAfter(businessObject) {
69
+ return !!businessObject.get('camunda:asyncAfter');
112
70
  }
113
71
 
114
72
  function getTimerEventDefinition(element) {
115
73
  return getEventDefinition(element, 'bpmn:TimerEventDefinition');
116
74
  }
117
75
 
118
- function getEventDefinition(element, eventType) {
76
+ function getEventDefinition(element, type) {
119
77
  const businessObject = getBusinessObject(element);
120
78
 
121
79
  const eventDefinitions = businessObject.get('eventDefinitions') || [];
122
80
 
123
- return find(eventDefinitions, function(definition) {
124
- return is(definition, eventType);
81
+ return eventDefinitions.find((eventDefinition) => {
82
+ return is(eventDefinition, type);
125
83
  });
126
84
  }
@@ -1,5 +1,3 @@
1
- import inherits from 'inherits';
2
-
3
1
  import {
4
2
  getBusinessObject,
5
3
  is
@@ -7,22 +5,23 @@ import {
7
5
 
8
6
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
9
7
 
10
- const HIGH_PRIORITY = 15000;
8
+ const HIGH_PRIORITY = 5000;
11
9
 
12
10
 
13
11
  /**
14
- * Camunda BPMN specific `camunda:exclusive` behavior.
15
- *
16
- * When `camunda:asyncAfter` or `camunda:asyncBefore` are set to false
17
- * on an element, then `camunda:exclusive` shall be set to true. This ensures
18
- * that the BPMN diagram XML reflects the behavior of Camunda Platform engine.
12
+ * Camunda BPMN specific camunda:exclusive behavior.
19
13
  */
20
- export default function UpdateCamundaExclusiveBehavior(eventBus) {
21
-
22
- CommandInterceptor.call(this, eventBus);
23
-
24
- this.preExecute([ 'properties-panel.update-businessobject', 'element.updateProperties' ],
25
- HIGH_PRIORITY, function(context) {
14
+ export default class UpdateCamundaExclusiveBehavior extends CommandInterceptor {
15
+ constructor(eventBus) {
16
+ super(eventBus);
17
+
18
+ /**
19
+ * Set camunda:exclusive to true on camunda:asyncBefore or camunda:asyncAfter set to false.
20
+ */
21
+ this.preExecute([
22
+ 'element.updateProperties',
23
+ 'properties-panel.update-businessobject'
24
+ ], HIGH_PRIORITY, function(context) {
26
25
  const {
27
26
  element,
28
27
  properties
@@ -30,70 +29,37 @@ export default function UpdateCamundaExclusiveBehavior(eventBus) {
30
29
 
31
30
  const businessObject = getBusinessObject(element);
32
31
 
33
- // (1.1) Execute if...
34
- if (is(element, 'camunda:AsyncCapable') && // ...asyncCapable
35
- properties && // ...properties updated
36
- (properties['camunda:asyncBefore'] === false || // ...update async before or (1)
37
- properties['camunda:asyncAfter'] === false) && // ...update async after (2)
38
- !isExclusive(businessObject) // ...is currently not exclusive
32
+ if (!is(element, 'camunda:AsyncCapable')
33
+ || (properties[ 'camunda:asyncBefore' ] !== false && properties[ 'camunda:asyncAfter' ] !== false)
34
+ || isExclusive(businessObject)
35
+ || (isAsyncAfter(businessObject) && properties[ 'camunda:asyncAfter' ] !== false)
36
+ || (isAsyncBefore(businessObject) && properties[ 'camunda:asyncBefore' ] !== false)
37
+ || (properties[ 'camunda:asyncBefore' ] === true || properties[ 'camunda:asyncAfter' ] === true)
39
38
  ) {
40
-
41
- // (1.2) ...but don't execute if...
42
- if ((isAsyncAfter(businessObject) && properties['camunda:asyncAfter'] !== false) || // ...asyncAfter will stay
43
- (isAsyncBefore(businessObject) && properties['camunda:asyncBefore'] !== false) || // ...asyncBefore will stay
44
- (properties['camunda:asyncBefore'] || properties['camunda:asyncAfter']) // one is set to true
45
- ) {
46
- return;
47
- }
48
-
49
- // (2) Update the context
50
- properties['camunda:exclusive'] = true;
39
+ return;
51
40
  }
41
+
42
+ properties[ 'camunda:exclusive' ] = true;
52
43
  }, true);
53
- }
54
44
 
45
+ }
46
+ }
55
47
 
56
48
  UpdateCamundaExclusiveBehavior.$inject = [
57
49
  'eventBus'
58
50
  ];
59
51
 
60
- inherits(UpdateCamundaExclusiveBehavior, CommandInterceptor);
61
-
62
52
 
63
- // helper //////////////////
53
+ // helpers //////////
64
54
 
65
- /**
66
- * Returns true if the attribute 'camunda:asyncBefore' is set
67
- * to true.
68
- *
69
- * @param {ModdleElement} bo
70
- *
71
- * @return {boolean} a boolean value
72
- */
73
- function isAsyncBefore(bo) {
74
- return !!(bo.get('camunda:asyncBefore') || bo.get('camunda:async'));
55
+ function isAsyncBefore(businessObject) {
56
+ return !!(businessObject.get('camunda:asyncBefore') || businessObject.get('camunda:async'));
75
57
  }
76
58
 
77
- /**
78
- * Returns true if the attribute 'camunda:asyncAfter' is set
79
- * to true.
80
- *
81
- * @param {ModdleElement} bo
82
- *
83
- * @return {boolean} a boolean value
84
- */
85
- function isAsyncAfter(bo) {
86
- return !!bo.get('camunda:asyncAfter');
59
+ function isAsyncAfter(businessObject) {
60
+ return !!businessObject.get('camunda:asyncAfter');
87
61
  }
88
62
 
89
- /**
90
- * Returns true if the attribute 'camunda:exclusive' is set
91
- * to true.
92
- *
93
- * @param {ModdleElement} bo
94
- *
95
- * @return {boolean} a boolean value
96
- */
97
- function isExclusive(bo) {
98
- return !!bo.get('camunda:exclusive');
63
+ function isExclusive(businessObject) {
64
+ return !!businessObject.get('camunda:exclusive');
99
65
  }
@@ -1,88 +1,54 @@
1
- import inherits from 'inherits';
1
+ import { getBusinessObject } from 'bpmn-js/lib/util/ModelUtil';
2
2
 
3
3
  import {
4
- getBusinessObject,
5
- is
6
- } from 'bpmn-js/lib/util/ModelUtil';
4
+ getInputOutput,
5
+ isInputOutputEmpty
6
+ } from '../../../helper/InputOutputHelper';
7
7
 
8
8
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
9
9
 
10
10
  /**
11
- * Camunda BPMN specific `camunda:inputOutput` behavior.
11
+ * Camunda BPMN specific camunda:InputOutput behavior.
12
12
  */
13
- export default function UpdateInputOutputBehavior(eventBus, modeling) {
14
-
15
- CommandInterceptor.call(this, eventBus);
16
-
17
- this.postExecute([
18
- 'element.updateProperties',
19
- 'element.updateModdleProperties',
20
- 'properties-panel.update-businessobject-list'
21
- ], function(context) {
22
- const {
23
- element,
24
- oldProperties,
25
- propertyName
26
- } = context;
27
-
28
- const businessObject = getBusinessObject(element);
29
- const inputOutput = getInputOutput(businessObject);
30
- const extensionElements = businessObject.get('extensionElements');
31
-
32
- // do not apply if inputOutput got recently added
33
- if (!oldProperties && propertyName === 'values') {
34
- return;
35
- }
36
-
37
- // remove camunda:inputOutput if there are no input/output parameters anymore
38
- if (inputOutput && isEmpty(inputOutput)) {
39
- const filtered = extensionElements.values.filter(function(element) {
40
- return element !== inputOutput;
41
- });
42
-
43
- modeling.updateModdleProperties(element, extensionElements, {
44
- values: filtered
45
- });
46
- }
47
- }, true);
13
+ export default class UpdateInputOutputBehavior extends CommandInterceptor {
14
+ constructor(eventBus, modeling) {
15
+ super(eventBus);
16
+
17
+ /**
18
+ * Remove empty camunda:InputOutput on update.
19
+ */
20
+ this.postExecute([
21
+ 'element.updateProperties',
22
+ 'element.updateModdleProperties',
23
+ 'properties-panel.update-businessobject-list'
24
+ ], function(context) {
25
+ const {
26
+ element,
27
+ oldProperties,
28
+ propertyName
29
+ } = context;
30
+
31
+ const businessObject = getBusinessObject(element),
32
+ inputOutput = getInputOutput(businessObject),
33
+ extensionElements = businessObject.get('extensionElements');
34
+
35
+ // do not remove newly added camunda:InputOutput
36
+ if (!oldProperties && propertyName === 'values') {
37
+ return;
38
+ }
39
+
40
+ if (inputOutput && isInputOutputEmpty(inputOutput)) {
41
+ const values = extensionElements.get('values').filter(function(element) {
42
+ return element !== inputOutput;
43
+ });
44
+
45
+ modeling.updateModdleProperties(element, extensionElements, { values });
46
+ }
47
+ }, true);
48
+ }
48
49
  }
49
50
 
50
-
51
51
  UpdateInputOutputBehavior.$inject = [
52
52
  'eventBus',
53
53
  'modeling'
54
- ];
55
-
56
- inherits(UpdateInputOutputBehavior, CommandInterceptor);
57
-
58
-
59
- // helper //////////////////
60
-
61
- function getInputParameters(inputOutput) {
62
- return inputOutput.get('inputParameters');
63
- }
64
-
65
- function getOutputParameters(inputOutput) {
66
- return inputOutput.get('outputParameters');
67
- }
68
-
69
- function getInputOutput(businessObject) {
70
- const extensionElements = businessObject.get('extensionElements');
71
-
72
- if (!extensionElements) {
73
- return;
74
- }
75
-
76
- const values = extensionElements.get('values');
77
-
78
- return values.find((value) => {
79
- return is(value, 'camunda:InputOutput');
80
- });
81
- }
82
-
83
- function isEmpty(inputOutput) {
84
- const inputParameters = getInputParameters(inputOutput);
85
- const outputParameters = getOutputParameters(inputOutput);
86
-
87
- return inputParameters.length === 0 && outputParameters.length === 0;
88
- }
54
+ ];
@@ -1,12 +1,6 @@
1
- import inherits from 'inherits';
1
+ import { is } from 'bpmn-js/lib/util/ModelUtil';
2
2
 
3
- import {
4
- is
5
- } from 'bpmn-js/lib/util/ModelUtil';
6
-
7
- import {
8
- has
9
- } from 'min-dash';
3
+ import { has } from 'min-dash';
10
4
 
11
5
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
12
6
 
@@ -14,41 +8,42 @@ const HIGH_PRIORITY = 5000;
14
8
 
15
9
 
16
10
  /**
17
- * Camunda BPMN specific `camunda:resultVariable` behavior.
18
- *
19
- * When `camunda:resultVariable` is removed from a service task like element
20
- * `camunda:mapDecisionResult` for the element will be cleaned up.
11
+ * Camunda BPMN specific camunda:resultVariable behavior.
21
12
  */
22
- export default function UpdateResultVariableBehavior(eventBus) {
23
-
24
- CommandInterceptor.call(this, eventBus);
25
-
26
- this.preExecute([ 'properties-panel.update-businessobject', 'element.updateProperties' ],
27
- HIGH_PRIORITY, function(context) {
13
+ export default class UpdateResultVariableBehavior extends CommandInterceptor {
14
+ constructor(eventBus) {
15
+ super(eventBus);
16
+
17
+ /**
18
+ * Remove camunda:mapDecisionResult on camunda:resultVariable removed.
19
+ */
20
+ this.preExecute([
21
+ 'element.updateProperties',
22
+ 'properties-panel.update-businessobject'
23
+ ], HIGH_PRIORITY, function(context) {
28
24
  const {
29
25
  element,
30
26
  properties
31
27
  } = context;
32
28
 
33
29
  if (
34
- is(element, 'camunda:DmnCapable') &&
35
- has(properties, 'camunda:resultVariable') &&
36
- isEmpty(properties['camunda:resultVariable'])
30
+ is(element, 'camunda:DmnCapable')
31
+ && has(properties, 'camunda:resultVariable')
32
+ && isEmpty(properties[ 'camunda:resultVariable' ])
37
33
  ) {
38
- properties['camunda:mapDecisionResult'] = null;
34
+ properties[ 'camunda:mapDecisionResult' ] = null;
39
35
  }
40
36
  }, true);
41
- }
42
37
 
38
+ }
39
+ }
43
40
 
44
41
  UpdateResultVariableBehavior.$inject = [
45
42
  'eventBus'
46
43
  ];
47
44
 
48
- inherits(UpdateResultVariableBehavior, CommandInterceptor);
49
-
50
45
 
51
- // helper //////////////////
46
+ // helpers //////////
52
47
 
53
48
  function isEmpty(value) {
54
49
  return value == undefined || value === '';
@@ -1,18 +1,24 @@
1
1
  import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
2
2
 
3
- import { isUndefined } from 'min-dash';
3
+ import {
4
+ has,
5
+ isUndefined
6
+ } from 'min-dash';
4
7
 
5
8
 
6
9
  /**
7
- * Camunda BPMN specific user task forms behavior ensuring that only one of the following options is configured:
8
- *
9
- * 1. embedded, external or Camunda forms using camunda:formKey
10
- * 2. Camunda forms using camunda:formRef
10
+ * Camunda BPMN specific user task forms behavior.
11
11
  */
12
12
  export default class UserTaskFormsBehavior extends CommandInterceptor {
13
13
  constructor(eventBus) {
14
14
  super(eventBus);
15
15
 
16
+ /**
17
+ * Ensure that only one of the following options is configured:
18
+ *
19
+ * 1. embedded, external or Camunda forms using camunda:formKey
20
+ * 2. Camunda forms using camunda:formRef
21
+ */
16
22
  this.preExecute([
17
23
  'element.updateProperties',
18
24
  'element.updateModdleProperties',
@@ -26,13 +32,13 @@ export default class UserTaskFormsBehavior extends CommandInterceptor {
26
32
  context.element.businessObject
27
33
  );
28
34
 
29
- if ('camunda:formKey' in properties) {
35
+ if (has(properties, 'camunda:formKey')) {
30
36
  Object.assign(properties, {
31
37
  'camunda:formRef': undefined,
32
38
  'camunda:formRefBinding': undefined,
33
39
  'camunda:formRefVersion': undefined
34
40
  });
35
- } else if ('camunda:formRef' in properties) {
41
+ } else if (has(properties, 'camunda:formRef')) {
36
42
  Object.assign(properties, {
37
43
  'camunda:formKey': undefined
38
44
  });
@@ -44,21 +50,21 @@ export default class UserTaskFormsBehavior extends CommandInterceptor {
44
50
  });
45
51
  }
46
52
 
47
- if (!('camunda:formRefBinding' in properties) && isUndefined(businessObject.get('camunda:formRefBinding'))) {
53
+ if (!has(properties, 'camunda:formRefBinding') && isUndefined(businessObject.get('camunda:formRefBinding'))) {
48
54
  Object.assign(properties, {
49
55
  'camunda:formRefBinding': 'latest'
50
56
  });
51
57
  }
52
58
  }
53
59
 
54
- if ('camunda:formRefBinding' in properties && properties[ 'camunda:formRefBinding' ] !== 'version') {
60
+ if (has(properties, 'camunda:formRefBinding') && properties[ 'camunda:formRefBinding' ] !== 'version') {
55
61
  Object.assign(properties, {
56
62
  'camunda:formRefVersion': undefined
57
63
  });
58
64
  }
59
65
  }, true);
66
+
60
67
  }
61
68
  }
62
69
 
63
-
64
70
  UserTaskFormsBehavior.$inject = [ 'eventBus' ];
@@ -0,0 +1,29 @@
1
+ import { is } from 'bpmn-js/lib/util/ModelUtil';
2
+
3
+
4
+ export function getInputOutput(businessObject) {
5
+ const extensionElements = businessObject.get('extensionElements');
6
+
7
+ if (!extensionElements) {
8
+ return;
9
+ }
10
+
11
+ return extensionElements.get('values').find((value) => {
12
+ return is(value, 'camunda:InputOutput');
13
+ });
14
+ }
15
+
16
+ export function getInputParameters(inputOutput) {
17
+ return inputOutput.get('inputParameters');
18
+ }
19
+
20
+ export function getOutputParameters(inputOutput) {
21
+ return inputOutput.get('outputParameters');
22
+ }
23
+
24
+ export function isInputOutputEmpty(inputOutput) {
25
+ const inputParameters = getInputParameters(inputOutput);
26
+ const outputParameters = getOutputParameters(inputOutput);
27
+
28
+ return !inputParameters.length && !outputParameters.length;
29
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camunda-bpmn-js",
3
- "version": "0.11.5",
3
+ "version": "0.13.0-alpha.0",
4
4
  "description": "Embeddable Camunda modeling distributions based on bpmn-js",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -40,10 +40,11 @@
40
40
  "license": "MIT",
41
41
  "dependencies": {
42
42
  "@bpmn-io/align-to-origin": "^0.7.0",
43
- "bpmn-js": "^8.8.2",
43
+ "@bpmn-io/properties-panel": "~0.10.0",
44
+ "bpmn-js": "^8.8.3",
44
45
  "bpmn-js-disable-collapsed-subprocess": "^0.1.3",
45
46
  "bpmn-js-executable-fix": "^0.1.3",
46
- "bpmn-js-properties-panel": "^0.46.0",
47
+ "bpmn-js-properties-panel": "~1.0.0-alpha.0",
47
48
  "bpmn-js-signavio-compat": "^1.2.3",
48
49
  "camunda-bpmn-moddle": "^6.1.1",
49
50
  "diagram-js": "^7.5.0",
@@ -51,7 +52,7 @@
51
52
  "diagram-js-origin": "^1.3.2",
52
53
  "inherits": "^2.0.4",
53
54
  "min-dash": "^3.7.0",
54
- "zeebe-bpmn-moddle": "^0.8.0"
55
+ "zeebe-bpmn-moddle": "^0.10.0"
55
56
  },
56
57
  "devDependencies": {
57
58
  "@rollup/plugin-commonjs": "^17.1.0",
@@ -75,7 +76,7 @@
75
76
  "karma-sinon-chai": "^2.0.2",
76
77
  "karma-webpack": "^5.0.0",
77
78
  "min-dom": "^3.1.3",
78
- "mocha": "^8.2.1",
79
+ "mocha": "^9.1.3",
79
80
  "mocha-test-container-support": "^0.2.0",
80
81
  "npm-run-all": "^4.1.5",
81
82
  "puppeteer": "^8.0.0",
@@ -1,4 +1,4 @@
1
1
  @import './diagram-js.css';
2
2
  @import './bpmn-font/css/bpmn-embedded.css';
3
3
  @import './diagram-js-minimap.css';
4
- @import './bpmn-js-properties-panel.css';
4
+ @import './properties-panel.css';
@@ -1 +1,2 @@
1
- @import './base-modeler.css';
1
+ @import './base-modeler.css';
2
+ @import './element-templates.css';