camunda-bpmn-js 3.9.0 → 3.10.1
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/dist/assets/diagram-js.css +5 -0
- package/dist/base-modeler.development.js +48 -14
- package/dist/base-modeler.production.min.js +3 -3
- package/dist/base-navigated-viewer.development.js +18 -14
- package/dist/base-navigated-viewer.production.min.js +1 -1
- package/dist/base-viewer.development.js +18 -14
- package/dist/base-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-modeler.development.js +414 -517
- package/dist/camunda-cloud-modeler.production.min.js +6 -6
- package/dist/camunda-cloud-navigated-viewer.development.js +18 -14
- package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-viewer.development.js +18 -14
- package/dist/camunda-cloud-viewer.production.min.js +1 -1
- package/dist/camunda-platform-modeler.development.js +92 -21
- package/dist/camunda-platform-modeler.production.min.js +5 -5
- package/dist/camunda-platform-navigated-viewer.development.js +18 -14
- package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-platform-viewer.development.js +18 -14
- package/dist/camunda-platform-viewer.production.min.js +1 -1
- package/lib/camunda-cloud/Modeler.js +0 -3
- package/package.json +6 -6
- package/lib/camunda-cloud/features/rules/BpmnRules.d.ts +0 -32
- package/lib/camunda-cloud/features/rules/BpmnRules.js +0 -161
- package/lib/camunda-cloud/features/rules/index.d.ts +0 -6
- package/lib/camunda-cloud/features/rules/index.js +0 -6
|
@@ -4,8 +4,6 @@ import BaseModeler from '../base/Modeler';
|
|
|
4
4
|
|
|
5
5
|
import behaviorsModule from 'camunda-bpmn-js-behaviors/lib/camunda-cloud';
|
|
6
6
|
|
|
7
|
-
import rulesModule from './features/rules';
|
|
8
|
-
|
|
9
7
|
import {
|
|
10
8
|
ZeebePropertiesProviderModule as zeebePropertiesProviderModule,
|
|
11
9
|
ZeebeTooltipProvider
|
|
@@ -70,7 +68,6 @@ Modeler.prototype._addElementTemplateChooserModule = function(options) {
|
|
|
70
68
|
Modeler.prototype._camundaCloudModules = [
|
|
71
69
|
...commonModules,
|
|
72
70
|
behaviorsModule,
|
|
73
|
-
rulesModule,
|
|
74
71
|
zeebePropertiesProviderModule,
|
|
75
72
|
cloudElementTemplatesPropertiesProvider,
|
|
76
73
|
createAppendAnythingModule,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "camunda-bpmn-js",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.1",
|
|
4
4
|
"description": "Embeddable Camunda modeling distributions based on bpmn-js",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -55,24 +55,23 @@
|
|
|
55
55
|
"@bpmn-io/align-to-origin": "^0.7.0",
|
|
56
56
|
"@bpmn-io/element-template-chooser": "^1.0.0",
|
|
57
57
|
"@bpmn-io/element-template-icon-renderer": "^0.5.1",
|
|
58
|
-
"@bpmn-io/form-variable-provider": "^1.
|
|
58
|
+
"@bpmn-io/form-variable-provider": "^1.2.0",
|
|
59
59
|
"@bpmn-io/properties-panel": "^3.13.0",
|
|
60
60
|
"@bpmn-io/variable-resolver": "^1.2.0",
|
|
61
61
|
"@camunda/example-data-properties-provider": "^1.2.0",
|
|
62
|
-
"bpmn-js": "^15.
|
|
62
|
+
"bpmn-js": "^15.2.2",
|
|
63
63
|
"bpmn-js-color-picker": "^0.6.1",
|
|
64
64
|
"bpmn-js-create-append-anything": "^0.4.0",
|
|
65
|
-
"bpmn-js-element-templates": "^1.
|
|
65
|
+
"bpmn-js-element-templates": "^1.9.1",
|
|
66
66
|
"bpmn-js-executable-fix": "^0.2.1",
|
|
67
67
|
"camunda-bpmn-js-behaviors": "^1.2.2",
|
|
68
68
|
"camunda-bpmn-moddle": "^7.0.1",
|
|
69
|
-
"diagram-js": "^12.
|
|
69
|
+
"diagram-js": "^12.8.1",
|
|
70
70
|
"diagram-js-grid": "^0.2.0",
|
|
71
71
|
"diagram-js-minimap": "^4.1.0",
|
|
72
72
|
"diagram-js-origin": "^1.4.0",
|
|
73
73
|
"inherits-browser": "^0.1.0",
|
|
74
74
|
"min-dash": "^4.1.1",
|
|
75
|
-
"typescript": "^5.0.4",
|
|
76
75
|
"zeebe-bpmn-moddle": "^1.0.0"
|
|
77
76
|
},
|
|
78
77
|
"devDependencies": {
|
|
@@ -116,6 +115,7 @@
|
|
|
116
115
|
"rollup-plugin-copy": "^3.5.0",
|
|
117
116
|
"sinon": "^17.0.0",
|
|
118
117
|
"sinon-chai": "^3.7.0",
|
|
118
|
+
"typescript": "^5.0.4",
|
|
119
119
|
"webpack": "^5.88.2"
|
|
120
120
|
},
|
|
121
121
|
"peerDependencies": {
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zeebe rule provider that allows to create boundary events with catch events
|
|
3
|
-
*
|
|
4
|
-
* See {@link CustomRules} for the default implementation
|
|
5
|
-
* of BPMN 2.0 modeling rules provided by bpmn-js.
|
|
6
|
-
*/
|
|
7
|
-
declare class CustomRules extends BpmnRules {
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
declare namespace CustomRules {
|
|
11
|
-
export const $inject: string[];
|
|
12
|
-
export { canAttach };
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default CustomRules;
|
|
16
|
-
type EventBus = import('diagram-js/lib/core/EventBus').default;
|
|
17
|
-
type Element = import('bpmn-js/lib/model/Types').Element;
|
|
18
|
-
type Shape = import('bpmn-js/lib/model/Types').Shape;
|
|
19
|
-
type Point = import('diagram-js/lib/util/Types').Point;
|
|
20
|
-
import BpmnRules from 'bpmn-js/lib/features/rules/BpmnRules';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Zeebe-specific rule that allows attaching intermediate events.
|
|
24
|
-
*
|
|
25
|
-
* @param elements
|
|
26
|
-
* @param target
|
|
27
|
-
* @param source
|
|
28
|
-
* @param position
|
|
29
|
-
*
|
|
30
|
-
* @return
|
|
31
|
-
*/
|
|
32
|
-
declare function canAttach(elements: Element, target: Shape, source: Element, position: Point): boolean | 'attach';
|
|
@@ -1,161 +0,0 @@
|
|
|
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
|
-
/**
|
|
26
|
-
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
27
|
-
*
|
|
28
|
-
* @typedef {import('bpmn-js/lib/model/Types').Element} Element
|
|
29
|
-
* @typedef {import('bpmn-js/lib/model/Types').Shape} Shape
|
|
30
|
-
*
|
|
31
|
-
* @typedef {import('diagram-js/lib/util/Types').Point} Point
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
const HIGH_PRIORITY = 5000;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Zeebe rule provider that allows to create boundary events with catch events
|
|
38
|
-
*
|
|
39
|
-
* See {@link CustomRules} for the default implementation
|
|
40
|
-
* of BPMN 2.0 modeling rules provided by bpmn-js.
|
|
41
|
-
*/
|
|
42
|
-
export default class CustomRules extends BpmnRules {
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @param {EventBus} eventBus
|
|
46
|
-
*/
|
|
47
|
-
constructor(eventBus) {
|
|
48
|
-
super(eventBus);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
init() {
|
|
52
|
-
super.init();
|
|
53
|
-
|
|
54
|
-
this.addRule('shape.attach', HIGH_PRIORITY,(context) => {
|
|
55
|
-
return canAttach(
|
|
56
|
-
context.shape,
|
|
57
|
-
context.target,
|
|
58
|
-
null,
|
|
59
|
-
context.position);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
CustomRules.$inject = [ 'eventBus' ];
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Zeebe-specific rule that allows attaching intermediate events.
|
|
68
|
-
*
|
|
69
|
-
* @param {Element} elements
|
|
70
|
-
* @param {Shape} target
|
|
71
|
-
* @param {Element} source
|
|
72
|
-
* @param {Point} position
|
|
73
|
-
*
|
|
74
|
-
* @return {boolean|'attach'}
|
|
75
|
-
*/
|
|
76
|
-
function canAttach(elements, target, source, position) {
|
|
77
|
-
function isBoundaryEvent(element) {
|
|
78
|
-
return !isLabel(element) && is(element, 'bpmn:BoundaryEvent');
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* In Zeebe we treat IntermediateCatchEvents as boundary events too,
|
|
83
|
-
* this must be reflected in the rules.
|
|
84
|
-
*/
|
|
85
|
-
function isBoundaryCandidate(element) {
|
|
86
|
-
return isBoundaryEvent(element) || (
|
|
87
|
-
(
|
|
88
|
-
is(element, 'bpmn:IntermediateCatchEvent') ||
|
|
89
|
-
is(element, 'bpmn:IntermediateThrowEvent')
|
|
90
|
-
) && !element.parent
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function isForCompensation(e) {
|
|
95
|
-
return getBusinessObject(e).isForCompensation;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function isReceiveTaskAfterEventBasedGateway(element) {
|
|
99
|
-
return (
|
|
100
|
-
is(element, 'bpmn:ReceiveTask') &&
|
|
101
|
-
find(element.incoming, function(incoming) {
|
|
102
|
-
return is(incoming.source, 'bpmn:EventBasedGateway');
|
|
103
|
-
})
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (!Array.isArray(elements)) {
|
|
108
|
-
elements = [ elements ];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// disallow appending as boundary event
|
|
112
|
-
if (source) {
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// only (re-)attach one element at a time
|
|
117
|
-
if (elements.length !== 1) {
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const element = elements[0];
|
|
122
|
-
|
|
123
|
-
// do not attach labels
|
|
124
|
-
if (isLabel(element)) {
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// only handle boundary events
|
|
129
|
-
if (!isBoundaryCandidate(element)) {
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// allow default move operation
|
|
134
|
-
if (!target) {
|
|
135
|
-
return true;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// disallow drop on event sub processes
|
|
139
|
-
if (isEventSubProcess(target)) {
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// only allow drop on non compensation activities
|
|
144
|
-
if (!is(target, 'bpmn:Activity') || isForCompensation(target)) {
|
|
145
|
-
return false;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// only attach to subprocess border
|
|
149
|
-
if (position && !isBoundaryAttachment(position, target)) {
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// do not attach on receive tasks after event based gateways
|
|
154
|
-
if (isReceiveTaskAfterEventBasedGateway(target)) {
|
|
155
|
-
return false;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return 'attach';
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
CustomRules.canAttach = canAttach;
|