camunda-bpmn-js 0.13.0-alpha.7 → 0.13.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 (88) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/dist/assets/base-navigated-viewer.css +2 -0
  3. package/dist/assets/base-viewer.css +2 -0
  4. package/dist/assets/camunda-cloud-navigated-viewer.css +1 -0
  5. package/dist/assets/camunda-cloud-viewer.css +1 -0
  6. package/dist/assets/camunda-platform-navigated-viewer.css +1 -0
  7. package/dist/assets/camunda-platform-viewer.css +1 -0
  8. package/dist/base-modeler.development.js +32 -6
  9. package/dist/base-modeler.production.min.js +1 -1
  10. package/dist/base-navigated-viewer.development.js +22218 -0
  11. package/dist/base-navigated-viewer.production.min.js +2 -0
  12. package/dist/base-viewer.development.js +21227 -0
  13. package/dist/base-viewer.production.min.js +2 -0
  14. package/dist/camunda-cloud-modeler.development.js +1380 -456
  15. package/dist/camunda-cloud-modeler.production.min.js +4 -4
  16. package/dist/camunda-cloud-navigated-viewer.development.js +23041 -0
  17. package/dist/camunda-cloud-navigated-viewer.production.min.js +2 -0
  18. package/dist/camunda-cloud-viewer.development.js +22050 -0
  19. package/dist/camunda-cloud-viewer.production.min.js +2 -0
  20. package/dist/camunda-platform-modeler.development.js +1657 -1340
  21. package/dist/camunda-platform-modeler.production.min.js +4 -4
  22. package/dist/camunda-platform-navigated-viewer.development.js +23413 -0
  23. package/dist/camunda-platform-navigated-viewer.production.min.js +2 -0
  24. package/dist/camunda-platform-viewer.development.js +22422 -0
  25. package/dist/camunda-platform-viewer.production.min.js +2 -0
  26. package/lib/base/NavigatedViewer.js +3 -0
  27. package/lib/base/Viewer.js +3 -0
  28. package/lib/camunda-cloud/Modeler.js +6 -7
  29. package/lib/camunda-cloud/NavigatedViewer.js +34 -0
  30. package/lib/camunda-cloud/Viewer.js +34 -0
  31. package/lib/camunda-cloud/util/commonModules.js +14 -0
  32. package/lib/camunda-platform/Modeler.js +5 -5
  33. package/lib/camunda-platform/NavigatedViewer.js +25 -0
  34. package/lib/camunda-platform/Viewer.js +24 -0
  35. package/lib/camunda-platform/util/commonModules.js +7 -0
  36. package/package.json +13 -7
  37. package/styles/base-navigated-viewer.css +2 -0
  38. package/styles/base-viewer.css +2 -0
  39. package/styles/camunda-cloud-navigated-viewer.css +1 -0
  40. package/styles/camunda-cloud-viewer.css +1 -0
  41. package/styles/camunda-platform-navigated-viewer.css +1 -0
  42. package/styles/camunda-platform-viewer.css +1 -0
  43. package/util/index.js +39 -0
  44. package/dist/assets/bpmn-font/bpmn-codes.css +0 -108
  45. package/dist/assets/bpmn-font/bpmn-embedded.css +0 -161
  46. package/dist/assets/bpmn-font/bpmn.css +0 -164
  47. package/dist/assets/bpmn-font/bpmn.eot +0 -0
  48. package/dist/assets/bpmn-font/bpmn.svg +0 -224
  49. package/dist/assets/bpmn-font/bpmn.ttf +0 -0
  50. package/dist/assets/bpmn-font/bpmn.woff +0 -0
  51. package/dist/assets/bpmn-font/bpmn.woff2 +0 -0
  52. package/dist/assets/bpmn-font/css/bpmn-codes.css +0 -108
  53. package/dist/assets/bpmn-font/css/bpmn-embedded.css +0 -161
  54. package/dist/assets/bpmn-font/css/bpmn.css +0 -164
  55. package/dist/assets/bpmn-font/font/bpmn.eot +0 -0
  56. package/dist/assets/bpmn-font/font/bpmn.svg +0 -224
  57. package/dist/assets/bpmn-font/font/bpmn.ttf +0 -0
  58. package/dist/assets/bpmn-font/font/bpmn.woff +0 -0
  59. package/dist/assets/bpmn-font/font/bpmn.woff2 +0 -0
  60. package/dist/assets/bpmn-js.css +0 -116
  61. package/dist/assets/diagram-js-minimap.css +0 -87
  62. package/dist/assets/diagram-js.css +0 -819
  63. package/dist/assets/element-templates.css +0 -75
  64. package/dist/assets/properties-panel.css +0 -902
  65. package/lib/camunda-cloud/features/modeling/behavior/CleanUpBusinessRuleTaskBehavior.js +0 -115
  66. package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeBoundaryEventBehavior.js +0 -76
  67. package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +0 -86
  68. package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +0 -138
  69. package/lib/camunda-cloud/features/modeling/behavior/RemoveAssignmentDefinitionBehavior.js +0 -51
  70. package/lib/camunda-cloud/features/modeling/behavior/UpdatePropagateAllChildVariablesBehavior.js +0 -136
  71. package/lib/camunda-cloud/features/modeling/behavior/index.js +0 -24
  72. package/lib/camunda-cloud/features/modeling/index.js +0 -7
  73. package/lib/camunda-cloud/helper/CalledElementHelper.js +0 -72
  74. package/lib/camunda-cloud/helper/ElementHelper.js +0 -18
  75. package/lib/camunda-cloud/helper/FormsHelper.js +0 -84
  76. package/lib/camunda-cloud/helper/InputOutputHelper.js +0 -138
  77. package/lib/camunda-cloud/helper/Utils.js +0 -10
  78. package/lib/camunda-cloud/helper/ZeebeServiceTaskHelper.js +0 -41
  79. package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js +0 -54
  80. package/lib/camunda-platform/features/modeling/behavior/DeleteRetryTimeCycleBehavior.js +0 -96
  81. package/lib/camunda-platform/features/modeling/behavior/UpdateCamundaExclusiveBehavior.js +0 -68
  82. package/lib/camunda-platform/features/modeling/behavior/UpdateInputOutputBehavior.js +0 -44
  83. package/lib/camunda-platform/features/modeling/behavior/UpdateResultVariableBehavior.js +0 -54
  84. package/lib/camunda-platform/features/modeling/behavior/UserTaskFormsBehavior.js +0 -71
  85. package/lib/camunda-platform/features/modeling/behavior/UserTaskGeneratedFormsBehavior.js +0 -116
  86. package/lib/camunda-platform/features/modeling/behavior/index.js +0 -26
  87. package/lib/camunda-platform/features/modeling/index.js +0 -7
  88. package/lib/camunda-platform/helper/InputOutputHelper.js +0 -29
@@ -1,115 +0,0 @@
1
- import {
2
- getBusinessObject,
3
- is
4
- } from 'bpmn-js/lib/util/ModelUtil';
5
-
6
- import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
7
-
8
- import { without } from 'min-dash';
9
-
10
- import { getExtensionElementsList } from '../../../../util/ExtensionElementsUtil';
11
-
12
- const HIGH_PRIORITY = 5000;
13
-
14
-
15
- /**
16
- * Zeebe BPMN behavior ensuring that bpmn:BusinessRuleTask only has one of the following:
17
- *
18
- * (1) zeebe:CalledDecision
19
- * (2) zeebe:TaskDefinition and zeebe:TaskHeaders
20
- */
21
- export default class CleanUpBusinessRuleTaskBehavior extends CommandInterceptor {
22
- constructor(commandStack, eventBus) {
23
- super(eventBus);
24
-
25
- /**
26
- * Remove zeebe:CalledDecision if zeebe:TaskDefinition is about to be added.
27
- */
28
- this.preExecute('element.updateModdleProperties' , HIGH_PRIORITY, function(context) {
29
- const {
30
- element,
31
- moddleElement,
32
- properties
33
- } = context;
34
-
35
- if (
36
- !is(element, 'bpmn:BusinessRuleTask')
37
- || !is(moddleElement, 'bpmn:ExtensionElements')
38
- || !properties.values
39
- ) {
40
- return;
41
- }
42
-
43
- const calledDecision = getCalledDecision(element),
44
- taskDefinition = getTaskDefinition(element);
45
-
46
- if (
47
- calledDecision
48
- && !taskDefinition
49
- && properties.values.find(value => is(value, 'zeebe:CalledDecision'))
50
- && properties.values.find(value => is(value, 'zeebe:TaskDefinition'))
51
- ) {
52
- properties.values = without(properties.values, calledDecision);
53
- }
54
- }, true);
55
-
56
- /**
57
- * Remove zeebe:TaskDefinition and zeebe:TaskHeaders if zeebe:CalledDecision is about to be added.
58
- */
59
- this.preExecute('element.updateModdleProperties', HIGH_PRIORITY, function(context) {
60
- const {
61
- element,
62
- moddleElement,
63
- properties
64
- } = context;
65
-
66
- if (
67
- !is(element, 'bpmn:BusinessRuleTask')
68
- || !is(moddleElement, 'bpmn:ExtensionElements')
69
- || !properties.values
70
- ) {
71
- return;
72
- }
73
-
74
- const calledDecision = getCalledDecision(element),
75
- taskDefinition = getTaskDefinition(element),
76
- taskHeaders = getTaskHeaders(element);
77
-
78
- if (
79
- !calledDecision
80
- && (taskDefinition || taskHeaders)
81
- && properties.values.find(value => is(value, 'zeebe:CalledDecision'))
82
- && properties.values.find(value => is(value, 'zeebe:TaskDefinition') || is(value, 'zeebe:TaskHeaders'))
83
- ) {
84
- properties.values = without(properties.values, (value) => value === taskDefinition || value === taskHeaders);
85
- }
86
- }, true);
87
-
88
- }
89
- }
90
-
91
- CleanUpBusinessRuleTaskBehavior.$inject = [
92
- 'commandStack',
93
- 'eventBus'
94
- ];
95
-
96
-
97
- // helpers //////////
98
-
99
- function getCalledDecision(element) {
100
- const businessObject = getBusinessObject(element);
101
-
102
- return getExtensionElementsList(businessObject, 'zeebe:CalledDecision')[ 0 ];
103
- }
104
-
105
- function getTaskDefinition(element) {
106
- const businessObject = getBusinessObject(element);
107
-
108
- return getExtensionElementsList(businessObject, 'zeebe:TaskDefinition')[ 0 ];
109
- }
110
-
111
- function getTaskHeaders(element) {
112
- const businessObject = getBusinessObject(element);
113
-
114
- return getExtensionElementsList(businessObject, 'zeebe:TaskHeaders')[ 0 ];
115
- }
@@ -1,76 +0,0 @@
1
- import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
2
-
3
- import {
4
- getBusinessObject,
5
- is
6
- } from 'bpmn-js/lib/util/ModelUtil';
7
-
8
- const HIGH_PRIORITY = 5000;
9
-
10
-
11
- /**
12
- * Zeebe BPMN specific behavior for creating boundary events.
13
- */
14
- export default class CreateZeebeBoundaryEventBehavior extends CommandInterceptor {
15
- constructor(bpmnFactory, elementFactory, eventBus) {
16
- super(eventBus);
17
-
18
- /**
19
- * Replace intermediate catch event with boundary event when attaching it to a shape.
20
- */
21
- this.preExecute('shape.create', HIGH_PRIORITY, function(context) {
22
- const {
23
- shape,
24
- host
25
- } = context;
26
-
27
- const businessObject = getBusinessObject(shape);
28
-
29
- let attrs = {
30
- cancelActivity: true
31
- };
32
-
33
- let newBusinessObject,
34
- hostBusinessObject,
35
- boundaryEvent,
36
- eventDefinitions;
37
-
38
- if (!host || !is(shape, 'bpmn:IntermediateCatchEvent')) {
39
- return;
40
- }
41
-
42
- hostBusinessObject = getBusinessObject(host);
43
-
44
- attrs = {
45
- ...attrs,
46
- attachedToRef: hostBusinessObject
47
- };
48
-
49
- eventDefinitions = businessObject.eventDefinitions;
50
-
51
- newBusinessObject = bpmnFactory.create('bpmn:BoundaryEvent', attrs);
52
-
53
- boundaryEvent = {
54
- type: 'bpmn:BoundaryEvent',
55
- businessObject: newBusinessObject,
56
- };
57
-
58
- if (eventDefinitions && eventDefinitions[0]) {
59
- boundaryEvent = {
60
- ...boundaryEvent,
61
- eventDefinitionType: eventDefinitions[0].$type
62
- };
63
- }
64
-
65
- context.shape = elementFactory.createShape(boundaryEvent);
66
-
67
- }, true);
68
-
69
- }
70
- }
71
-
72
- CreateZeebeBoundaryEventBehavior.$inject = [
73
- 'bpmnFactory',
74
- 'elementFactory',
75
- 'eventBus'
76
- ];
@@ -1,86 +0,0 @@
1
- import { has } from 'min-dash';
2
-
3
- import { createElement } from '../../../helper/ElementHelper';
4
-
5
- import { getCalledElement } from '../../../helper/CalledElementHelper';
6
-
7
- import {
8
- getBusinessObject,
9
- is
10
- } from 'bpmn-js/lib/util/ModelUtil';
11
-
12
- import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
13
-
14
- const HIGH_PRIORITY = 5000;
15
-
16
-
17
- /**
18
- * Zeebe BPMN specific behavior for creating call activities.
19
- */
20
- export default class CreateZeebeCallActivityBehavior extends CommandInterceptor {
21
- constructor(bpmnFactory, eventBus, modeling) {
22
- super(eventBus);
23
-
24
- /**
25
- * Add zeebe:CalledElement extension element with zeebe:propagateAllChildVariables attribute = false
26
- * when creating bpmn:CallActivity.
27
- */
28
- this.postExecuted('shape.create', HIGH_PRIORITY, function(context) {
29
- const { shape } = context;
30
-
31
- if (!is(shape, 'bpmn:CallActivity')) {
32
- return;
33
- }
34
-
35
- const businessObject = getBusinessObject(shape);
36
-
37
- let calledElement = getCalledElement(businessObject);
38
-
39
- if (!calledElement) {
40
- let extensionElements = businessObject.get('extensionElements');
41
-
42
- if (!extensionElements) {
43
- extensionElements = createElement(
44
- 'bpmn:ExtensionElements',
45
- {
46
- values: []
47
- },
48
- businessObject,
49
- bpmnFactory
50
- );
51
-
52
- modeling.updateProperties(shape, { extensionElements });
53
- }
54
-
55
- calledElement = createElement(
56
- 'zeebe:CalledElement',
57
- {
58
- propagateAllChildVariables: false
59
- },
60
- extensionElements,
61
- bpmnFactory
62
- );
63
-
64
- modeling.updateModdleProperties(shape, extensionElements, {
65
- values: [
66
- ...(extensionElements.values || []),
67
- calledElement
68
- ]
69
- });
70
- } else if (!has(calledElement, 'propagateAllChildVariables')) {
71
-
72
- // set zeebe:propagateAllChildVariables to false if zeebe:CalledElement exists
73
- modeling.updateModdleProperties(shape, calledElement, {
74
- propagateAllChildVariables: false
75
- });
76
- }
77
- }, true);
78
-
79
- }
80
- }
81
-
82
- CreateZeebeCallActivityBehavior.$inject = [
83
- 'bpmnFactory',
84
- 'eventBus',
85
- 'modeling'
86
- ];
@@ -1,138 +0,0 @@
1
-
2
- import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
3
-
4
- import { createElement } from '../../../helper/ElementHelper';
5
-
6
- import {
7
- getBusinessObject,
8
- is
9
- } from 'bpmn-js/lib/util/ModelUtil';
10
-
11
- import {
12
- createFormDefinition,
13
- createFormId,
14
- createFormKey,
15
- createUserTaskForm,
16
- getFormDefinition,
17
- getUserTaskForm
18
- } from '../../../helper/FormsHelper';
19
-
20
-
21
- /**
22
- * Zeebe BPMN specific form definition behavior.
23
- */
24
- export default class FormDefinitionBehavior extends CommandInterceptor {
25
- constructor(bpmnFactory, eventBus, modeling) {
26
- super(eventBus);
27
-
28
- /**
29
- * Remove zeebe:UserTaskForm on user task removed.
30
- */
31
- this.postExecute('shape.delete', function(context) {
32
- const {
33
- oldParent,
34
- shape
35
- } = context;
36
-
37
- const rootElement = getRootElement(oldParent);
38
-
39
- const userTaskForm = getUserTaskForm(shape, rootElement);
40
-
41
- if (!is(shape, 'bpmn:UserTask') || !userTaskForm) {
42
- return;
43
- }
44
-
45
- const rootExtensionElements = rootElement.get('extensionElements');
46
-
47
- const values = rootExtensionElements.get('values').filter((element) => {
48
- return element !== userTaskForm;
49
- });
50
-
51
- modeling.updateModdleProperties(shape, rootExtensionElements, { values });
52
- }, true);
53
-
54
-
55
- /**
56
- * Create new zeebe:FormDefinition and zeebe:UserTaskForm on user task created.
57
- */
58
- this.postExecute('shape.create', function(context) {
59
- const { shape } = context;
60
-
61
- const oldFormDefinition = getFormDefinition(shape);
62
-
63
- if (!is(shape, 'bpmn:UserTask') || !oldFormDefinition) {
64
- return;
65
- }
66
-
67
- const oldUserTaskForm = getUserTaskForm(shape);
68
-
69
- const rootElement = getRootElement(shape);
70
-
71
- const businessObject = getBusinessObject(shape);
72
-
73
- const extensionElements = businessObject.get('extensionElements');
74
-
75
- let rootExtensionElements = rootElement.get('extensionElements');
76
-
77
- // (1) ensure extension elements exists
78
- if (!rootExtensionElements) {
79
- rootExtensionElements = createElement('bpmn:ExtensionElements', { values: [] }, rootElement, bpmnFactory);
80
-
81
- modeling.updateModdleProperties(shape, rootElement, { extensionElements: rootExtensionElements });
82
- }
83
-
84
- // (2) remove existing form definition
85
- let values = extensionElements.get('values').filter((element) => {
86
- return element !== oldFormDefinition;
87
- });
88
-
89
- // (3) create new form definition
90
- const formId = createFormId();
91
-
92
- const newFormDefinition = createFormDefinition({ formKey: createFormKey(formId) }, extensionElements, bpmnFactory);
93
-
94
- values = [
95
- ...values,
96
- newFormDefinition
97
- ];
98
-
99
- modeling.updateModdleProperties(shape, extensionElements, {
100
- values
101
- });
102
-
103
- // (4) create new user task form
104
- const userTaskForm = createUserTaskForm({
105
- id: formId,
106
- body: oldUserTaskForm ? oldUserTaskForm.get('body') : ''
107
- }, rootExtensionElements, bpmnFactory);
108
-
109
- modeling.updateModdleProperties(shape, rootExtensionElements, {
110
- values: [
111
- ...(rootExtensionElements.get('values') || []),
112
- userTaskForm
113
- ]
114
- });
115
- }, true);
116
-
117
- }
118
- }
119
-
120
- FormDefinitionBehavior.$inject = [
121
- 'bpmnFactory',
122
- 'eventBus',
123
- 'modeling'
124
- ];
125
-
126
-
127
- // helpers //////////////
128
-
129
- function getRootElement(element) {
130
- var businessObject = getBusinessObject(element),
131
- parent = businessObject;
132
-
133
- while (parent.$parent && !is(parent, 'bpmn:Process')) {
134
- parent = parent.$parent;
135
- }
136
-
137
- return parent;
138
- }
@@ -1,51 +0,0 @@
1
- import { is } from 'bpmn-js/lib/util/ModelUtil';
2
-
3
- import { getBusinessObject } from 'bpmn-js/lib/util/ModelUtil';
4
-
5
- import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
6
-
7
- import { isUndefined } from 'min-dash';
8
-
9
- import { removeExtensionElements } from '../../../../util/ExtensionElementsUtil';
10
-
11
- const HIGH_PRIORITY = 5000;
12
-
13
-
14
- /**
15
- * Zeebe BPMN behavior removing zeebe:AssignmentDefinition elements without
16
- * zeebe:assignee and zeebe:candidateGroups.
17
- */
18
- export default class CleanUpBusinessRuleTaskBehavior extends CommandInterceptor {
19
- constructor(commandStack, eventBus) {
20
- super(eventBus);
21
-
22
- this.postExecuted('element.updateModdleProperties' , HIGH_PRIORITY, function(context) {
23
- const {
24
- element,
25
- moddleElement
26
- } = context;
27
-
28
- if (!is(moddleElement, 'zeebe:AssignmentDefinition')) {
29
- return;
30
- }
31
-
32
- const assignmentDefinition = moddleElement;
33
-
34
- if (
35
- is(element, 'bpmn:UserTask')
36
- && isUndefined(assignmentDefinition.get('zeebe:assignee'))
37
- && isUndefined(assignmentDefinition.get('zeebe:candidateGroups'))
38
- ) {
39
- const businessObject = getBusinessObject(element);
40
-
41
- removeExtensionElements(element, businessObject, assignmentDefinition, commandStack);
42
- }
43
- }, true);
44
-
45
- }
46
- }
47
-
48
- CleanUpBusinessRuleTaskBehavior.$inject = [
49
- 'commandStack',
50
- 'eventBus'
51
- ];
@@ -1,136 +0,0 @@
1
- import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
2
-
3
- import {
4
- getBusinessObject,
5
- is
6
- } from 'bpmn-js/lib/util/ModelUtil';
7
-
8
- import {
9
- getCalledElement,
10
- isPropagateAllChildVariables
11
- } from '../../../helper/CalledElementHelper';
12
-
13
- import {
14
- getInputParameters,
15
- getOutputParameters,
16
- getIoMapping
17
- } from '../../../helper/InputOutputHelper';
18
-
19
- import {
20
- removeExtensionElements
21
- } from '../../../../util/ExtensionElementsUtil';
22
-
23
- const HIGH_PRIORITY = 5000;
24
-
25
-
26
- /**
27
- * Zeebe BPMN behavior for updating bpmn:CallActivity elements
28
- * ensuring that only one of the following is true:
29
- *
30
- * (1) zeebe:propagateAllChildVariables of zeebe:CalledElement is set to true
31
- * (2) zeebe:IoMapping extension element has zeebe:Output elements
32
- */
33
- export default class UpdatePropagateAllChildVariablesBehavior extends CommandInterceptor {
34
- constructor(commandStack, eventBus, modeling) {
35
- super(eventBus);
36
-
37
- /**
38
- * Remove zeebe:Output elements if zeebe:propagateAllChildVariables is set to true.
39
- * Remove zeebe:IoMapping extension element if empty.
40
- */
41
- this.postExecute('element.updateModdleProperties' , HIGH_PRIORITY, function(context) {
42
- const {
43
- element,
44
- moddleElement,
45
- properties = {}
46
- } = context;
47
-
48
- const propagateAllChildVariables = properties.propagateAllChildVariables || properties[ 'zeebe:propagateAllChildVariables' ];
49
-
50
- if (
51
- !is(element, 'bpmn:CallActivity')
52
- || !is(moddleElement, 'zeebe:CalledElement')
53
- || !propagateAllChildVariables
54
- ) {
55
- return;
56
- }
57
-
58
- const inputParameters = getInputParameters(element),
59
- outputParameters = getOutputParameters(element);
60
-
61
- if (!outputParameters || !outputParameters.length) {
62
- return;
63
- }
64
-
65
- const ioMapping = getIoMapping(element);
66
-
67
- modeling.updateModdleProperties(element, ioMapping, {
68
- 'zeebe:outputParameters': []
69
- });
70
-
71
- if (!inputParameters || !inputParameters.length) {
72
- removeExtensionElements(element, getBusinessObject(element), ioMapping, commandStack);
73
- }
74
- }, true);
75
-
76
-
77
- /**
78
- * Set zeebe:propagateAllChildVariables of zeebe:CalledElement to false if
79
- * zeebe:Output or zeebe:IoMapping with zeebe:Output is added.
80
- */
81
- this.preExecute('element.updateModdleProperties' , HIGH_PRIORITY, function(context) {
82
- const {
83
- element,
84
- moddleElement,
85
- properties
86
- } = context;
87
-
88
- if (
89
- !is(element, 'bpmn:CallActivity')
90
- || !isPropagateAllChildVariables(element)
91
- ) {
92
- return;
93
- }
94
-
95
- const businessObject = getBusinessObject(element),
96
- calledElement = getCalledElement(businessObject);
97
-
98
- // (1) zeebe:IoMapping extension element with zeebe:Output added
99
- if (
100
- is(moddleElement, 'bpmn:ExtensionElements')
101
- && properties.values
102
- ) {
103
- const ioMapping = properties.values.find((value) => is(value, 'zeebe:IoMapping'));
104
-
105
- if (
106
- ioMapping
107
- && ioMapping.get('outputParameters').length
108
- && !getIoMapping(element)
109
- ) {
110
- modeling.updateModdleProperties(element, calledElement, {
111
- 'zeebe:propagateAllChildVariables': false
112
- });
113
- }
114
- }
115
-
116
- // (2) zeebe:Output added
117
- if (is(moddleElement, 'zeebe:IoMapping')) {
118
- const outputParameters = properties.outputParameters || properties[ 'zeebe:outputParameters' ];
119
-
120
- if (outputParameters && outputParameters.length) {
121
- modeling.updateModdleProperties(element, calledElement, {
122
- 'zeebe:propagateAllChildVariables': false
123
- });
124
- }
125
- }
126
-
127
- }, true);
128
-
129
- }
130
- }
131
-
132
- UpdatePropagateAllChildVariablesBehavior.$inject = [
133
- 'commandStack',
134
- 'eventBus',
135
- 'modeling'
136
- ];
@@ -1,24 +0,0 @@
1
- import CleanUpBusinessRuleTaskBehavior from './CleanUpBusinessRuleTaskBehavior';
2
- import CreateZeebeBoundaryEventBehavior from './CreateZeebeBoundaryEventBehavior';
3
- import CreateZeebeCallActivityBehavior from './CreateZeebeCallActivityBehavior';
4
- import FormDefinitionBehavior from './FormDefinitionBehavior';
5
- import RemoveAssignmentDefinitionBehavior from './RemoveAssignmentDefinitionBehavior';
6
- import UpdatePropagateAllChildVariablesBehavior from './UpdatePropagateAllChildVariablesBehavior';
7
-
8
-
9
- export default {
10
- __init__: [
11
- 'cleanUpBusinessRuleTaskBehavior',
12
- 'createZeebeBoundaryEventBehavior',
13
- 'createZeebeCallActivityBehavior',
14
- 'formDefinitionBehavior',
15
- 'removeAssignmentDefinitionBehavior',
16
- 'updatePropagateAllChildVariablesBehavior'
17
- ],
18
- cleanUpBusinessRuleTaskBehavior: [ 'type', CleanUpBusinessRuleTaskBehavior ],
19
- createZeebeBoundaryEventBehavior: [ 'type', CreateZeebeBoundaryEventBehavior ],
20
- createZeebeCallActivityBehavior: [ 'type', CreateZeebeCallActivityBehavior ],
21
- formDefinitionBehavior: [ 'type', FormDefinitionBehavior ],
22
- removeAssignmentDefinitionBehavior: [ 'type', RemoveAssignmentDefinitionBehavior ],
23
- updatePropagateAllChildVariablesBehavior: [ 'type', UpdatePropagateAllChildVariablesBehavior ]
24
- };
@@ -1,7 +0,0 @@
1
- import zeebeModelingBehaviors from './behavior';
2
-
3
- export default {
4
- __depends__: [
5
- zeebeModelingBehaviors
6
- ]
7
- };