camunda-bpmn-js 0.13.0-drilldown.0 → 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 +73 -0
- package/dist/assets/base-navigated-viewer.css +2 -0
- package/dist/assets/base-viewer.css +2 -0
- package/dist/assets/camunda-cloud-modeler.css +2 -1
- 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 +1837 -3769
- package/dist/base-modeler.production.min.js +4 -4
- 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 +8416 -5340
- 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 +6616 -8556
- 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/ElementTemplatesValidator.js +1 -0
- package/lib/camunda-cloud/Modeler.js +8 -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/lib/util/ExtensionElementsUtil.js +59 -0
- package/package.json +26 -14
- package/styles/base-navigated-viewer.css +2 -0
- package/styles/base-viewer.css +2 -0
- package/styles/camunda-cloud-modeler.css +2 -1
- 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-properties-panel.css +0 -778
- package/dist/assets/bpmn-js.css +0 -113
- 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 -877
- package/lib/camunda-cloud/features/modeling/behavior/CleanUpAssignmentDefinitionBehavior.js +0 -78
- package/lib/camunda-cloud/features/modeling/behavior/CleanUpBusinessRuleTaskBehavior.js +0 -112
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeBoundaryEventBehavior.js +0 -76
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +0 -74
- package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +0 -138
- package/lib/camunda-cloud/features/modeling/behavior/UpdatePropagateAllChildVariablesBehavior.js +0 -109
- 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/ExtensionElementsHelper.js +0 -17
- 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 -67
- package/lib/camunda-platform/features/modeling/behavior/DeleteRetryTimeCycleBehavior.js +0 -84
- package/lib/camunda-platform/features/modeling/behavior/UpdateCamundaExclusiveBehavior.js +0 -65
- package/lib/camunda-platform/features/modeling/behavior/UpdateInputOutputBehavior.js +0 -54
- package/lib/camunda-platform/features/modeling/behavior/UpdateResultVariableBehavior.js +0 -51
- package/lib/camunda-platform/features/modeling/behavior/UserTaskFormsBehavior.js +0 -70
- package/lib/camunda-platform/features/modeling/behavior/UserTaskGeneratedFormsBehavior.js +0 -117
- 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,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,17 +0,0 @@
|
|
|
1
|
-
import { is } from 'bpmn-js/lib/util/ModelUtil';
|
|
2
|
-
|
|
3
|
-
export function getExtensionElements(bo, type) {
|
|
4
|
-
let elements = [];
|
|
5
|
-
const extensionElements = bo.get('extensionElements');
|
|
6
|
-
|
|
7
|
-
if (typeof extensionElements !== 'undefined') {
|
|
8
|
-
const extensionValues = extensionElements.get('values');
|
|
9
|
-
if (typeof extensionValues !== 'undefined') {
|
|
10
|
-
elements = extensionValues.filter(function(value) {
|
|
11
|
-
return is(value, type);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return elements;
|
|
17
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { getExtensionElements } from './ExtensionElementsHelper';
|
|
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 = getExtensionElements(rootElement, 'zeebe:UserTaskForm');
|
|
45
|
-
|
|
46
|
-
return find(userTaskForms, function(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 = getExtensionElements(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,67 +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 camunda:ErrorEventDefinition behavior.
|
|
13
|
-
*/
|
|
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) {
|
|
25
|
-
const {
|
|
26
|
-
element,
|
|
27
|
-
oldProperties,
|
|
28
|
-
properties
|
|
29
|
-
} = context;
|
|
30
|
-
|
|
31
|
-
const businessObject = getBusinessObject(element),
|
|
32
|
-
extensionElements = businessObject.get('extensionElements');
|
|
33
|
-
|
|
34
|
-
if (is(element, 'camunda:ExternalCapable')
|
|
35
|
-
&& extensionElements
|
|
36
|
-
&& externalTypeChanged(oldProperties, properties)) {
|
|
37
|
-
|
|
38
|
-
const values = extensionElements.get('values').filter((element) => {
|
|
39
|
-
return !is(element, 'camunda:ErrorEventDefinition');
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
modeling.updateModdleProperties(element, extensionElements, { values });
|
|
43
|
-
}
|
|
44
|
-
}, true);
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
DeleteErrorEventDefinitionBehavior.$inject = [
|
|
50
|
-
'eventBus',
|
|
51
|
-
'modeling'
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// helpers //////////
|
|
56
|
-
|
|
57
|
-
function externalTypeChanged(oldProperties, updatesProperties) {
|
|
58
|
-
const {
|
|
59
|
-
'camunda:type': oldType
|
|
60
|
-
} = oldProperties;
|
|
61
|
-
|
|
62
|
-
const {
|
|
63
|
-
'camunda:type': newType
|
|
64
|
-
} = updatesProperties;
|
|
65
|
-
|
|
66
|
-
return oldType === 'external' && newType !== 'external';
|
|
67
|
-
}
|
|
@@ -1,84 +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 camunda:FailedJobRetryTimeCycle behavior.
|
|
13
|
-
*/
|
|
14
|
-
export default class DeleteRetryTimeCycleBehavior extends CommandInterceptor {
|
|
15
|
-
constructor(eventBus, modeling) {
|
|
16
|
-
super(eventBus);
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Remove camunda:FailedJobRetryTimeCycle if camunda:asyncAfter or camunda:asyncBefore is set to false.
|
|
20
|
-
*/
|
|
21
|
-
this.postExecute([
|
|
22
|
-
'element.updateProperties',
|
|
23
|
-
'properties-panel.update-businessobject'
|
|
24
|
-
], HIGH_PRIORITY, function(context) {
|
|
25
|
-
const {
|
|
26
|
-
element,
|
|
27
|
-
properties
|
|
28
|
-
} = context;
|
|
29
|
-
|
|
30
|
-
const businessObject = getBusinessObject(element),
|
|
31
|
-
extensionElements = businessObject.extensionElements;
|
|
32
|
-
|
|
33
|
-
if (
|
|
34
|
-
!is(element, 'camunda:AsyncCapable')
|
|
35
|
-
|| (properties[ 'camunda:asyncBefore' ] !== false && properties[ 'camunda:asyncAfter' ] !== false)
|
|
36
|
-
|| !extensionElements
|
|
37
|
-
|| !extensionElements.get('values').length
|
|
38
|
-
|| !extensionElements.get('values').find((value) => is(value, 'camunda:FailedJobRetryTimeCycle'))
|
|
39
|
-
|| getTimerEventDefinition(element)
|
|
40
|
-
|| isAsyncBefore(businessObject)
|
|
41
|
-
|| isAsyncAfter(businessObject)
|
|
42
|
-
) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const values = extensionElements.get('values').filter((element) => {
|
|
47
|
-
return !is(element, 'camunda:FailedJobRetryTimeCycle');
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
modeling.updateModdleProperties(element, extensionElements, { values });
|
|
51
|
-
}, true);
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
DeleteRetryTimeCycleBehavior.$inject = [
|
|
57
|
-
'eventBus',
|
|
58
|
-
'modeling'
|
|
59
|
-
];
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
// helpers //////////
|
|
63
|
-
|
|
64
|
-
function isAsyncBefore(businessObject) {
|
|
65
|
-
return !!(businessObject.get('camunda:asyncBefore') || businessObject.get('camunda:async'));
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function isAsyncAfter(businessObject) {
|
|
69
|
-
return !!businessObject.get('camunda:asyncAfter');
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function getTimerEventDefinition(element) {
|
|
73
|
-
return getEventDefinition(element, 'bpmn:TimerEventDefinition');
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function getEventDefinition(element, type) {
|
|
77
|
-
const businessObject = getBusinessObject(element);
|
|
78
|
-
|
|
79
|
-
const eventDefinitions = businessObject.get('eventDefinitions') || [];
|
|
80
|
-
|
|
81
|
-
return eventDefinitions.find((eventDefinition) => {
|
|
82
|
-
return is(eventDefinition, type);
|
|
83
|
-
});
|
|
84
|
-
}
|
|
@@ -1,65 +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 camunda:exclusive behavior.
|
|
13
|
-
*/
|
|
14
|
-
export default class UpdateCamundaExclusiveBehavior extends CommandInterceptor {
|
|
15
|
-
constructor(eventBus) {
|
|
16
|
-
super(eventBus);
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Set camunda:exclusive to true on camunda:asyncBefore or camunda:asyncAfter set to false.
|
|
20
|
-
*/
|
|
21
|
-
this.preExecute([
|
|
22
|
-
'element.updateProperties',
|
|
23
|
-
'properties-panel.update-businessobject'
|
|
24
|
-
], HIGH_PRIORITY, function(context) {
|
|
25
|
-
const {
|
|
26
|
-
element,
|
|
27
|
-
properties
|
|
28
|
-
} = context;
|
|
29
|
-
|
|
30
|
-
const businessObject = getBusinessObject(element);
|
|
31
|
-
|
|
32
|
-
if (!is(element, 'camunda:AsyncCapable')
|
|
33
|
-
|| (properties[ 'camunda:asyncBefore' ] !== false && properties[ 'camunda:asyncAfter' ] !== false)
|
|
34
|
-
|| isExclusive(businessObject)
|
|
35
|
-
|| (isAsyncAfter(businessObject) && properties[ 'camunda:asyncAfter' ] !== false)
|
|
36
|
-
|| (isAsyncBefore(businessObject) && properties[ 'camunda:asyncBefore' ] !== false)
|
|
37
|
-
|| (properties[ 'camunda:asyncBefore' ] === true || properties[ 'camunda:asyncAfter' ] === true)
|
|
38
|
-
) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
properties[ 'camunda:exclusive' ] = true;
|
|
43
|
-
}, true);
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
UpdateCamundaExclusiveBehavior.$inject = [
|
|
49
|
-
'eventBus'
|
|
50
|
-
];
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// helpers //////////
|
|
54
|
-
|
|
55
|
-
function isAsyncBefore(businessObject) {
|
|
56
|
-
return !!(businessObject.get('camunda:asyncBefore') || businessObject.get('camunda:async'));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function isAsyncAfter(businessObject) {
|
|
60
|
-
return !!businessObject.get('camunda:asyncAfter');
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function isExclusive(businessObject) {
|
|
64
|
-
return !!businessObject.get('camunda:exclusive');
|
|
65
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { getBusinessObject } from 'bpmn-js/lib/util/ModelUtil';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
getInputOutput,
|
|
5
|
-
isInputOutputEmpty
|
|
6
|
-
} from '../../../helper/InputOutputHelper';
|
|
7
|
-
|
|
8
|
-
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Camunda BPMN specific camunda:InputOutput behavior.
|
|
12
|
-
*/
|
|
13
|
-
export default class UpdateInputOutputBehavior extends CommandInterceptor {
|
|
14
|
-
constructor(eventBus, modeling) {
|
|
15
|
-
super(eventBus);
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Remove empty camunda:InputOutput on update.
|
|
19
|
-
*/
|
|
20
|
-
this.postExecute([
|
|
21
|
-
'element.updateProperties',
|
|
22
|
-
'element.updateModdleProperties',
|
|
23
|
-
'properties-panel.update-businessobject-list'
|
|
24
|
-
], function(context) {
|
|
25
|
-
const {
|
|
26
|
-
element,
|
|
27
|
-
oldProperties,
|
|
28
|
-
propertyName
|
|
29
|
-
} = context;
|
|
30
|
-
|
|
31
|
-
const businessObject = getBusinessObject(element),
|
|
32
|
-
inputOutput = getInputOutput(businessObject),
|
|
33
|
-
extensionElements = businessObject.get('extensionElements');
|
|
34
|
-
|
|
35
|
-
// do not remove newly added camunda:InputOutput
|
|
36
|
-
if (!oldProperties && propertyName === 'values') {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (inputOutput && isInputOutputEmpty(inputOutput)) {
|
|
41
|
-
const values = extensionElements.get('values').filter(function(element) {
|
|
42
|
-
return element !== inputOutput;
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
modeling.updateModdleProperties(element, extensionElements, { values });
|
|
46
|
-
}
|
|
47
|
-
}, true);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
UpdateInputOutputBehavior.$inject = [
|
|
52
|
-
'eventBus',
|
|
53
|
-
'modeling'
|
|
54
|
-
];
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { is } from 'bpmn-js/lib/util/ModelUtil';
|
|
2
|
-
|
|
3
|
-
import { has } from 'min-dash';
|
|
4
|
-
|
|
5
|
-
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
6
|
-
|
|
7
|
-
const HIGH_PRIORITY = 5000;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Camunda BPMN specific camunda:resultVariable behavior.
|
|
12
|
-
*/
|
|
13
|
-
export default class UpdateResultVariableBehavior extends CommandInterceptor {
|
|
14
|
-
constructor(eventBus) {
|
|
15
|
-
super(eventBus);
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Remove camunda:mapDecisionResult on camunda:resultVariable removed.
|
|
19
|
-
*/
|
|
20
|
-
this.preExecute([
|
|
21
|
-
'element.updateProperties',
|
|
22
|
-
'properties-panel.update-businessobject'
|
|
23
|
-
], HIGH_PRIORITY, function(context) {
|
|
24
|
-
const {
|
|
25
|
-
element,
|
|
26
|
-
properties
|
|
27
|
-
} = context;
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
is(element, 'camunda:DmnCapable')
|
|
31
|
-
&& has(properties, 'camunda:resultVariable')
|
|
32
|
-
&& isEmpty(properties[ 'camunda:resultVariable' ])
|
|
33
|
-
) {
|
|
34
|
-
properties[ 'camunda:mapDecisionResult' ] = null;
|
|
35
|
-
}
|
|
36
|
-
}, true);
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
UpdateResultVariableBehavior.$inject = [
|
|
42
|
-
'eventBus'
|
|
43
|
-
];
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// helpers //////////
|
|
47
|
-
|
|
48
|
-
function isEmpty(value) {
|
|
49
|
-
return value == undefined || value === '';
|
|
50
|
-
}
|
|
51
|
-
|