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.
- package/CHANGELOG.md +22 -5
- package/dist/base-modeler.development.js +89 -1060
- package/dist/base-modeler.production.min.js +3 -3
- package/dist/camunda-cloud-modeler.development.js +734 -1570
- package/dist/camunda-cloud-modeler.production.min.js +3 -3
- package/dist/camunda-platform-modeler.development.js +291 -1354
- package/dist/camunda-platform-modeler.production.min.js +3 -3
- package/lib/camunda-cloud/features/modeling/behavior/CleanUpAssignmentDefinitionBehavior.js +78 -0
- package/lib/camunda-cloud/features/modeling/behavior/CleanUpBusinessRuleTaskBehavior.js +112 -0
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeBoundaryEventBehavior.js +51 -55
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +56 -59
- package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +69 -127
- package/lib/camunda-cloud/features/modeling/behavior/UpdatePropagateAllChildVariablesBehavior.js +76 -128
- package/lib/camunda-cloud/features/modeling/behavior/index.js +6 -0
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/InputOutput.js +21 -7
- package/lib/camunda-cloud/features/rules/BpmnRules.js +1 -1
- package/lib/camunda-cloud/helper/CalledElementHelper.js +43 -41
- package/lib/camunda-cloud/helper/FormsHelper.js +38 -50
- package/lib/camunda-cloud/helper/InputOutputHelper.js +92 -106
- package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js +24 -47
- package/lib/camunda-platform/features/modeling/behavior/DeleteRetryTimeCycleBehavior.js +39 -81
- package/lib/camunda-platform/features/modeling/behavior/UpdateCamundaExclusiveBehavior.js +31 -65
- package/lib/camunda-platform/features/modeling/behavior/UpdateInputOutputBehavior.js +42 -76
- package/lib/camunda-platform/features/modeling/behavior/UpdateResultVariableBehavior.js +21 -26
- package/lib/camunda-platform/features/modeling/behavior/UserTaskFormsBehavior.js +16 -10
- package/lib/camunda-platform/helper/InputOutputHelper.js +29 -0
- package/package.json +5 -5
|
@@ -1,70 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
has
|
|
3
|
-
} from 'min-dash';
|
|
1
|
+
import { has } from 'min-dash';
|
|
4
2
|
|
|
5
|
-
import {
|
|
6
|
-
getOutputParameters
|
|
7
|
-
} from './InputOutputHelper';
|
|
3
|
+
import { getOutputParameters } from './InputOutputHelper';
|
|
8
4
|
|
|
9
|
-
import {
|
|
10
|
-
getExtensionElements
|
|
11
|
-
} from 'bpmn-js-properties-panel/lib/helper/ExtensionElementsHelper';
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
getBusinessObject
|
|
15
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
5
|
+
import { getExtensionElements } from 'bpmn-js-properties-panel/lib/helper/ExtensionElementsHelper';
|
|
16
6
|
|
|
17
7
|
import {
|
|
8
|
+
getBusinessObject,
|
|
18
9
|
is
|
|
19
10
|
} from 'bpmn-js/lib/util/ModelUtil';
|
|
20
11
|
|
|
12
|
+
|
|
21
13
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
* Get default value for zeebe:propagateAllChildVariables.
|
|
15
|
+
*
|
|
16
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
17
|
+
*
|
|
18
|
+
* @returns {boolean}
|
|
19
|
+
*/
|
|
20
|
+
function getPropagateAllChildVariablesDefault(element) {
|
|
21
|
+
if (!is(element, 'bpmn:CallActivity')) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
28
25
|
const outputParameters = getOutputParameters(element);
|
|
29
26
|
|
|
30
27
|
if (outputParameters) {
|
|
31
|
-
return
|
|
28
|
+
return !outputParameters.length;
|
|
32
29
|
}
|
|
33
30
|
}
|
|
34
31
|
|
|
35
32
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
* Get zeebe:CalledElement of an element.
|
|
34
|
+
*
|
|
35
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
36
|
+
*
|
|
37
|
+
* @returns {ModdleElement}
|
|
38
|
+
*/
|
|
41
39
|
export function getCalledElement(element) {
|
|
42
40
|
const calledElements = getCalledElements(element);
|
|
43
|
-
|
|
41
|
+
|
|
42
|
+
return calledElements[ 0 ];
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
export function getCalledElements(element) {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
return
|
|
46
|
+
const businessObject = getBusinessObject(element);
|
|
47
|
+
|
|
48
|
+
return getExtensionElements(businessObject, 'zeebe:CalledElement');
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
* Check whether zeebe:propagateAllChildVariables is set on an element.
|
|
53
|
+
* Fall back to default if zeebe:propagateAllChildVariables not set.
|
|
54
|
+
*
|
|
55
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
56
|
+
*
|
|
57
|
+
* @returns {boolean}
|
|
58
|
+
*/
|
|
59
59
|
export function isPropagateAllChildVariables(element) {
|
|
60
60
|
if (!is(element, 'bpmn:CallActivity')) {
|
|
61
|
-
return
|
|
61
|
+
return;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
const
|
|
65
|
-
calledElement = getCalledElement(
|
|
64
|
+
const businessObject = getBusinessObject(element),
|
|
65
|
+
calledElement = getCalledElement(businessObject);
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
calledElement.get('propagateAllChildVariables')
|
|
69
|
-
|
|
67
|
+
if (calledElement && has(calledElement, 'propagateAllChildVariables')) {
|
|
68
|
+
return calledElement.get('propagateAllChildVariables');
|
|
69
|
+
} else {
|
|
70
|
+
return getPropagateAllChildVariablesDefault(element);
|
|
71
|
+
}
|
|
70
72
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getExtensionElements
|
|
3
|
-
} from 'bpmn-js-properties-panel/lib/helper/ExtensionElementsHelper';
|
|
1
|
+
import { getExtensionElements } from 'bpmn-js-properties-panel/lib/helper/ExtensionElementsHelper';
|
|
4
2
|
|
|
5
3
|
import elementHelper from 'bpmn-js-properties-panel/lib/helper/ElementHelper';
|
|
6
4
|
|
|
@@ -9,47 +7,12 @@ import {
|
|
|
9
7
|
is
|
|
10
8
|
} from 'bpmn-js/lib/util/ModelUtil';
|
|
11
9
|
|
|
12
|
-
import {
|
|
13
|
-
nextId
|
|
14
|
-
} from 'bpmn-js-properties-panel/lib/Utils';
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
find
|
|
18
|
-
} from 'min-dash';
|
|
19
|
-
|
|
20
|
-
const USER_TASK_FORM_PREFIX = 'userTaskForm_';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export function getUserTaskForm(element, parent) {
|
|
10
|
+
import { nextId } from 'bpmn-js-properties-panel/lib/Utils';
|
|
24
11
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// (1) get form definition from user task
|
|
28
|
-
const formDefinition = getFormDefinition(element);
|
|
29
|
-
|
|
30
|
-
if (!formDefinition) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
12
|
+
import { find } from 'min-dash';
|
|
33
13
|
|
|
34
|
-
|
|
14
|
+
const USER_TASK_FORM_PREFIX = 'UserTaskForm_';
|
|
35
15
|
|
|
36
|
-
// (2) retrieve user task form via form key
|
|
37
|
-
const userTaskForm = findUserTaskForm(formKey, rootElement);
|
|
38
|
-
|
|
39
|
-
return userTaskForm;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function getFormDefinition(element) {
|
|
43
|
-
const businessObject = getBusinessObject(element);
|
|
44
|
-
|
|
45
|
-
const formDefinitions = getExtensionElements(businessObject, 'zeebe:FormDefinition');
|
|
46
|
-
|
|
47
|
-
return formDefinitions[0];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function createFormKey(formId) {
|
|
51
|
-
return 'camunda-forms:bpmn:' + formId;
|
|
52
|
-
}
|
|
53
16
|
|
|
54
17
|
export function createFormDefinition(properties, extensionElements, bpmnFactory) {
|
|
55
18
|
return elementHelper.createElement(
|
|
@@ -60,6 +23,14 @@ export function createFormDefinition(properties, extensionElements, bpmnFactory)
|
|
|
60
23
|
);
|
|
61
24
|
}
|
|
62
25
|
|
|
26
|
+
export function createFormId() {
|
|
27
|
+
return nextId(USER_TASK_FORM_PREFIX);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function createFormKey(formId) {
|
|
31
|
+
return `camunda-forms:bpmn:${ formId }`;
|
|
32
|
+
}
|
|
33
|
+
|
|
63
34
|
export function createUserTaskForm(properties, extensionElements, bpmnFactory) {
|
|
64
35
|
return elementHelper.createElement(
|
|
65
36
|
'zeebe:UserTaskForm',
|
|
@@ -69,19 +40,22 @@ export function createUserTaskForm(properties, extensionElements, bpmnFactory) {
|
|
|
69
40
|
);
|
|
70
41
|
}
|
|
71
42
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
43
|
+
function findUserTaskForm(formKey, rootElement) {
|
|
44
|
+
const userTaskForms = getExtensionElements(rootElement, 'zeebe:UserTaskForm');
|
|
75
45
|
|
|
46
|
+
return find(userTaskForms, function(userTaskForm) {
|
|
47
|
+
const id = userTaskForm.get('zeebe:id');
|
|
76
48
|
|
|
77
|
-
|
|
49
|
+
return createFormKey(id) === formKey;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
78
52
|
|
|
79
|
-
function
|
|
80
|
-
const
|
|
53
|
+
export function getFormDefinition(element) {
|
|
54
|
+
const businessObject = getBusinessObject(element);
|
|
81
55
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
56
|
+
const formDefinitions = getExtensionElements(businessObject, 'zeebe:FormDefinition');
|
|
57
|
+
|
|
58
|
+
return formDefinitions[ 0 ];
|
|
85
59
|
}
|
|
86
60
|
|
|
87
61
|
function getRootElement(element) {
|
|
@@ -93,4 +67,18 @@ function getRootElement(element) {
|
|
|
93
67
|
}
|
|
94
68
|
|
|
95
69
|
return parent;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function getUserTaskForm(element, parent) {
|
|
73
|
+
const rootElement = parent || getRootElement(element);
|
|
74
|
+
|
|
75
|
+
const formDefinition = getFormDefinition(element);
|
|
76
|
+
|
|
77
|
+
if (!formDefinition) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const formKey = formDefinition.get('zeebe:formKey');
|
|
82
|
+
|
|
83
|
+
return findUserTaskForm(formKey, rootElement);
|
|
96
84
|
}
|
|
@@ -1,132 +1,135 @@
|
|
|
1
1
|
import {
|
|
2
|
-
getBusinessObject
|
|
2
|
+
getBusinessObject,
|
|
3
|
+
is
|
|
3
4
|
} from 'bpmn-js/lib/util/ModelUtil';
|
|
4
5
|
|
|
5
|
-
import {
|
|
6
|
-
isAny
|
|
7
|
-
} from 'bpmn-js/lib/features/modeling/util/ModelingUtil';
|
|
6
|
+
import { isAny } from 'bpmn-js/lib/features/modeling/util/ModelingUtil';
|
|
8
7
|
|
|
9
|
-
import
|
|
10
|
-
isZeebeServiceTask
|
|
11
|
-
} from './ZeebeServiceTaskHelper';
|
|
8
|
+
import elementHelper from 'bpmn-js-properties-panel/lib/helper/ElementHelper';
|
|
12
9
|
|
|
13
|
-
import
|
|
10
|
+
import { isZeebeServiceTask } from './ZeebeServiceTaskHelper';
|
|
14
11
|
|
|
15
|
-
import elementHelper from 'bpmn-js-properties-panel/lib/helper/ElementHelper';
|
|
16
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Get zeebe:IoMapping from an element.
|
|
15
|
+
*
|
|
16
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
17
|
+
*
|
|
18
|
+
* @return {ModdleElement}
|
|
19
|
+
*/
|
|
20
|
+
export function getIoMapping(element) {
|
|
21
|
+
const businessObject = getBusinessObject(element);
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
const elems = extensionElementsHelper.getExtensionElements(bo, type);
|
|
20
|
-
return !prop ? elems : (elems[0] || {})[prop] || [];
|
|
21
|
-
}
|
|
23
|
+
const extensionElements = businessObject.get('extensionElements');
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
25
|
+
if (!extensionElements) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* @param {djs.model.Base} element
|
|
32
|
-
*
|
|
33
|
-
* @return {ModdleElement} the inputOutput object
|
|
34
|
-
*/
|
|
35
|
-
export function getInputOutput(element) {
|
|
36
|
-
const bo = getBusinessObject(element);
|
|
37
|
-
return (getElements(bo, 'zeebe:IoMapping') || [])[0];
|
|
29
|
+
return extensionElements.get('values').find((value) => {
|
|
30
|
+
return is(value, 'zeebe:IoMapping');
|
|
31
|
+
});
|
|
38
32
|
}
|
|
39
33
|
|
|
40
|
-
|
|
41
34
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
*/
|
|
35
|
+
* Get zeebe:InputParameters from an element.
|
|
36
|
+
*
|
|
37
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
38
|
+
*
|
|
39
|
+
* @return {Array<ModdleElement>}
|
|
40
|
+
*/
|
|
49
41
|
export function getInputParameters(element) {
|
|
50
|
-
|
|
42
|
+
const ioMapping = getIoMapping(element);
|
|
43
|
+
|
|
44
|
+
if (ioMapping) {
|
|
45
|
+
return ioMapping.get('zeebe:inputParameters');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return [];
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
*/
|
|
52
|
+
* Get zeebe:OutputParameters from an element.
|
|
53
|
+
*
|
|
54
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
55
|
+
*
|
|
56
|
+
* @return {Array<ModdleElement>}
|
|
57
|
+
*/
|
|
61
58
|
export function getOutputParameters(element) {
|
|
62
|
-
|
|
59
|
+
const ioMapping = getIoMapping(element);
|
|
60
|
+
|
|
61
|
+
if (ioMapping) {
|
|
62
|
+
return ioMapping.get('zeebe:outputParameters');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return [];
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
export function getInputParameter(element,
|
|
74
|
-
return getInputParameters(element)[
|
|
69
|
+
* Get zeebe:Input at index.
|
|
70
|
+
*
|
|
71
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
72
|
+
* @param {number} index
|
|
73
|
+
*
|
|
74
|
+
* @return {ModdleElement}
|
|
75
|
+
*/
|
|
76
|
+
export function getInputParameter(element, index) {
|
|
77
|
+
return getInputParameters(element)[ index ];
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
/**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
export function getOutputParameter(element,
|
|
86
|
-
return getOutputParameters(element)[
|
|
81
|
+
* Get zeebe:Output at index.
|
|
82
|
+
*
|
|
83
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
84
|
+
* @param {number} index
|
|
85
|
+
*
|
|
86
|
+
* @return {ModdleElement}
|
|
87
|
+
*/
|
|
88
|
+
export function getOutputParameter(element, index) {
|
|
89
|
+
return getOutputParameters(element)[ index ];
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
/**
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
* Check whether element supports zeebe:Input or zeebe:Output.
|
|
94
|
+
*
|
|
95
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
96
|
+
*
|
|
97
|
+
* @return {boolean}
|
|
98
|
+
*/
|
|
96
99
|
export function isInputOutputSupported(element) {
|
|
97
|
-
return
|
|
100
|
+
return areInputParametersSupported(element) || areOutputParametersSupported(element);
|
|
98
101
|
}
|
|
99
102
|
|
|
100
103
|
/**
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
* Check whether element supports zeebe:Input.
|
|
105
|
+
*
|
|
106
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
107
|
+
*
|
|
108
|
+
* @return {boolean}
|
|
109
|
+
*/
|
|
107
110
|
export function areInputParametersSupported(element) {
|
|
108
111
|
return isAny(element, [
|
|
109
|
-
'bpmn:
|
|
112
|
+
'bpmn:CallActivity',
|
|
110
113
|
'bpmn:SubProcess',
|
|
111
|
-
'bpmn:
|
|
114
|
+
'bpmn:UserTask'
|
|
112
115
|
]) || isZeebeServiceTask(element);
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
/**
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
* Check whether element supports zeebe:Output.
|
|
120
|
+
*
|
|
121
|
+
* @param {djs.model.Base|ModdleElement} element
|
|
122
|
+
*
|
|
123
|
+
* @return {boolean}
|
|
124
|
+
*/
|
|
122
125
|
export function areOutputParametersSupported(element) {
|
|
123
126
|
return isAny(element, [
|
|
124
|
-
'zeebe:ZeebeServiceTask',
|
|
125
|
-
'bpmn:UserTask',
|
|
126
|
-
'bpmn:SubProcess',
|
|
127
|
-
'bpmn:ReceiveTask',
|
|
128
127
|
'bpmn:CallActivity',
|
|
129
|
-
'bpmn:Event'
|
|
128
|
+
'bpmn:Event',
|
|
129
|
+
'bpmn:ReceiveTask',
|
|
130
|
+
'bpmn:SubProcess',
|
|
131
|
+
'bpmn:UserTask',
|
|
132
|
+
'zeebe:ZeebeServiceTask'
|
|
130
133
|
]);
|
|
131
134
|
}
|
|
132
135
|
|
|
@@ -134,23 +137,6 @@ export function createElement(type, parent, factory, properties) {
|
|
|
134
137
|
return elementHelper.createElement(type, properties, parent, factory);
|
|
135
138
|
}
|
|
136
139
|
|
|
137
|
-
export function
|
|
140
|
+
export function createIoMapping(parent, bpmnFactory, properties) {
|
|
138
141
|
return createElement('zeebe:IoMapping', parent, bpmnFactory, properties);
|
|
139
142
|
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Get getter function for IOMapping parameters according to provided property name
|
|
143
|
-
*
|
|
144
|
-
* @param {string} property
|
|
145
|
-
*
|
|
146
|
-
* @returns {Function} Getter function for the IOMapping parameters according to provided property name
|
|
147
|
-
*/
|
|
148
|
-
export function determineParamGetFunc(property) {
|
|
149
|
-
if (property == 'inputParameters') {
|
|
150
|
-
return getInputParameters;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (property == 'outputParameters') {
|
|
154
|
-
return getOutputParameters;
|
|
155
|
-
}
|
|
156
|
-
}
|
package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import inherits from 'inherits';
|
|
2
|
-
|
|
3
1
|
import {
|
|
4
2
|
getBusinessObject,
|
|
5
3
|
is
|
|
@@ -11,18 +9,19 @@ const HIGH_PRIORITY = 5000;
|
|
|
11
9
|
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
|
-
* Camunda BPMN specific
|
|
15
|
-
*
|
|
16
|
-
* When `camunda:type` is set to something different than `external`
|
|
17
|
-
* on an element, then `camunda:errorEventDefinition` extension elements
|
|
18
|
-
* shall be removed.
|
|
12
|
+
* Camunda BPMN specific camunda:ErrorEventDefinition behavior.
|
|
19
13
|
*/
|
|
20
|
-
export default
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
export default class DeleteErrorEventDefinitionBehavior extends CommandInterceptor {
|
|
15
|
+
constructor(eventBus, modeling) {
|
|
16
|
+
super(eventBus);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Remove camunda:ErrorEventDefinitions on camunda:type set to external.
|
|
20
|
+
*/
|
|
21
|
+
this.postExecute([
|
|
22
|
+
'element.updateProperties',
|
|
23
|
+
'properties-panel.update-businessobject'
|
|
24
|
+
], HIGH_PRIORITY, function(context) {
|
|
26
25
|
const {
|
|
27
26
|
element,
|
|
28
27
|
oldProperties,
|
|
@@ -30,52 +29,30 @@ export default function DeleteErrorEventDefinitionBehavior(eventBus) {
|
|
|
30
29
|
} = context;
|
|
31
30
|
|
|
32
31
|
const businessObject = getBusinessObject(element),
|
|
33
|
-
extensionElements = businessObject.extensionElements;
|
|
32
|
+
extensionElements = businessObject.get('extensionElements');
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
extensionElements &&
|
|
39
|
-
externalTypeChanged(oldProperties, properties)
|
|
40
|
-
) {
|
|
34
|
+
if (is(element, 'camunda:ExternalCapable')
|
|
35
|
+
&& extensionElements
|
|
36
|
+
&& externalTypeChanged(oldProperties, properties)) {
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
const values = extensionElements.get('values').filter((element) => {
|
|
39
|
+
return !is(element, 'camunda:ErrorEventDefinition');
|
|
40
|
+
});
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
element => !is(element, 'camunda:ErrorEventDefinition')
|
|
47
|
-
);
|
|
42
|
+
modeling.updateModdleProperties(element, extensionElements, { values });
|
|
48
43
|
}
|
|
49
|
-
|
|
50
44
|
}, true);
|
|
51
45
|
|
|
52
|
-
|
|
53
|
-
HIGH_PRIORITY, function({ context }) {
|
|
54
|
-
const {
|
|
55
|
-
element,
|
|
56
|
-
deletedErrorEventDefinitions: oldExtensionElements
|
|
57
|
-
} = context;
|
|
58
|
-
|
|
59
|
-
const businessObject = getBusinessObject(element);
|
|
60
|
-
|
|
61
|
-
// Only intercept the revert, if the behavior became active
|
|
62
|
-
if (oldExtensionElements) {
|
|
63
|
-
const extensionElements = businessObject.extensionElements;
|
|
64
|
-
|
|
65
|
-
extensionElements.values = oldExtensionElements;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
46
|
+
}
|
|
68
47
|
}
|
|
69
48
|
|
|
70
|
-
|
|
71
49
|
DeleteErrorEventDefinitionBehavior.$inject = [
|
|
72
|
-
'eventBus'
|
|
50
|
+
'eventBus',
|
|
51
|
+
'modeling'
|
|
73
52
|
];
|
|
74
53
|
|
|
75
|
-
inherits(DeleteErrorEventDefinitionBehavior, CommandInterceptor);
|
|
76
|
-
|
|
77
54
|
|
|
78
|
-
//
|
|
55
|
+
// helpers //////////
|
|
79
56
|
|
|
80
57
|
function externalTypeChanged(oldProperties, updatesProperties) {
|
|
81
58
|
const {
|