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.
- package/CHANGELOG.md +23 -1
- package/dist/assets/base-navigated-viewer.css +2 -0
- package/dist/assets/base-viewer.css +2 -0
- package/dist/assets/camunda-cloud-navigated-viewer.css +1 -0
- package/dist/assets/camunda-cloud-viewer.css +1 -0
- package/dist/assets/camunda-platform-navigated-viewer.css +1 -0
- package/dist/assets/camunda-platform-viewer.css +1 -0
- package/dist/base-modeler.development.js +32 -6
- package/dist/base-modeler.production.min.js +1 -1
- package/dist/base-navigated-viewer.development.js +22218 -0
- package/dist/base-navigated-viewer.production.min.js +2 -0
- package/dist/base-viewer.development.js +21227 -0
- package/dist/base-viewer.production.min.js +2 -0
- package/dist/camunda-cloud-modeler.development.js +1380 -456
- package/dist/camunda-cloud-modeler.production.min.js +4 -4
- package/dist/camunda-cloud-navigated-viewer.development.js +23041 -0
- package/dist/camunda-cloud-navigated-viewer.production.min.js +2 -0
- package/dist/camunda-cloud-viewer.development.js +22050 -0
- package/dist/camunda-cloud-viewer.production.min.js +2 -0
- package/dist/camunda-platform-modeler.development.js +1657 -1340
- package/dist/camunda-platform-modeler.production.min.js +4 -4
- package/dist/camunda-platform-navigated-viewer.development.js +23413 -0
- package/dist/camunda-platform-navigated-viewer.production.min.js +2 -0
- package/dist/camunda-platform-viewer.development.js +22422 -0
- package/dist/camunda-platform-viewer.production.min.js +2 -0
- package/lib/base/NavigatedViewer.js +3 -0
- package/lib/base/Viewer.js +3 -0
- package/lib/camunda-cloud/Modeler.js +6 -7
- package/lib/camunda-cloud/NavigatedViewer.js +34 -0
- package/lib/camunda-cloud/Viewer.js +34 -0
- package/lib/camunda-cloud/util/commonModules.js +14 -0
- package/lib/camunda-platform/Modeler.js +5 -5
- package/lib/camunda-platform/NavigatedViewer.js +25 -0
- package/lib/camunda-platform/Viewer.js +24 -0
- package/lib/camunda-platform/util/commonModules.js +7 -0
- package/package.json +13 -7
- package/styles/base-navigated-viewer.css +2 -0
- package/styles/base-viewer.css +2 -0
- package/styles/camunda-cloud-navigated-viewer.css +1 -0
- package/styles/camunda-cloud-viewer.css +1 -0
- package/styles/camunda-platform-navigated-viewer.css +1 -0
- package/styles/camunda-platform-viewer.css +1 -0
- package/util/index.js +39 -0
- package/dist/assets/bpmn-font/bpmn-codes.css +0 -108
- package/dist/assets/bpmn-font/bpmn-embedded.css +0 -161
- package/dist/assets/bpmn-font/bpmn.css +0 -164
- package/dist/assets/bpmn-font/bpmn.eot +0 -0
- package/dist/assets/bpmn-font/bpmn.svg +0 -224
- package/dist/assets/bpmn-font/bpmn.ttf +0 -0
- package/dist/assets/bpmn-font/bpmn.woff +0 -0
- package/dist/assets/bpmn-font/bpmn.woff2 +0 -0
- package/dist/assets/bpmn-font/css/bpmn-codes.css +0 -108
- package/dist/assets/bpmn-font/css/bpmn-embedded.css +0 -161
- package/dist/assets/bpmn-font/css/bpmn.css +0 -164
- package/dist/assets/bpmn-font/font/bpmn.eot +0 -0
- package/dist/assets/bpmn-font/font/bpmn.svg +0 -224
- package/dist/assets/bpmn-font/font/bpmn.ttf +0 -0
- package/dist/assets/bpmn-font/font/bpmn.woff +0 -0
- package/dist/assets/bpmn-font/font/bpmn.woff2 +0 -0
- package/dist/assets/bpmn-js.css +0 -116
- package/dist/assets/diagram-js-minimap.css +0 -87
- package/dist/assets/diagram-js.css +0 -819
- package/dist/assets/element-templates.css +0 -75
- package/dist/assets/properties-panel.css +0 -902
- package/lib/camunda-cloud/features/modeling/behavior/CleanUpBusinessRuleTaskBehavior.js +0 -115
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeBoundaryEventBehavior.js +0 -76
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +0 -86
- package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +0 -138
- package/lib/camunda-cloud/features/modeling/behavior/RemoveAssignmentDefinitionBehavior.js +0 -51
- package/lib/camunda-cloud/features/modeling/behavior/UpdatePropagateAllChildVariablesBehavior.js +0 -136
- package/lib/camunda-cloud/features/modeling/behavior/index.js +0 -24
- package/lib/camunda-cloud/features/modeling/index.js +0 -7
- package/lib/camunda-cloud/helper/CalledElementHelper.js +0 -72
- package/lib/camunda-cloud/helper/ElementHelper.js +0 -18
- package/lib/camunda-cloud/helper/FormsHelper.js +0 -84
- package/lib/camunda-cloud/helper/InputOutputHelper.js +0 -138
- package/lib/camunda-cloud/helper/Utils.js +0 -10
- package/lib/camunda-cloud/helper/ZeebeServiceTaskHelper.js +0 -41
- package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js +0 -54
- package/lib/camunda-platform/features/modeling/behavior/DeleteRetryTimeCycleBehavior.js +0 -96
- package/lib/camunda-platform/features/modeling/behavior/UpdateCamundaExclusiveBehavior.js +0 -68
- package/lib/camunda-platform/features/modeling/behavior/UpdateInputOutputBehavior.js +0 -44
- package/lib/camunda-platform/features/modeling/behavior/UpdateResultVariableBehavior.js +0 -54
- package/lib/camunda-platform/features/modeling/behavior/UserTaskFormsBehavior.js +0 -71
- package/lib/camunda-platform/features/modeling/behavior/UserTaskGeneratedFormsBehavior.js +0 -116
- package/lib/camunda-platform/features/modeling/behavior/index.js +0 -26
- package/lib/camunda-platform/features/modeling/index.js +0 -7
- package/lib/camunda-platform/helper/InputOutputHelper.js +0 -29
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { has } from 'min-dash';
|
|
2
|
-
|
|
3
|
-
import { getOutputParameters } from './InputOutputHelper';
|
|
4
|
-
|
|
5
|
-
import { getExtensionElementsList } from '../../util/ExtensionElementsUtil';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
getBusinessObject,
|
|
9
|
-
is
|
|
10
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
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 false;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const outputParameters = getOutputParameters(element);
|
|
26
|
-
|
|
27
|
-
if (outputParameters) {
|
|
28
|
-
return !outputParameters.length;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Get zeebe:CalledElement of an element.
|
|
34
|
-
*
|
|
35
|
-
* @param {djs.model.Base|ModdleElement} element
|
|
36
|
-
*
|
|
37
|
-
* @returns {ModdleElement}
|
|
38
|
-
*/
|
|
39
|
-
export function getCalledElement(element) {
|
|
40
|
-
const calledElements = getCalledElements(element);
|
|
41
|
-
|
|
42
|
-
return calledElements[ 0 ];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function getCalledElements(element) {
|
|
46
|
-
const businessObject = getBusinessObject(element);
|
|
47
|
-
|
|
48
|
-
return getExtensionElementsList(businessObject, 'zeebe:CalledElement');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
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
|
-
export function isPropagateAllChildVariables(element) {
|
|
60
|
-
if (!is(element, 'bpmn:CallActivity')) {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const businessObject = getBusinessObject(element),
|
|
65
|
-
calledElement = getCalledElement(businessObject);
|
|
66
|
-
|
|
67
|
-
if (calledElement && has(calledElement, 'propagateAllChildVariables')) {
|
|
68
|
-
return calledElement.get('propagateAllChildVariables') || false;
|
|
69
|
-
} else {
|
|
70
|
-
return getPropagateAllChildVariablesDefault(element);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a new element and set the parent to it
|
|
3
|
-
*
|
|
4
|
-
* @method ElementHelper#createElement
|
|
5
|
-
*
|
|
6
|
-
* @param {String} elementType of the new element
|
|
7
|
-
* @param {Object} properties of the new element in key-value pairs
|
|
8
|
-
* @param {moddle.object} parent of the new element
|
|
9
|
-
* @param {BpmnFactory} factory which creates the new element
|
|
10
|
-
*
|
|
11
|
-
* @returns {djs.model.Base} element which is created
|
|
12
|
-
*/
|
|
13
|
-
export function createElement(elementType, properties, parent, factory) {
|
|
14
|
-
var element = factory.create(elementType, properties);
|
|
15
|
-
element.$parent = parent;
|
|
16
|
-
|
|
17
|
-
return element;
|
|
18
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { getExtensionElementsList } from '../../util/ExtensionElementsUtil';
|
|
2
|
-
|
|
3
|
-
import { createElement } from './ElementHelper';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
getBusinessObject,
|
|
7
|
-
is
|
|
8
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
9
|
-
|
|
10
|
-
import { nextId } from './Utils';
|
|
11
|
-
|
|
12
|
-
import { find } from 'min-dash';
|
|
13
|
-
|
|
14
|
-
const USER_TASK_FORM_PREFIX = 'UserTaskForm_';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export function createFormDefinition(properties, extensionElements, bpmnFactory) {
|
|
18
|
-
return createElement(
|
|
19
|
-
'zeebe:FormDefinition',
|
|
20
|
-
properties,
|
|
21
|
-
extensionElements,
|
|
22
|
-
bpmnFactory
|
|
23
|
-
);
|
|
24
|
-
}
|
|
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
|
-
|
|
34
|
-
export function createUserTaskForm(properties, extensionElements, bpmnFactory) {
|
|
35
|
-
return createElement(
|
|
36
|
-
'zeebe:UserTaskForm',
|
|
37
|
-
properties,
|
|
38
|
-
extensionElements,
|
|
39
|
-
bpmnFactory
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function findUserTaskForm(formKey, rootElement) {
|
|
44
|
-
const userTaskForms = getExtensionElementsList(rootElement, 'zeebe:UserTaskForm');
|
|
45
|
-
|
|
46
|
-
return find(userTaskForms, (userTaskForm) => {
|
|
47
|
-
const id = userTaskForm.get('zeebe:id');
|
|
48
|
-
|
|
49
|
-
return createFormKey(id) === formKey;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function getFormDefinition(element) {
|
|
54
|
-
const businessObject = getBusinessObject(element);
|
|
55
|
-
|
|
56
|
-
const formDefinitions = getExtensionElementsList(businessObject, 'zeebe:FormDefinition');
|
|
57
|
-
|
|
58
|
-
return formDefinitions[ 0 ];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function getRootElement(element) {
|
|
62
|
-
var businessObject = getBusinessObject(element),
|
|
63
|
-
parent = businessObject;
|
|
64
|
-
|
|
65
|
-
while (parent.$parent && !is(parent, 'bpmn:Process')) {
|
|
66
|
-
parent = parent.$parent;
|
|
67
|
-
}
|
|
68
|
-
|
|
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);
|
|
84
|
-
}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getBusinessObject,
|
|
3
|
-
is
|
|
4
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
5
|
-
|
|
6
|
-
import { isAny } from 'bpmn-js/lib/features/modeling/util/ModelingUtil';
|
|
7
|
-
|
|
8
|
-
import { createElement } from './ElementHelper';
|
|
9
|
-
|
|
10
|
-
import { isZeebeServiceTask } from './ZeebeServiceTaskHelper';
|
|
11
|
-
|
|
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);
|
|
22
|
-
|
|
23
|
-
const extensionElements = businessObject.get('extensionElements');
|
|
24
|
-
|
|
25
|
-
if (!extensionElements) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return extensionElements.get('values').find((value) => {
|
|
30
|
-
return is(value, 'zeebe:IoMapping');
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Get zeebe:InputParameters from an element.
|
|
36
|
-
*
|
|
37
|
-
* @param {djs.model.Base|ModdleElement} element
|
|
38
|
-
*
|
|
39
|
-
* @return {Array<ModdleElement>}
|
|
40
|
-
*/
|
|
41
|
-
export function getInputParameters(element) {
|
|
42
|
-
const ioMapping = getIoMapping(element);
|
|
43
|
-
|
|
44
|
-
if (ioMapping) {
|
|
45
|
-
return ioMapping.get('zeebe:inputParameters');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return [];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Get zeebe:OutputParameters from an element.
|
|
53
|
-
*
|
|
54
|
-
* @param {djs.model.Base|ModdleElement} element
|
|
55
|
-
*
|
|
56
|
-
* @return {Array<ModdleElement>}
|
|
57
|
-
*/
|
|
58
|
-
export function getOutputParameters(element) {
|
|
59
|
-
const ioMapping = getIoMapping(element);
|
|
60
|
-
|
|
61
|
-
if (ioMapping) {
|
|
62
|
-
return ioMapping.get('zeebe:outputParameters');
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return [];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
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 ];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
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 ];
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Check whether element supports zeebe:Input or zeebe:Output.
|
|
94
|
-
*
|
|
95
|
-
* @param {djs.model.Base|ModdleElement} element
|
|
96
|
-
*
|
|
97
|
-
* @return {boolean}
|
|
98
|
-
*/
|
|
99
|
-
export function isInputOutputSupported(element) {
|
|
100
|
-
return areInputParametersSupported(element) || areOutputParametersSupported(element);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Check whether element supports zeebe:Input.
|
|
105
|
-
*
|
|
106
|
-
* @param {djs.model.Base|ModdleElement} element
|
|
107
|
-
*
|
|
108
|
-
* @return {boolean}
|
|
109
|
-
*/
|
|
110
|
-
export function areInputParametersSupported(element) {
|
|
111
|
-
return isAny(element, [
|
|
112
|
-
'bpmn:CallActivity',
|
|
113
|
-
'bpmn:SubProcess',
|
|
114
|
-
'bpmn:UserTask'
|
|
115
|
-
]) || isZeebeServiceTask(element);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Check whether element supports zeebe:Output.
|
|
120
|
-
*
|
|
121
|
-
* @param {djs.model.Base|ModdleElement} element
|
|
122
|
-
*
|
|
123
|
-
* @return {boolean}
|
|
124
|
-
*/
|
|
125
|
-
export function areOutputParametersSupported(element) {
|
|
126
|
-
return isAny(element, [
|
|
127
|
-
'bpmn:CallActivity',
|
|
128
|
-
'bpmn:Event',
|
|
129
|
-
'bpmn:ReceiveTask',
|
|
130
|
-
'bpmn:SubProcess',
|
|
131
|
-
'bpmn:UserTask',
|
|
132
|
-
'zeebe:ZeebeServiceTask'
|
|
133
|
-
]);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export function createIoMapping(parent, bpmnFactory, properties) {
|
|
137
|
-
return createElement('zeebe:IoMapping', properties, parent, bpmnFactory);
|
|
138
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getBusinessObject,
|
|
3
|
-
is
|
|
4
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
5
|
-
|
|
6
|
-
import { forEach } from 'min-dash';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export function isZeebeServiceTask(element) {
|
|
10
|
-
if (!is(element, 'zeebe:ZeebeServiceTask')) return false;
|
|
11
|
-
|
|
12
|
-
if (is(element, 'bpmn:EndEvent') || is(element, 'bpmn:IntermediateThrowEvent')) {
|
|
13
|
-
return !!getMessageEventDefinition(element);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function isMessageEndEvent(element) {
|
|
20
|
-
return is(element, 'bpmn:EndEvent') && !!getMessageEventDefinition(element);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function isMessageThrowEvent(element) {
|
|
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
|
-
}
|
package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js
DELETED
|
@@ -1,54 +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
|
-
getExtensionElementsList,
|
|
10
|
-
removeExtensionElements
|
|
11
|
-
} from '../../../../util/ExtensionElementsUtil';
|
|
12
|
-
|
|
13
|
-
const HIGH_PRIORITY = 5000;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Camunda BPMN specific behavior ensuring camunda:ErrorEventDefinition extension elements are removed
|
|
18
|
-
* if type of e.g. bpmn:ServiceTask is set to something other than external.
|
|
19
|
-
*/
|
|
20
|
-
export default class DeleteErrorEventDefinitionBehavior extends CommandInterceptor {
|
|
21
|
-
constructor(commandStack, eventBus) {
|
|
22
|
-
super(eventBus);
|
|
23
|
-
|
|
24
|
-
this.postExecute([
|
|
25
|
-
'element.updateProperties',
|
|
26
|
-
'element.updateModdleProperties'
|
|
27
|
-
], HIGH_PRIORITY, function(context) {
|
|
28
|
-
const {
|
|
29
|
-
element,
|
|
30
|
-
moddleElement,
|
|
31
|
-
properties
|
|
32
|
-
} = context;
|
|
33
|
-
|
|
34
|
-
const businessObject = moddleElement || getBusinessObject(element);
|
|
35
|
-
|
|
36
|
-
if (is(element, 'camunda:ExternalCapable')
|
|
37
|
-
&& is(businessObject, 'camunda:ExternalCapable')
|
|
38
|
-
&& properties[ 'camunda:type' ] !== 'external'
|
|
39
|
-
) {
|
|
40
|
-
const errorEventDefinitions = getExtensionElementsList(businessObject, 'camunda:ErrorEventDefinition');
|
|
41
|
-
|
|
42
|
-
if (errorEventDefinitions.length) {
|
|
43
|
-
removeExtensionElements(element, businessObject, errorEventDefinitions, commandStack);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}, true);
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
DeleteErrorEventDefinitionBehavior.$inject = [
|
|
52
|
-
'commandStack',
|
|
53
|
-
'eventBus'
|
|
54
|
-
];
|
|
@@ -1,96 +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 {
|
|
9
|
-
getExtensionElementsList,
|
|
10
|
-
removeExtensionElements
|
|
11
|
-
} from '../../../../util/ExtensionElementsUtil';
|
|
12
|
-
|
|
13
|
-
const HIGH_PRIORITY = 5000;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Camunda BPMN specific behavior ensuring camunda:FailedJobRetryTimeCycle is
|
|
18
|
-
* removed when both camunda:asyncAfter and camunda:asyncBefore set to false.
|
|
19
|
-
* Doesn't apply if element has bpmn:TimerEventDefinition.
|
|
20
|
-
*/
|
|
21
|
-
export default class DeleteRetryTimeCycleBehavior extends CommandInterceptor {
|
|
22
|
-
constructor(commandStack, eventBus) {
|
|
23
|
-
super(eventBus);
|
|
24
|
-
|
|
25
|
-
this.postExecute([
|
|
26
|
-
'element.updateProperties',
|
|
27
|
-
'element.updateModdleProperties'
|
|
28
|
-
], HIGH_PRIORITY, function(context) {
|
|
29
|
-
const {
|
|
30
|
-
element,
|
|
31
|
-
moddleElement,
|
|
32
|
-
properties = {}
|
|
33
|
-
} = context;
|
|
34
|
-
|
|
35
|
-
const asyncAfter = properties[ 'camunda:asyncAfter' ],
|
|
36
|
-
asyncBefore = properties[ 'camunda:asyncBefore' ];
|
|
37
|
-
|
|
38
|
-
const businessObject = moddleElement || getBusinessObject(element);
|
|
39
|
-
|
|
40
|
-
const failedJobRetryTimeCycle = getFailedJobRetryTimeCycle(element);
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
!is(element, 'camunda:AsyncCapable')
|
|
44
|
-
|| !is(businessObject, 'camunda:AsyncCapable')
|
|
45
|
-
|| (asyncAfter !== false && asyncBefore !== false)
|
|
46
|
-
|| !failedJobRetryTimeCycle
|
|
47
|
-
|| getTimerEventDefinition(element)
|
|
48
|
-
|| isAsyncBefore(businessObject)
|
|
49
|
-
|| isAsyncAfter(businessObject)
|
|
50
|
-
) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
removeExtensionElements(element, businessObject, failedJobRetryTimeCycle, commandStack);
|
|
55
|
-
}, true);
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
DeleteRetryTimeCycleBehavior.$inject = [
|
|
61
|
-
'commandStack',
|
|
62
|
-
'eventBus'
|
|
63
|
-
];
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
// helpers //////////
|
|
67
|
-
|
|
68
|
-
function isAsyncBefore(businessObject) {
|
|
69
|
-
return !!(businessObject.get('camunda:asyncBefore') || businessObject.get('camunda:async'));
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function isAsyncAfter(businessObject) {
|
|
73
|
-
return !!businessObject.get('camunda:asyncAfter');
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function getFailedJobRetryTimeCycle(element) {
|
|
77
|
-
return getExtensionElementsList(element, 'camunda:FailedJobRetryTimeCycle')[ 0 ];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function getTimerEventDefinition(element) {
|
|
81
|
-
return getEventDefinition(element, 'bpmn:TimerEventDefinition');
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function getEventDefinition(element, type) {
|
|
85
|
-
const businessObject = getBusinessObject(element);
|
|
86
|
-
|
|
87
|
-
const eventDefinitions = businessObject.get('eventDefinitions');
|
|
88
|
-
|
|
89
|
-
if (!eventDefinitions || !eventDefinitions.length) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return eventDefinitions.find((eventDefinition) => {
|
|
94
|
-
return is(eventDefinition, type);
|
|
95
|
-
});
|
|
96
|
-
}
|
|
@@ -1,68 +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
|
-
const HIGH_PRIORITY = 5000;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Camunda BPMN specific behavior ensuring camunda:exclusive is set to true if
|
|
13
|
-
* camunda:asyncBefore or camunda:asyncAfter is set to false.
|
|
14
|
-
*/
|
|
15
|
-
export default class UpdateCamundaExclusiveBehavior extends CommandInterceptor {
|
|
16
|
-
constructor(eventBus) {
|
|
17
|
-
super(eventBus);
|
|
18
|
-
|
|
19
|
-
this.preExecute([
|
|
20
|
-
'element.updateProperties',
|
|
21
|
-
'element.updateModdleProperties',
|
|
22
|
-
], HIGH_PRIORITY, function(context) {
|
|
23
|
-
const {
|
|
24
|
-
element,
|
|
25
|
-
moddleElement,
|
|
26
|
-
properties = {}
|
|
27
|
-
} = context;
|
|
28
|
-
|
|
29
|
-
const businessObject = moddleElement || getBusinessObject(element);
|
|
30
|
-
|
|
31
|
-
const asyncAfter = properties[ 'camunda:asyncAfter' ],
|
|
32
|
-
asyncBefore = properties[ 'camunda:asyncBefore' ];
|
|
33
|
-
|
|
34
|
-
if (!is(element, 'camunda:AsyncCapable')
|
|
35
|
-
|| !is(businessObject, 'camunda:AsyncCapable')
|
|
36
|
-
|| (asyncAfter !== false && asyncBefore !== false)
|
|
37
|
-
|| isExclusive(businessObject)
|
|
38
|
-
|| (isAsyncAfter(businessObject) && asyncAfter !== false)
|
|
39
|
-
|| (isAsyncBefore(businessObject) && asyncBefore !== false)
|
|
40
|
-
|| (asyncAfter === true || asyncBefore === true)
|
|
41
|
-
) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
properties[ 'camunda:exclusive' ] = true;
|
|
46
|
-
}, true);
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
UpdateCamundaExclusiveBehavior.$inject = [
|
|
52
|
-
'eventBus'
|
|
53
|
-
];
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
// helpers //////////
|
|
57
|
-
|
|
58
|
-
function isAsyncBefore(businessObject) {
|
|
59
|
-
return !!(businessObject.get('camunda:asyncBefore') || businessObject.get('camunda:async'));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function isAsyncAfter(businessObject) {
|
|
63
|
-
return !!businessObject.get('camunda:asyncAfter');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function isExclusive(businessObject) {
|
|
67
|
-
return !!businessObject.get('camunda:exclusive');
|
|
68
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getBusinessObject,
|
|
3
|
-
is
|
|
4
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
5
|
-
|
|
6
|
-
import { isInputOutputEmpty } from '../../../helper/InputOutputHelper';
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
removeExtensionElements
|
|
10
|
-
} from '../../../../util/ExtensionElementsUtil';
|
|
11
|
-
|
|
12
|
-
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
13
|
-
|
|
14
|
-
const LOW_PRIORITY = 250;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Camunda BPMN specific behavior ensuring empty camunda:InputOutput is removed.
|
|
19
|
-
*/
|
|
20
|
-
export default class UpdateInputOutputBehavior extends CommandInterceptor {
|
|
21
|
-
constructor(commandStack, eventBus) {
|
|
22
|
-
super(eventBus);
|
|
23
|
-
|
|
24
|
-
this.postExecuted('element.updateModdleProperties', LOW_PRIORITY, function(context) {
|
|
25
|
-
const {
|
|
26
|
-
element,
|
|
27
|
-
moddleElement
|
|
28
|
-
} = context;
|
|
29
|
-
|
|
30
|
-
if (!is(moddleElement, 'camunda:InputOutput')) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (isInputOutputEmpty(moddleElement)) {
|
|
35
|
-
removeExtensionElements(element, getBusinessObject(element), moddleElement, commandStack);
|
|
36
|
-
}
|
|
37
|
-
}, true);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
UpdateInputOutputBehavior.$inject = [
|
|
42
|
-
'commandStack',
|
|
43
|
-
'eventBus'
|
|
44
|
-
];
|
|
@@ -1,54 +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 { has } from 'min-dash';
|
|
9
|
-
|
|
10
|
-
const HIGH_PRIORITY = 5000;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Camunda BPMN specific camunda:resultVariable behavior ensuring
|
|
15
|
-
* camunda:mapDecisionResult is removed when camunda:resultVariable is removed.
|
|
16
|
-
*/
|
|
17
|
-
export default class UpdateResultVariableBehavior extends CommandInterceptor {
|
|
18
|
-
constructor(eventBus) {
|
|
19
|
-
super(eventBus);
|
|
20
|
-
|
|
21
|
-
this.preExecute([
|
|
22
|
-
'element.updateProperties',
|
|
23
|
-
'element.updateModdleProperties'
|
|
24
|
-
], HIGH_PRIORITY, function(context) {
|
|
25
|
-
const {
|
|
26
|
-
element,
|
|
27
|
-
moddleElement,
|
|
28
|
-
properties
|
|
29
|
-
} = context;
|
|
30
|
-
|
|
31
|
-
const businessObject = moddleElement || getBusinessObject(element);
|
|
32
|
-
|
|
33
|
-
if (
|
|
34
|
-
is(element, 'camunda:DmnCapable')
|
|
35
|
-
&& is(businessObject, 'camunda:DmnCapable')
|
|
36
|
-
&& has(properties, 'camunda:resultVariable')
|
|
37
|
-
&& isEmpty(properties[ 'camunda:resultVariable' ])
|
|
38
|
-
) {
|
|
39
|
-
properties[ 'camunda:mapDecisionResult' ] = undefined;
|
|
40
|
-
}
|
|
41
|
-
}, true);
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
UpdateResultVariableBehavior.$inject = [
|
|
47
|
-
'eventBus'
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
// helpers //////////
|
|
51
|
-
|
|
52
|
-
function isEmpty(value) {
|
|
53
|
-
return value == undefined || value === '';
|
|
54
|
-
}
|