camunda-bpmn-js 0.14.0 → 0.15.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 +280 -270
- package/LICENSE +20 -20
- package/README.md +84 -84
- package/dist/assets/base-modeler.css +4 -4
- package/dist/assets/base-navigated-viewer.css +1 -1
- package/dist/assets/base-viewer.css +1 -1
- package/dist/assets/bpmn-js.css +32 -4
- package/dist/assets/camunda-cloud-modeler.css +1 -1
- package/dist/assets/camunda-platform-modeler.css +1 -1
- package/dist/assets/diagram-js.css +55 -51
- package/dist/assets/element-templates.css +4 -0
- package/dist/assets/properties-panel.css +929 -900
- package/dist/base-modeler.development.js +7372 -5941
- package/dist/base-modeler.production.min.js +4 -4
- package/dist/base-navigated-viewer.development.js +21592 -21248
- package/dist/base-navigated-viewer.production.min.js +3 -2
- package/dist/base-viewer.development.js +20793 -20449
- package/dist/base-viewer.production.min.js +3 -2
- package/dist/camunda-cloud-modeler.development.js +9568 -7851
- package/dist/camunda-cloud-modeler.production.min.js +4 -4
- package/dist/camunda-cloud-navigated-viewer.development.js +647 -273
- package/dist/camunda-cloud-navigated-viewer.production.min.js +2 -2
- package/dist/camunda-cloud-viewer.development.js +646 -272
- package/dist/camunda-cloud-viewer.production.min.js +2 -2
- package/dist/camunda-platform-modeler.development.js +7557 -6077
- package/dist/camunda-platform-modeler.production.min.js +4 -4
- package/dist/camunda-platform-navigated-viewer.development.js +631 -257
- package/dist/camunda-platform-navigated-viewer.production.min.js +2 -2
- package/dist/camunda-platform-viewer.development.js +630 -256
- package/dist/camunda-platform-viewer.production.min.js +2 -2
- package/lib/base/Modeler.js +46 -46
- package/lib/base/NavigatedViewer.js +2 -2
- package/lib/base/Viewer.js +2 -2
- package/lib/camunda-cloud/Modeler.js +68 -68
- package/lib/camunda-cloud/NavigatedViewer.js +34 -34
- package/lib/camunda-cloud/Viewer.js +34 -34
- package/lib/camunda-cloud/features/context-pad/ContextPadOptions.js +15 -15
- package/lib/camunda-cloud/features/context-pad/index.js +6 -6
- package/lib/camunda-cloud/features/drilldown/index.js +3 -3
- package/lib/camunda-cloud/features/palette/PaletteOptions.js +14 -14
- package/lib/camunda-cloud/features/palette/PaletteProvider.js +31 -31
- package/lib/camunda-cloud/features/palette/index.js +6 -6
- package/lib/camunda-cloud/features/popup-menu/ReplaceMenuProvider.js +71 -71
- package/lib/camunda-cloud/features/popup-menu/ReplaceOptions.js +46 -46
- package/lib/camunda-cloud/features/popup-menu/index.js +6 -6
- package/lib/camunda-cloud/features/rules/BpmnRules.js +137 -137
- package/lib/camunda-cloud/features/rules/index.js +5 -5
- package/lib/camunda-cloud/util/commonModules.js +13 -13
- package/lib/camunda-platform/Modeler.js +46 -46
- package/lib/camunda-platform/NavigatedViewer.js +25 -25
- package/lib/camunda-platform/Viewer.js +24 -24
- package/lib/camunda-platform/util/commonModules.js +6 -6
- package/lib/util/ExtensionElementsUtil.js +59 -59
- package/package.json +110 -110
- package/styles/base-modeler.css +4 -4
- package/styles/base-navigated-viewer.css +1 -1
- package/styles/base-viewer.css +1 -1
- package/styles/camunda-cloud-modeler.css +1 -1
- package/styles/camunda-platform-modeler.css +1 -1
- package/util/index.js +39 -39
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
forEach
|
|
3
|
-
} from 'min-dash';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
isEventSubProcess
|
|
7
|
-
} from 'bpmn-js/lib/util/DiUtil';
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
isAny
|
|
11
|
-
} from 'bpmn-js/lib/features/modeling/util/ModelingUtil';
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
REPLACE_OPTIONS as availableReplaceElements,
|
|
15
|
-
HEADER_OPTIONS as availableHeaderEntries
|
|
16
|
-
} from './ReplaceOptions';
|
|
17
|
-
|
|
18
|
-
export default class ReplaceMenuProvider {
|
|
19
|
-
|
|
20
|
-
constructor(popupMenu) {
|
|
21
|
-
popupMenu.registerProvider('bpmn-replace', this);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
getPopupMenuHeaderEntries(element) {
|
|
25
|
-
|
|
26
|
-
return function(entries) {
|
|
27
|
-
let headerEntries = {};
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
isAny(element, [
|
|
31
|
-
'bpmn:Task',
|
|
32
|
-
'bpmn:ReceiveTask',
|
|
33
|
-
'bpmn:ServiceTask',
|
|
34
|
-
'bpmn:SubProcess',
|
|
35
|
-
'bpmn:CallActivity'
|
|
36
|
-
]) && !isEventSubProcess(element)
|
|
37
|
-
) {
|
|
38
|
-
|
|
39
|
-
forEach(entries, function(entry, key) {
|
|
40
|
-
if (availableHeaderEntries.includes(key)) {
|
|
41
|
-
headerEntries = {
|
|
42
|
-
...headerEntries,
|
|
43
|
-
[key]: entry
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
entries = headerEntries;
|
|
51
|
-
|
|
52
|
-
return entries;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
getPopupMenuEntries(element) {
|
|
57
|
-
return function(entries) {
|
|
58
|
-
|
|
59
|
-
forEach(entries, function(entry, key) {
|
|
60
|
-
if (!availableReplaceElements.includes(key)) {
|
|
61
|
-
delete entries[key];
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
return entries;
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
ReplaceMenuProvider.$inject = [
|
|
71
|
-
'popupMenu'
|
|
1
|
+
import {
|
|
2
|
+
forEach
|
|
3
|
+
} from 'min-dash';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
isEventSubProcess
|
|
7
|
+
} from 'bpmn-js/lib/util/DiUtil';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
isAny
|
|
11
|
+
} from 'bpmn-js/lib/features/modeling/util/ModelingUtil';
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
REPLACE_OPTIONS as availableReplaceElements,
|
|
15
|
+
HEADER_OPTIONS as availableHeaderEntries
|
|
16
|
+
} from './ReplaceOptions';
|
|
17
|
+
|
|
18
|
+
export default class ReplaceMenuProvider {
|
|
19
|
+
|
|
20
|
+
constructor(popupMenu) {
|
|
21
|
+
popupMenu.registerProvider('bpmn-replace', this);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
getPopupMenuHeaderEntries(element) {
|
|
25
|
+
|
|
26
|
+
return function(entries) {
|
|
27
|
+
let headerEntries = {};
|
|
28
|
+
|
|
29
|
+
if (
|
|
30
|
+
isAny(element, [
|
|
31
|
+
'bpmn:Task',
|
|
32
|
+
'bpmn:ReceiveTask',
|
|
33
|
+
'bpmn:ServiceTask',
|
|
34
|
+
'bpmn:SubProcess',
|
|
35
|
+
'bpmn:CallActivity'
|
|
36
|
+
]) && !isEventSubProcess(element)
|
|
37
|
+
) {
|
|
38
|
+
|
|
39
|
+
forEach(entries, function(entry, key) {
|
|
40
|
+
if (availableHeaderEntries.includes(key)) {
|
|
41
|
+
headerEntries = {
|
|
42
|
+
...headerEntries,
|
|
43
|
+
[key]: entry
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
entries = headerEntries;
|
|
51
|
+
|
|
52
|
+
return entries;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
getPopupMenuEntries(element) {
|
|
57
|
+
return function(entries) {
|
|
58
|
+
|
|
59
|
+
forEach(entries, function(entry, key) {
|
|
60
|
+
if (!availableReplaceElements.includes(key)) {
|
|
61
|
+
delete entries[key];
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
return entries;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
ReplaceMenuProvider.$inject = [
|
|
71
|
+
'popupMenu'
|
|
72
72
|
];
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
export const REPLACE_OPTIONS = [
|
|
2
|
-
'replace-with-service-task',
|
|
3
|
-
'replace-with-script-task',
|
|
4
|
-
'replace-with-send-task',
|
|
5
|
-
'replace-with-rule-task',
|
|
6
|
-
'replace-with-message-intermediate-catch',
|
|
7
|
-
'replace-with-message-intermediate-throw',
|
|
8
|
-
'replace-with-timer-intermediate-catch',
|
|
9
|
-
'replace-with-none-start',
|
|
10
|
-
'replace-with-none-end',
|
|
11
|
-
'replace-with-conditional-flow',
|
|
12
|
-
'replace-with-default-flow',
|
|
13
|
-
'replace-with-sequence-flow',
|
|
14
|
-
'replace-with-parallel-gateway',
|
|
15
|
-
'replace-with-exclusive-gateway',
|
|
16
|
-
'replace-with-collapsed-subprocess',
|
|
17
|
-
'replace-with-expanded-subprocess',
|
|
18
|
-
'replace-with-timer-boundary',
|
|
19
|
-
'replace-with-message-boundary',
|
|
20
|
-
'replace-with-event-based-gateway',
|
|
21
|
-
'replace-with-receive-task',
|
|
22
|
-
'replace-with-task',
|
|
23
|
-
'replace-with-manual-task',
|
|
24
|
-
'replace-with-message-start',
|
|
25
|
-
'replace-with-message-end',
|
|
26
|
-
'replace-with-timer-start',
|
|
27
|
-
'replace-with-none-intermediate-throw',
|
|
28
|
-
'replace-with-none-intermediate-throwing', // only for StartEvent
|
|
29
|
-
'replace-with-non-interrupting-message-boundary',
|
|
30
|
-
'replace-with-non-interrupting-timer-boundary',
|
|
31
|
-
'replace-with-error-boundary',
|
|
32
|
-
'replace-with-error-end',
|
|
33
|
-
'replace-with-event-subprocess',
|
|
34
|
-
'replace-with-subprocess',
|
|
35
|
-
'replace-with-error-start',
|
|
36
|
-
'replace-with-non-interrupting-message-start',
|
|
37
|
-
'replace-with-non-interrupting-timer-start',
|
|
38
|
-
'replace-with-expanded-pool',
|
|
39
|
-
'replace-with-collapsed-pool',
|
|
40
|
-
'replace-with-call-activity',
|
|
41
|
-
'replace-with-user-task'
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
export const HEADER_OPTIONS = [
|
|
45
|
-
'toggle-parallel-mi',
|
|
46
|
-
'toggle-sequential-mi'
|
|
1
|
+
export const REPLACE_OPTIONS = [
|
|
2
|
+
'replace-with-service-task',
|
|
3
|
+
'replace-with-script-task',
|
|
4
|
+
'replace-with-send-task',
|
|
5
|
+
'replace-with-rule-task',
|
|
6
|
+
'replace-with-message-intermediate-catch',
|
|
7
|
+
'replace-with-message-intermediate-throw',
|
|
8
|
+
'replace-with-timer-intermediate-catch',
|
|
9
|
+
'replace-with-none-start',
|
|
10
|
+
'replace-with-none-end',
|
|
11
|
+
'replace-with-conditional-flow',
|
|
12
|
+
'replace-with-default-flow',
|
|
13
|
+
'replace-with-sequence-flow',
|
|
14
|
+
'replace-with-parallel-gateway',
|
|
15
|
+
'replace-with-exclusive-gateway',
|
|
16
|
+
'replace-with-collapsed-subprocess',
|
|
17
|
+
'replace-with-expanded-subprocess',
|
|
18
|
+
'replace-with-timer-boundary',
|
|
19
|
+
'replace-with-message-boundary',
|
|
20
|
+
'replace-with-event-based-gateway',
|
|
21
|
+
'replace-with-receive-task',
|
|
22
|
+
'replace-with-task',
|
|
23
|
+
'replace-with-manual-task',
|
|
24
|
+
'replace-with-message-start',
|
|
25
|
+
'replace-with-message-end',
|
|
26
|
+
'replace-with-timer-start',
|
|
27
|
+
'replace-with-none-intermediate-throw',
|
|
28
|
+
'replace-with-none-intermediate-throwing', // only for StartEvent
|
|
29
|
+
'replace-with-non-interrupting-message-boundary',
|
|
30
|
+
'replace-with-non-interrupting-timer-boundary',
|
|
31
|
+
'replace-with-error-boundary',
|
|
32
|
+
'replace-with-error-end',
|
|
33
|
+
'replace-with-event-subprocess',
|
|
34
|
+
'replace-with-subprocess',
|
|
35
|
+
'replace-with-error-start',
|
|
36
|
+
'replace-with-non-interrupting-message-start',
|
|
37
|
+
'replace-with-non-interrupting-timer-start',
|
|
38
|
+
'replace-with-expanded-pool',
|
|
39
|
+
'replace-with-collapsed-pool',
|
|
40
|
+
'replace-with-call-activity',
|
|
41
|
+
'replace-with-user-task'
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
export const HEADER_OPTIONS = [
|
|
45
|
+
'toggle-parallel-mi',
|
|
46
|
+
'toggle-sequential-mi'
|
|
47
47
|
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ReplaceMenuProvider from './ReplaceMenuProvider';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
__init__: [ 'zeebeReplaceMenuProvider' ],
|
|
5
|
-
zeebeReplaceMenuProvider: [ 'type', ReplaceMenuProvider ]
|
|
6
|
-
};
|
|
1
|
+
import ReplaceMenuProvider from './ReplaceMenuProvider';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
__init__: [ 'zeebeReplaceMenuProvider' ],
|
|
5
|
+
zeebeReplaceMenuProvider: [ 'type', ReplaceMenuProvider ]
|
|
6
|
+
};
|
|
@@ -1,138 +1,138 @@
|
|
|
1
|
-
import BpmnRules from 'bpmn-js/lib/features/rules/BpmnRules';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
find
|
|
5
|
-
} from 'min-dash';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
isLabel
|
|
9
|
-
} from 'bpmn-js/lib/util/LabelUtil';
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
is,
|
|
13
|
-
getBusinessObject
|
|
14
|
-
} from 'bpmn-js/lib/util/ModelUtil';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
isEventSubProcess
|
|
19
|
-
} from 'bpmn-js/lib/util/DiUtil';
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
getBoundaryAttachment as isBoundaryAttachment
|
|
23
|
-
} from 'bpmn-js/lib/features/snapping/BpmnSnappingUtil';
|
|
24
|
-
|
|
25
|
-
const HIGH_PRIORITY = 5000;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Zeebe rule provider that allows to create boundary events with catch events
|
|
29
|
-
*
|
|
30
|
-
* See {@link CustomRules} for the default implementation
|
|
31
|
-
* of BPMN 2.0 modeling rules provided by bpmn-js.
|
|
32
|
-
*
|
|
33
|
-
* @param {EventBus} eventBus
|
|
34
|
-
*/
|
|
35
|
-
export default class CustomRules extends BpmnRules {
|
|
36
|
-
|
|
37
|
-
constructor(eventBus) {
|
|
38
|
-
super(eventBus);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
init() {
|
|
42
|
-
super.init();
|
|
43
|
-
this.addRule('shape.attach', HIGH_PRIORITY,(context) => {
|
|
44
|
-
return this.canAttach(
|
|
45
|
-
context.shape,
|
|
46
|
-
context.target,
|
|
47
|
-
null,
|
|
48
|
-
context.position);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
canAttach(elements, target, source, position) {
|
|
53
|
-
function isBoundaryEvent(element) {
|
|
54
|
-
return !isLabel(element) && is(element, 'bpmn:BoundaryEvent');
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* In Zeebe we treat IntermediateCatchEvents as boundary events too,
|
|
59
|
-
* this must be reflected in the rules.
|
|
60
|
-
*/
|
|
61
|
-
function isBoundaryCandidate(element) {
|
|
62
|
-
return isBoundaryEvent(element) || (
|
|
63
|
-
(
|
|
64
|
-
is(element, 'bpmn:IntermediateCatchEvent') ||
|
|
65
|
-
is(element, 'bpmn:IntermediateThrowEvent')
|
|
66
|
-
) && !element.parent
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function isForCompensation(e) {
|
|
71
|
-
return getBusinessObject(e).isForCompensation;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function isReceiveTaskAfterEventBasedGateway(element) {
|
|
75
|
-
return (
|
|
76
|
-
is(element, 'bpmn:ReceiveTask') &&
|
|
77
|
-
find(element.incoming, function(incoming) {
|
|
78
|
-
return is(incoming.source, 'bpmn:EventBasedGateway');
|
|
79
|
-
})
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (!Array.isArray(elements)) {
|
|
84
|
-
elements = [ elements ];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// disallow appending as boundary event
|
|
88
|
-
if (source) {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// only (re-)attach one element at a time
|
|
93
|
-
if (elements.length !== 1) {
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const element = elements[0];
|
|
98
|
-
|
|
99
|
-
// do not attach labels
|
|
100
|
-
if (isLabel(element)) {
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// only handle boundary events
|
|
105
|
-
if (!isBoundaryCandidate(element)) {
|
|
106
|
-
return false;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// allow default move operation
|
|
110
|
-
if (!target) {
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// disallow drop on event sub processes
|
|
115
|
-
if (isEventSubProcess(target)) {
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// only allow drop on non compensation activities
|
|
120
|
-
if (!is(target, 'bpmn:Activity') || isForCompensation(target)) {
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// only attach to subprocess border
|
|
125
|
-
if (position && !isBoundaryAttachment(position, target)) {
|
|
126
|
-
return false;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// do not attach on receive tasks after event based gateways
|
|
130
|
-
if (isReceiveTaskAfterEventBasedGateway(target)) {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return 'attach';
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
1
|
+
import BpmnRules from 'bpmn-js/lib/features/rules/BpmnRules';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
find
|
|
5
|
+
} from 'min-dash';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
isLabel
|
|
9
|
+
} from 'bpmn-js/lib/util/LabelUtil';
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
is,
|
|
13
|
+
getBusinessObject
|
|
14
|
+
} from 'bpmn-js/lib/util/ModelUtil';
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
isEventSubProcess
|
|
19
|
+
} from 'bpmn-js/lib/util/DiUtil';
|
|
20
|
+
|
|
21
|
+
import {
|
|
22
|
+
getBoundaryAttachment as isBoundaryAttachment
|
|
23
|
+
} from 'bpmn-js/lib/features/snapping/BpmnSnappingUtil';
|
|
24
|
+
|
|
25
|
+
const HIGH_PRIORITY = 5000;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Zeebe rule provider that allows to create boundary events with catch events
|
|
29
|
+
*
|
|
30
|
+
* See {@link CustomRules} for the default implementation
|
|
31
|
+
* of BPMN 2.0 modeling rules provided by bpmn-js.
|
|
32
|
+
*
|
|
33
|
+
* @param {EventBus} eventBus
|
|
34
|
+
*/
|
|
35
|
+
export default class CustomRules extends BpmnRules {
|
|
36
|
+
|
|
37
|
+
constructor(eventBus) {
|
|
38
|
+
super(eventBus);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
init() {
|
|
42
|
+
super.init();
|
|
43
|
+
this.addRule('shape.attach', HIGH_PRIORITY,(context) => {
|
|
44
|
+
return this.canAttach(
|
|
45
|
+
context.shape,
|
|
46
|
+
context.target,
|
|
47
|
+
null,
|
|
48
|
+
context.position);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
canAttach(elements, target, source, position) {
|
|
53
|
+
function isBoundaryEvent(element) {
|
|
54
|
+
return !isLabel(element) && is(element, 'bpmn:BoundaryEvent');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* In Zeebe we treat IntermediateCatchEvents as boundary events too,
|
|
59
|
+
* this must be reflected in the rules.
|
|
60
|
+
*/
|
|
61
|
+
function isBoundaryCandidate(element) {
|
|
62
|
+
return isBoundaryEvent(element) || (
|
|
63
|
+
(
|
|
64
|
+
is(element, 'bpmn:IntermediateCatchEvent') ||
|
|
65
|
+
is(element, 'bpmn:IntermediateThrowEvent')
|
|
66
|
+
) && !element.parent
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function isForCompensation(e) {
|
|
71
|
+
return getBusinessObject(e).isForCompensation;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function isReceiveTaskAfterEventBasedGateway(element) {
|
|
75
|
+
return (
|
|
76
|
+
is(element, 'bpmn:ReceiveTask') &&
|
|
77
|
+
find(element.incoming, function(incoming) {
|
|
78
|
+
return is(incoming.source, 'bpmn:EventBasedGateway');
|
|
79
|
+
})
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (!Array.isArray(elements)) {
|
|
84
|
+
elements = [ elements ];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// disallow appending as boundary event
|
|
88
|
+
if (source) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// only (re-)attach one element at a time
|
|
93
|
+
if (elements.length !== 1) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const element = elements[0];
|
|
98
|
+
|
|
99
|
+
// do not attach labels
|
|
100
|
+
if (isLabel(element)) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// only handle boundary events
|
|
105
|
+
if (!isBoundaryCandidate(element)) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// allow default move operation
|
|
110
|
+
if (!target) {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// disallow drop on event sub processes
|
|
115
|
+
if (isEventSubProcess(target)) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// only allow drop on non compensation activities
|
|
120
|
+
if (!is(target, 'bpmn:Activity') || isForCompensation(target)) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// only attach to subprocess border
|
|
125
|
+
if (position && !isBoundaryAttachment(position, target)) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// do not attach on receive tasks after event based gateways
|
|
130
|
+
if (isReceiveTaskAfterEventBasedGateway(target)) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return 'attach';
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
138
|
CustomRules.$inject = [ 'eventBus' ];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import BpmnRules from './BpmnRules';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
__init__: [ 'bpmnRules' ],
|
|
5
|
-
bpmnRules: [ 'type', BpmnRules ]
|
|
1
|
+
import BpmnRules from './BpmnRules';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
__init__: [ 'bpmnRules' ],
|
|
5
|
+
bpmnRules: [ 'type', BpmnRules ]
|
|
6
6
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import iconRendererModule from '@bpmn-io/element-templates-icons-renderer';
|
|
2
|
-
|
|
3
|
-
import drilldownModule from '../features/drilldown';
|
|
4
|
-
|
|
5
|
-
import zeebeModdle from 'zeebe-bpmn-moddle/resources/zeebe.json';
|
|
6
|
-
|
|
7
|
-
export const commonModules = [
|
|
8
|
-
drilldownModule,
|
|
9
|
-
iconRendererModule
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
export const commonModdleExtensions = {
|
|
13
|
-
zeebe: zeebeModdle
|
|
1
|
+
import iconRendererModule from '@bpmn-io/element-templates-icons-renderer';
|
|
2
|
+
|
|
3
|
+
import drilldownModule from '../features/drilldown';
|
|
4
|
+
|
|
5
|
+
import zeebeModdle from 'zeebe-bpmn-moddle/resources/zeebe.json';
|
|
6
|
+
|
|
7
|
+
export const commonModules = [
|
|
8
|
+
drilldownModule,
|
|
9
|
+
iconRendererModule
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
export const commonModdleExtensions = {
|
|
13
|
+
zeebe: zeebeModdle
|
|
14
14
|
};
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import inherits from 'inherits';
|
|
2
|
-
|
|
3
|
-
import BaseModeler from '../base/Modeler';
|
|
4
|
-
|
|
5
|
-
import behaviorsModule from 'camunda-bpmn-js-behaviors/lib/camunda-platform';
|
|
6
|
-
|
|
7
|
-
import camundaModdleExtension from 'camunda-bpmn-moddle/lib';
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
CamundaPlatformPropertiesProviderModule,
|
|
11
|
-
ElementTemplatesPropertiesProviderModule
|
|
12
|
-
} from 'bpmn-js-properties-panel';
|
|
13
|
-
|
|
14
|
-
import { commonModdleExtensions } from './util/commonModules';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @param {Object} options
|
|
20
|
-
*/
|
|
21
|
-
export default function Modeler(options = {}) {
|
|
22
|
-
|
|
23
|
-
options = {
|
|
24
|
-
...options,
|
|
25
|
-
moddleExtensions: {
|
|
26
|
-
...commonModdleExtensions,
|
|
27
|
-
...options.moddleExtensions
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
BaseModeler.call(this, options);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
inherits(Modeler, BaseModeler);
|
|
35
|
-
|
|
36
|
-
Modeler.prototype._camundaPlatformModules = [
|
|
37
|
-
camundaModdleExtension,
|
|
38
|
-
behaviorsModule,
|
|
39
|
-
CamundaPlatformPropertiesProviderModule,
|
|
40
|
-
ElementTemplatesPropertiesProviderModule
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
Modeler.prototype._modules = [].concat(
|
|
44
|
-
BaseModeler.prototype._modules,
|
|
45
|
-
Modeler.prototype._camundaPlatformModules
|
|
46
|
-
);
|
|
1
|
+
import inherits from 'inherits';
|
|
2
|
+
|
|
3
|
+
import BaseModeler from '../base/Modeler';
|
|
4
|
+
|
|
5
|
+
import behaviorsModule from 'camunda-bpmn-js-behaviors/lib/camunda-platform';
|
|
6
|
+
|
|
7
|
+
import camundaModdleExtension from 'camunda-bpmn-moddle/lib';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
CamundaPlatformPropertiesProviderModule,
|
|
11
|
+
ElementTemplatesPropertiesProviderModule
|
|
12
|
+
} from 'bpmn-js-properties-panel';
|
|
13
|
+
|
|
14
|
+
import { commonModdleExtensions } from './util/commonModules';
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param {Object} options
|
|
20
|
+
*/
|
|
21
|
+
export default function Modeler(options = {}) {
|
|
22
|
+
|
|
23
|
+
options = {
|
|
24
|
+
...options,
|
|
25
|
+
moddleExtensions: {
|
|
26
|
+
...commonModdleExtensions,
|
|
27
|
+
...options.moddleExtensions
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
BaseModeler.call(this, options);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
inherits(Modeler, BaseModeler);
|
|
35
|
+
|
|
36
|
+
Modeler.prototype._camundaPlatformModules = [
|
|
37
|
+
camundaModdleExtension,
|
|
38
|
+
behaviorsModule,
|
|
39
|
+
CamundaPlatformPropertiesProviderModule,
|
|
40
|
+
ElementTemplatesPropertiesProviderModule
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
Modeler.prototype._modules = [].concat(
|
|
44
|
+
BaseModeler.prototype._modules,
|
|
45
|
+
Modeler.prototype._camundaPlatformModules
|
|
46
|
+
);
|