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.
- package/CHANGELOG.md +27 -0
- package/dist/assets/base-modeler.css +1 -1
- package/dist/assets/camunda-platform-modeler.css +2 -1
- package/dist/assets/diagram-js.css +2 -0
- package/dist/assets/element-templates.css +75 -0
- package/dist/assets/properties-panel.css +889 -0
- package/dist/base-modeler.development.js +8542 -12092
- package/dist/base-modeler.production.min.js +8 -3
- package/dist/camunda-cloud-modeler.development.js +12089 -14412
- package/dist/camunda-cloud-modeler.production.min.js +8 -3
- package/dist/camunda-platform-modeler.development.js +22532 -25950
- package/dist/camunda-platform-modeler.production.min.js +8 -3
- package/lib/base/Modeler.js +5 -3
- package/lib/camunda-cloud/Modeler.js +5 -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 +57 -60
- package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +70 -128
- 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/rules/BpmnRules.js +1 -1
- package/lib/camunda-cloud/helper/CalledElementHelper.js +43 -41
- package/lib/camunda-cloud/helper/ElementHelper.js +18 -0
- package/lib/camunda-cloud/helper/ExtensionElementsHelper.js +17 -0
- package/lib/camunda-cloud/helper/FormsHelper.js +41 -53
- package/lib/camunda-cloud/helper/InputOutputHelper.js +93 -111
- package/lib/camunda-cloud/helper/Utils.js +10 -0
- package/lib/camunda-cloud/helper/ZeebeServiceTaskHelper.js +22 -5
- package/lib/camunda-platform/Modeler.js +7 -3
- 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 +6 -5
- package/styles/base-modeler.css +1 -1
- package/styles/camunda-platform-modeler.css +2 -1
- package/dist/assets/bpmn-js-properties-panel.css +0 -778
- package/lib/camunda-cloud/features/properties-provider/ZeebePropertiesProvider.js +0 -201
- package/lib/camunda-cloud/features/properties-provider/index.js +0 -11
- package/lib/camunda-cloud/features/properties-provider/parts/CallActivityProps.js +0 -90
- package/lib/camunda-cloud/features/properties-provider/parts/ErrorProps.js +0 -13
- package/lib/camunda-cloud/features/properties-provider/parts/FormProps.js +0 -14
- package/lib/camunda-cloud/features/properties-provider/parts/HeadersProps.js +0 -52
- package/lib/camunda-cloud/features/properties-provider/parts/InputOutputProps.js +0 -8
- package/lib/camunda-cloud/features/properties-provider/parts/MessageProps.js +0 -51
- package/lib/camunda-cloud/features/properties-provider/parts/MultiInstanceProps.js +0 -25
- package/lib/camunda-cloud/features/properties-provider/parts/SequenceFlowProps.js +0 -149
- package/lib/camunda-cloud/features/properties-provider/parts/TaskDefinitionProps.js +0 -135
- package/lib/camunda-cloud/features/properties-provider/parts/TimerEventProps.js +0 -77
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/ElementReferenceExtensionElementProperty.js +0 -110
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/FormDefinition.js +0 -207
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/Headers.js +0 -208
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/InputOutput.js +0 -260
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/InputOutputParameter.js +0 -147
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/MultiInstanceLoopCharacteristics.js +0 -176
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/OutputParameterToggle.js +0 -97
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/TimerDurationDefinition.js +0 -69
- package/lib/camunda-cloud/features/properties-provider/parts/implementation/TimerEventDefinition.js +0 -132
|
@@ -1,58 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getExtensionElements
|
|
3
|
-
} from 'bpmn-js-properties-panel/lib/helper/ExtensionElementsHelper';
|
|
1
|
+
import { getExtensionElements } from './ExtensionElementsHelper';
|
|
4
2
|
|
|
5
|
-
import
|
|
3
|
+
import { createElement } from './ElementHelper';
|
|
6
4
|
|
|
7
5
|
import {
|
|
8
6
|
getBusinessObject,
|
|
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 './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
|
-
return
|
|
18
|
+
return createElement(
|
|
56
19
|
'zeebe:FormDefinition',
|
|
57
20
|
properties,
|
|
58
21
|
extensionElements,
|
|
@@ -60,8 +23,16 @@ 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
|
-
return
|
|
35
|
+
return createElement(
|
|
65
36
|
'zeebe:UserTaskForm',
|
|
66
37
|
properties,
|
|
67
38
|
extensionElements,
|
|
@@ -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,156 +1,138 @@
|
|
|
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 { createElement } from './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
|
|
|
133
|
-
export function
|
|
134
|
-
return
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export function createIOMapping(parent, bpmnFactory, properties) {
|
|
138
|
-
return createElement('zeebe:IoMapping', parent, bpmnFactory, properties);
|
|
139
|
-
}
|
|
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
|
-
}
|
|
136
|
+
export function createIoMapping(parent, bpmnFactory, properties) {
|
|
137
|
+
return createElement('zeebe:IoMapping', properties, parent, bpmnFactory);
|
|
156
138
|
}
|
|
@@ -1,24 +1,41 @@
|
|
|
1
1
|
import {
|
|
2
|
+
getBusinessObject,
|
|
2
3
|
is
|
|
3
4
|
} from 'bpmn-js/lib/util/ModelUtil';
|
|
4
5
|
|
|
5
|
-
import
|
|
6
|
+
import { forEach } from 'min-dash';
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
export function isZeebeServiceTask(element) {
|
|
9
10
|
if (!is(element, 'zeebe:ZeebeServiceTask')) return false;
|
|
10
11
|
|
|
11
12
|
if (is(element, 'bpmn:EndEvent') || is(element, 'bpmn:IntermediateThrowEvent')) {
|
|
12
|
-
return !!
|
|
13
|
+
return !!getMessageEventDefinition(element);
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
return true;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export function isMessageEndEvent(element) {
|
|
19
|
-
return is(element, 'bpmn:EndEvent') && !!
|
|
20
|
+
return is(element, 'bpmn:EndEvent') && !!getMessageEventDefinition(element);
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export function isMessageThrowEvent(element) {
|
|
23
|
-
return is(element, 'bpmn:IntermediateThrowEvent') && !!
|
|
24
|
-
}
|
|
24
|
+
return is(element, 'bpmn:IntermediateThrowEvent') && !!getMessageEventDefinition(element);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function getMessageEventDefinition(element) {
|
|
28
|
+
|
|
29
|
+
var bo = getBusinessObject(element),
|
|
30
|
+
eventDefinition = null;
|
|
31
|
+
|
|
32
|
+
if (bo.eventDefinitions) {
|
|
33
|
+
forEach(bo.eventDefinitions, function(event) {
|
|
34
|
+
if (is(event, 'bpmn:MessageEventDefinition')) {
|
|
35
|
+
eventDefinition = event;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return eventDefinition;
|
|
41
|
+
}
|
|
@@ -4,12 +4,15 @@ import BaseModeler from '../base/Modeler';
|
|
|
4
4
|
|
|
5
5
|
import modelingModule from './features/modeling';
|
|
6
6
|
|
|
7
|
-
import propertiesProviderModule from 'bpmn-js-properties-panel/lib/provider/camunda';
|
|
8
|
-
|
|
9
7
|
import camundaModdle from 'camunda-bpmn-moddle/resources/camunda.json';
|
|
10
8
|
|
|
11
9
|
import camundaModdleExtension from 'camunda-bpmn-moddle/lib';
|
|
12
10
|
|
|
11
|
+
import {
|
|
12
|
+
CamundaPlatformPropertiesProviderModule,
|
|
13
|
+
ElementTemplatesPropertiesProviderModule
|
|
14
|
+
} from 'bpmn-js-properties-panel';
|
|
15
|
+
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
18
|
*
|
|
@@ -33,7 +36,8 @@ inherits(Modeler, BaseModeler);
|
|
|
33
36
|
Modeler.prototype._camundaPlatformModules = [
|
|
34
37
|
camundaModdleExtension,
|
|
35
38
|
modelingModule,
|
|
36
|
-
|
|
39
|
+
CamundaPlatformPropertiesProviderModule,
|
|
40
|
+
ElementTemplatesPropertiesProviderModule
|
|
37
41
|
];
|
|
38
42
|
|
|
39
43
|
Modeler.prototype._modules = [].concat(
|
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 {
|