bpmn-js 18.22.0 → 18.23.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/dist/assets/diagram-js.css +4 -0
- package/dist/bpmn-modeler.development.js +1094 -326
- package/dist/bpmn-modeler.production.min.js +50 -50
- package/dist/bpmn-navigated-viewer.development.js +38 -5
- package/dist/bpmn-navigated-viewer.production.min.js +3 -3
- package/dist/bpmn-viewer.development.js +38 -5
- package/dist/bpmn-viewer.production.min.js +3 -3
- package/lib/BaseViewer.d.ts.map +1 -1
- package/lib/BaseViewer.js +37 -3
- package/lib/features/modeling/Modeling.d.ts +13 -0
- package/lib/features/modeling/Modeling.d.ts.map +1 -1
- package/lib/features/modeling/Modeling.js +21 -0
- package/lib/features/modeling/behavior/CategoryRootElementReferenceBehavior.d.ts +19 -0
- package/lib/features/modeling/behavior/CategoryRootElementReferenceBehavior.d.ts.map +1 -0
- package/lib/features/modeling/behavior/CategoryRootElementReferenceBehavior.js +157 -0
- package/lib/features/modeling/behavior/GroupBehavior.d.ts +2 -8
- package/lib/features/modeling/behavior/GroupBehavior.d.ts.map +1 -1
- package/lib/features/modeling/behavior/GroupBehavior.js +65 -134
- package/lib/features/modeling/behavior/UpdateCategoryValueRefsBehavior.d.ts +17 -0
- package/lib/features/modeling/behavior/UpdateCategoryValueRefsBehavior.d.ts.map +1 -0
- package/lib/features/modeling/behavior/UpdateCategoryValueRefsBehavior.js +169 -0
- package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.d.ts +1 -1
- package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.d.ts.map +1 -1
- package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.js +35 -37
- package/lib/features/modeling/behavior/index.d.ts +4 -0
- package/lib/features/modeling/behavior/index.d.ts.map +1 -1
- package/lib/features/modeling/behavior/index.js +6 -0
- package/lib/features/modeling/behavior/util/CategoryUtil.d.ts +12 -3
- package/lib/features/modeling/behavior/util/CategoryUtil.d.ts.map +1 -1
- package/lib/features/modeling/behavior/util/CategoryUtil.js +25 -2
- package/lib/features/modeling/cmd/UpdateCategoryValueRefsHandler.d.ts +40 -0
- package/lib/features/modeling/cmd/UpdateCategoryValueRefsHandler.d.ts.map +1 -0
- package/lib/features/modeling/cmd/UpdateCategoryValueRefsHandler.js +424 -0
- package/lib/features/modeling/cmd/UpdateFlowNodeRefsHandler.d.ts +0 -8
- package/lib/features/modeling/cmd/UpdateFlowNodeRefsHandler.d.ts.map +1 -1
- package/lib/features/modeling/cmd/UpdateFlowNodeRefsHandler.js +1 -9
- package/lib/features/rules/BpmnRules.js +38 -0
- package/package.json +3 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Synchronizes group category references after geometry changes.
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export default class UpdateCategoryValueRefsBehavior extends CommandInterceptor {
|
|
6
|
+
/**
|
|
7
|
+
* @param eventBus
|
|
8
|
+
* @param modeling
|
|
9
|
+
*/
|
|
10
|
+
constructor(eventBus: EventBus, modeling: Modeling);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type EventBus = import("diagram-js/lib/core/EventBus").default;
|
|
14
|
+
type Modeling = import("../Modeling").default;
|
|
15
|
+
|
|
16
|
+
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
17
|
+
//# sourceMappingURL=UpdateCategoryValueRefsBehavior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateCategoryValueRefsBehavior.d.ts","mappings":";;;;AA8CAA;;;;;IAAAC;;;gBArCa,OAAO,8BAA8B,EAAE;gBACvC,OAAO,aAAa,EAAE;;+BARJ,2CAA2C","names":["UpdateCategoryValueRefsBehavior class","UpdateCategoryValueRefsBehavior constructor"],"ignoreList":[],"sources":["UpdateCategoryValueRefsBehavior.js"]}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import inherits from 'inherits-browser';
|
|
2
|
+
|
|
3
|
+
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
is
|
|
7
|
+
} from '../../../util/ModelUtil';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
11
|
+
* @typedef {import('../Modeling').default} Modeling
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
var LOW_PRIORITY = 500,
|
|
15
|
+
HIGH_PRIORITY = 5000;
|
|
16
|
+
|
|
17
|
+
// Commands that provide a shape or connection whose references must be updated.
|
|
18
|
+
var categoryValueRefShapeAndConnectionEvents = [
|
|
19
|
+
'connection.create',
|
|
20
|
+
'connection.delete',
|
|
21
|
+
'connection.layout',
|
|
22
|
+
'connection.move',
|
|
23
|
+
'connection.reconnect',
|
|
24
|
+
'connection.updateWaypoints',
|
|
25
|
+
'shape.create',
|
|
26
|
+
'shape.delete',
|
|
27
|
+
'shape.move',
|
|
28
|
+
'shape.resize'
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
// Commands that bracket a complete reference update, including nested commands.
|
|
32
|
+
var categoryValueRefUpdateEvents = [
|
|
33
|
+
...categoryValueRefShapeAndConnectionEvents,
|
|
34
|
+
'elements.create',
|
|
35
|
+
'elements.delete',
|
|
36
|
+
'elements.move',
|
|
37
|
+
'label.create',
|
|
38
|
+
'spaceTool'
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Synchronizes group category references after geometry changes.
|
|
43
|
+
*
|
|
44
|
+
* @param {EventBus} eventBus
|
|
45
|
+
* @param {Modeling} modeling
|
|
46
|
+
*/
|
|
47
|
+
export default function UpdateCategoryValueRefsBehavior(eventBus, modeling) {
|
|
48
|
+
|
|
49
|
+
CommandInterceptor.call(this, eventBus);
|
|
50
|
+
|
|
51
|
+
var context;
|
|
52
|
+
|
|
53
|
+
function initContext() {
|
|
54
|
+
context = context || new UpdateContext();
|
|
55
|
+
context.enter();
|
|
56
|
+
|
|
57
|
+
return context;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function getContext() {
|
|
61
|
+
if (!context) {
|
|
62
|
+
throw new Error('out of bounds release');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return context;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function releaseContext() {
|
|
69
|
+
if (!context) {
|
|
70
|
+
throw new Error('out of bounds release');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
var triggerUpdate = context.leave();
|
|
74
|
+
|
|
75
|
+
if (triggerUpdate) {
|
|
76
|
+
modeling.updateCategoryValueRefs(
|
|
77
|
+
Array.from(context.affectedFlowElements),
|
|
78
|
+
Array.from(context.affectedGroupEntries.values())
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
context = null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return triggerUpdate;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Sets up the context for category value reference updates before executing
|
|
89
|
+
* commands that may affect them.
|
|
90
|
+
*/
|
|
91
|
+
this.preExecute(categoryValueRefUpdateEvents, HIGH_PRIORITY, function() {
|
|
92
|
+
initContext();
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Releases the context for category value reference updates after executing
|
|
97
|
+
* commands that may affect them.
|
|
98
|
+
*/
|
|
99
|
+
this.postExecuted(categoryValueRefUpdateEvents, LOW_PRIORITY, function() {
|
|
100
|
+
releaseContext();
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Handles updates to category value references for shapes and connections.
|
|
105
|
+
*/
|
|
106
|
+
this.preExecute(categoryValueRefShapeAndConnectionEvents, function(event) {
|
|
107
|
+
var shape = event.context.connection || event.context.shape,
|
|
108
|
+
updateContext = getContext();
|
|
109
|
+
|
|
110
|
+
if (!shape || shape.labelTarget) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (is(shape, 'bpmn:FlowElement')) {
|
|
115
|
+
updateContext.addFlowElement(shape);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (is(shape, 'bpmn:Group')) {
|
|
119
|
+
updateContext.addGroup(shape);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
this.preExecute('label.create', function(event) {
|
|
124
|
+
var labelTarget = event.context.labelTarget;
|
|
125
|
+
|
|
126
|
+
if (is(labelTarget, 'bpmn:Group')) {
|
|
127
|
+
getContext().addGroup(labelTarget);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
UpdateCategoryValueRefsBehavior.$inject = [
|
|
133
|
+
'eventBus',
|
|
134
|
+
'modeling'
|
|
135
|
+
];
|
|
136
|
+
|
|
137
|
+
inherits(UpdateCategoryValueRefsBehavior, CommandInterceptor);
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
function UpdateContext() {
|
|
141
|
+
|
|
142
|
+
this.affectedFlowElements = new Set();
|
|
143
|
+
this.affectedGroupEntries = new Map();
|
|
144
|
+
|
|
145
|
+
this.counter = 0;
|
|
146
|
+
|
|
147
|
+
this.addFlowElement = function(flowElement) {
|
|
148
|
+
this.affectedFlowElements.add(flowElement);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
this.addGroup = function(group) {
|
|
152
|
+
if (!this.affectedGroupEntries.has(group)) {
|
|
153
|
+
this.affectedGroupEntries.set(group, {
|
|
154
|
+
categoryValue: group.businessObject.categoryValueRef,
|
|
155
|
+
groupShape: group
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
this.enter = function() {
|
|
161
|
+
this.counter++;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
this.leave = function() {
|
|
165
|
+
this.counter--;
|
|
166
|
+
|
|
167
|
+
return !this.counter;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateFlowNodeRefsBehavior.d.ts","mappings":";;;;
|
|
1
|
+
{"version":3,"file":"UpdateFlowNodeRefsBehavior.d.ts","mappings":";;;;AA0CAA;;;;;IAAAC;;;gBAjCa,OAAO,8BAA8B,EAAE;gBACvC,OAAO,aAAa,EAAE;;+BARJ,2CAA2C","names":["UpdateFlowNodeRefsBehavior class","UpdateFlowNodeRefsBehavior constructor"],"ignoreList":[],"sources":["UpdateFlowNodeRefsBehavior.js"]}
|
|
@@ -14,9 +14,28 @@ import {
|
|
|
14
14
|
var LOW_PRIORITY = 500,
|
|
15
15
|
HIGH_PRIORITY = 5000;
|
|
16
16
|
|
|
17
|
+
// Commands that provide a shape whose lane references must be updated.
|
|
18
|
+
var laneRefShapeEvents = [
|
|
19
|
+
'shape.create',
|
|
20
|
+
'shape.delete',
|
|
21
|
+
'shape.move',
|
|
22
|
+
'shape.resize'
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
// Commands that bracket a complete lane reference update, including nested commands.
|
|
26
|
+
var laneRefUpdateEvents = [
|
|
27
|
+
...laneRefShapeEvents,
|
|
28
|
+
'spaceTool',
|
|
29
|
+
'lane.add',
|
|
30
|
+
'lane.resize',
|
|
31
|
+
'lane.split',
|
|
32
|
+
'elements.create',
|
|
33
|
+
'elements.delete',
|
|
34
|
+
'elements.move'
|
|
35
|
+
];
|
|
17
36
|
|
|
18
37
|
/**
|
|
19
|
-
*
|
|
38
|
+
* Synchronizes lane flow node references after geometry changes.
|
|
20
39
|
*
|
|
21
40
|
* @param {EventBus} eventBus
|
|
22
41
|
* @param {Modeling} modeling
|
|
@@ -25,13 +44,6 @@ export default function UpdateFlowNodeRefsBehavior(eventBus, modeling) {
|
|
|
25
44
|
|
|
26
45
|
CommandInterceptor.call(this, eventBus);
|
|
27
46
|
|
|
28
|
-
/**
|
|
29
|
-
* Update Lane#flowNodeRefs and FlowNode#lanes with every flow node
|
|
30
|
-
* move/resize and lane move/resize. Groups elements to recompute containments
|
|
31
|
-
* as efficient as possible.
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
// the update context
|
|
35
47
|
var context;
|
|
36
48
|
|
|
37
49
|
|
|
@@ -68,40 +80,26 @@ export default function UpdateFlowNodeRefsBehavior(eventBus, modeling) {
|
|
|
68
80
|
}
|
|
69
81
|
|
|
70
82
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
'elements.create',
|
|
77
|
-
'elements.delete',
|
|
78
|
-
'elements.move',
|
|
79
|
-
'shape.create',
|
|
80
|
-
'shape.delete',
|
|
81
|
-
'shape.move',
|
|
82
|
-
'shape.resize'
|
|
83
|
-
];
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
// listen to a lot of stuff to group lane updates
|
|
87
|
-
|
|
88
|
-
this.preExecute(laneRefUpdateEvents, HIGH_PRIORITY, function(event) {
|
|
83
|
+
/**
|
|
84
|
+
* Sets up the context for lane reference updates before executing commands
|
|
85
|
+
* that may affect them.
|
|
86
|
+
*/
|
|
87
|
+
this.preExecute(laneRefUpdateEvents, HIGH_PRIORITY, function() {
|
|
89
88
|
initContext();
|
|
90
89
|
});
|
|
91
90
|
|
|
92
|
-
|
|
91
|
+
/**
|
|
92
|
+
* Releases the context for lane reference updates after executing commands
|
|
93
|
+
* that may affect them.
|
|
94
|
+
*/
|
|
95
|
+
this.postExecuted(laneRefUpdateEvents, LOW_PRIORITY, function() {
|
|
93
96
|
releaseContext();
|
|
94
97
|
});
|
|
95
98
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
this.preExecute(
|
|
100
|
-
'shape.create',
|
|
101
|
-
'shape.move',
|
|
102
|
-
'shape.delete',
|
|
103
|
-
'shape.resize'
|
|
104
|
-
], function(event) {
|
|
99
|
+
/**
|
|
100
|
+
* Handles updates to lane references for shapes.
|
|
101
|
+
*/
|
|
102
|
+
this.preExecute(laneRefShapeEvents, function(event) {
|
|
105
103
|
|
|
106
104
|
var context = event.context,
|
|
107
105
|
shape = context.shape;
|
|
@@ -109,7 +107,7 @@ export default function UpdateFlowNodeRefsBehavior(eventBus, modeling) {
|
|
|
109
107
|
var updateContext = getContext();
|
|
110
108
|
|
|
111
109
|
// no need to update labels
|
|
112
|
-
if (shape.labelTarget) {
|
|
110
|
+
if (!shape || shape.labelTarget) {
|
|
113
111
|
return;
|
|
114
112
|
}
|
|
115
113
|
|
|
@@ -5,6 +5,7 @@ declare const _default: {
|
|
|
5
5
|
attachEventBehavior: (string | typeof AttachEventBehavior)[];
|
|
6
6
|
artifactBehavior: (string | typeof ArtifactBehavior)[];
|
|
7
7
|
boundaryEventBehavior: (string | typeof BoundaryEventBehavior)[];
|
|
8
|
+
categoryRootElementReferenceBehavior: (string | typeof CategoryRootElementReferenceBehavior)[];
|
|
8
9
|
compensateBoundaryEventBehaviour: (string | typeof CompensateBoundaryEventBehavior)[];
|
|
9
10
|
createBehavior: (string | typeof CreateBehavior)[];
|
|
10
11
|
createDataObjectBehavior: (string | typeof CreateDataObjectBehavior)[];
|
|
@@ -40,6 +41,7 @@ declare const _default: {
|
|
|
40
41
|
unclaimIdBehavior: (string | typeof UnclaimIdBehavior)[];
|
|
41
42
|
unsetDefaultFlowBehavior: (string | typeof UnsetDefaultFlowBehavior)[];
|
|
42
43
|
updateFlowNodeRefsBehavior: (string | typeof UpdateFlowNodeRefsBehavior)[];
|
|
44
|
+
updateCategoryValueRefsBehavior: (string | typeof UpdateCategoryValueRefsBehavior)[];
|
|
43
45
|
setCompensationActivityAfterPasteBehavior: (string | typeof SetCompensationActivityAfterPasteBehavior)[];
|
|
44
46
|
};
|
|
45
47
|
export default _default;
|
|
@@ -49,6 +51,7 @@ import AssociationBehavior from './AssociationBehavior';
|
|
|
49
51
|
import AttachEventBehavior from './AttachEventBehavior';
|
|
50
52
|
import ArtifactBehavior from './ArtifactBehavior';
|
|
51
53
|
import BoundaryEventBehavior from './BoundaryEventBehavior';
|
|
54
|
+
import CategoryRootElementReferenceBehavior from './CategoryRootElementReferenceBehavior';
|
|
52
55
|
import CompensateBoundaryEventBehavior from './CompensateBoundaryEventBehavior';
|
|
53
56
|
import CreateBehavior from './CreateBehavior';
|
|
54
57
|
import CreateDataObjectBehavior from './CreateDataObjectBehavior';
|
|
@@ -84,5 +87,6 @@ import ToggleElementCollapseBehaviour from './ToggleElementCollapseBehaviour';
|
|
|
84
87
|
import UnclaimIdBehavior from './UnclaimIdBehavior';
|
|
85
88
|
import UnsetDefaultFlowBehavior from './UnsetDefaultFlowBehavior';
|
|
86
89
|
import UpdateFlowNodeRefsBehavior from './UpdateFlowNodeRefsBehavior';
|
|
90
|
+
import UpdateCategoryValueRefsBehavior from './UpdateCategoryValueRefsBehavior';
|
|
87
91
|
import SetCompensationActivityAfterPasteBehavior from './SetCompensationActivityAfterPasteBehavior';
|
|
88
92
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAA6C,oCAAoC;2BACtD,kBAAkB;gCAEb,uBAAuB;gCACvB,uBAAuB;6BAF1B,oBAAoB;kCAGf,yBAAyB;iDACV,wCAAwC;4CAC7C,mCAAmC;2BACpD,kBAAkB;qCACR,4BAA4B;sCAC3B,6BAA6B;yCAC1B,gCAAgC;8BAC3C,qBAAqB;+BACpB,sBAAsB;gCACrB,uBAAuB;+BACxB,sBAAsB;sCACf,6BAA6B;6BACtC,oBAAoB;0BACvB,iBAAiB;6BACd,oBAAoB;4BACrB,mBAAmB;0BACrB,iBAAiB;qCACN,4BAA4B;gCACjC,uBAAuB;oCACnB,2BAA2B;kCAE7B,yBAAyB;8CADb,qCAAqC;sCAE7C,6BAA6B;sCAC7B,6BAA6B;oCAC/B,2BAA2B;2BACpC,kBAAkB;+BACd,sBAAsB;yCACZ,gCAAgC;8BAC3C,qBAAqB;oCACf,2BAA2B;yCACtB,gCAAgC;mCACtC,0BAA0B;8CACf,qCAAqC;2CACxC,kCAAkC;8BAC/C,qBAAqB;qCACd,4BAA4B;uCAC1B,8BAA8B;4CACzB,mCAAmC;sDACzB,6CAA6C","names":[],"ignoreList":[],"sources":["index.js"]}
|
|
@@ -4,6 +4,7 @@ import ArtifactBehavior from './ArtifactBehavior';
|
|
|
4
4
|
import AssociationBehavior from './AssociationBehavior';
|
|
5
5
|
import AttachEventBehavior from './AttachEventBehavior';
|
|
6
6
|
import BoundaryEventBehavior from './BoundaryEventBehavior';
|
|
7
|
+
import CategoryRootElementReferenceBehavior from './CategoryRootElementReferenceBehavior';
|
|
7
8
|
import CompensateBoundaryEventBehavior from './CompensateBoundaryEventBehavior';
|
|
8
9
|
import CreateBehavior from './CreateBehavior';
|
|
9
10
|
import CreateDataObjectBehavior from './CreateDataObjectBehavior';
|
|
@@ -39,6 +40,7 @@ import ToggleElementCollapseBehaviour from './ToggleElementCollapseBehaviour';
|
|
|
39
40
|
import UnclaimIdBehavior from './UnclaimIdBehavior';
|
|
40
41
|
import UnsetDefaultFlowBehavior from './UnsetDefaultFlowBehavior';
|
|
41
42
|
import UpdateFlowNodeRefsBehavior from './UpdateFlowNodeRefsBehavior';
|
|
43
|
+
import UpdateCategoryValueRefsBehavior from './UpdateCategoryValueRefsBehavior';
|
|
42
44
|
import SetCompensationActivityAfterPasteBehavior from './SetCompensationActivityAfterPasteBehavior';
|
|
43
45
|
|
|
44
46
|
/**
|
|
@@ -52,6 +54,7 @@ export default {
|
|
|
52
54
|
'associationBehavior',
|
|
53
55
|
'attachEventBehavior',
|
|
54
56
|
'boundaryEventBehavior',
|
|
57
|
+
'categoryRootElementReferenceBehavior',
|
|
55
58
|
'compensateBoundaryEventBehaviour',
|
|
56
59
|
'createBehavior',
|
|
57
60
|
'createDataObjectBehavior',
|
|
@@ -86,6 +89,7 @@ export default {
|
|
|
86
89
|
'toggleElementCollapseBehaviour',
|
|
87
90
|
'unclaimIdBehavior',
|
|
88
91
|
'updateFlowNodeRefsBehavior',
|
|
92
|
+
'updateCategoryValueRefsBehavior',
|
|
89
93
|
'unsetDefaultFlowBehavior',
|
|
90
94
|
'setCompensationActivityAfterPasteBehavior'
|
|
91
95
|
],
|
|
@@ -95,6 +99,7 @@ export default {
|
|
|
95
99
|
attachEventBehavior: [ 'type', AttachEventBehavior ],
|
|
96
100
|
artifactBehavior: [ 'type', ArtifactBehavior ],
|
|
97
101
|
boundaryEventBehavior: [ 'type', BoundaryEventBehavior ],
|
|
102
|
+
categoryRootElementReferenceBehavior: [ 'type', CategoryRootElementReferenceBehavior ],
|
|
98
103
|
compensateBoundaryEventBehaviour: [ 'type', CompensateBoundaryEventBehavior ],
|
|
99
104
|
createBehavior: [ 'type', CreateBehavior ],
|
|
100
105
|
createDataObjectBehavior: [ 'type', CreateDataObjectBehavior ],
|
|
@@ -130,5 +135,6 @@ export default {
|
|
|
130
135
|
unclaimIdBehavior: [ 'type', UnclaimIdBehavior ],
|
|
131
136
|
unsetDefaultFlowBehavior: [ 'type', UnsetDefaultFlowBehavior ],
|
|
132
137
|
updateFlowNodeRefsBehavior: [ 'type', UpdateFlowNodeRefsBehavior ],
|
|
138
|
+
updateCategoryValueRefsBehavior: [ 'type', UpdateCategoryValueRefsBehavior ],
|
|
133
139
|
setCompensationActivityAfterPasteBehavior: [ 'type', SetCompensationActivityAfterPasteBehavior ]
|
|
134
140
|
};
|
|
@@ -16,6 +16,17 @@ export function createCategory(bpmnFactory: BpmnFactory): ModdleElement;
|
|
|
16
16
|
*/
|
|
17
17
|
export function createCategoryValue(bpmnFactory: BpmnFactory): ModdleElement;
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Returns a group's category value, creating one (including a
|
|
21
|
+
* category) if needed.
|
|
22
|
+
*
|
|
23
|
+
* @param bpmnFactory
|
|
24
|
+
* @param groupBo
|
|
25
|
+
*
|
|
26
|
+
* @return
|
|
27
|
+
*/
|
|
28
|
+
export function getOrCreateCategoryValueForGroup(bpmnFactory: BpmnFactory, groupBo: ModdleElement): ModdleElement;
|
|
29
|
+
|
|
19
30
|
/**
|
|
20
31
|
* Adds category value to definitions
|
|
21
32
|
*
|
|
@@ -46,6 +57,4 @@ export function unlinkCategoryValue(categoryValue: ModdleElement): ModdleElement
|
|
|
46
57
|
export function unlinkCategory(category: ModdleElement): ModdleElement;
|
|
47
58
|
|
|
48
59
|
type BpmnFactory = import("../../BpmnFactory").default;
|
|
49
|
-
|
|
50
|
-
export type ModdleElement = any;
|
|
51
|
-
//# sourceMappingURL=CategoryUtil.d.ts.map
|
|
60
|
+
type ModdleElement = import("../../../../model/Types").ModdleElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryUtil.d.ts","mappings":";;;;;;;gBAkBA,4BAJW,YAAW,EAEV;;;;;;;;;AAaZ,iDAJW,WAAW,GAEV,aAAa;;;;;;;;;;;AAezB,iDANW,aAAa,YACb,aAAa,eACb,aAAa,GAEZ,aAAa;;;;;;;;;AAmBzB,mDAJW,aAAa,GAEZ,aAAa;;;;;;;;;AAoBzB,yCAJW,aAAa,GAEZ,aAAa;;
|
|
1
|
+
{"version":3,"file":"CategoryUtil.d.ts","mappings":";;;;;;;gBAkBA,4BAJW,YAAW,EAEV;;;;;;;;;AAaZ,iDAJW,WAAW,GAEV,aAAa;;;;;;;;;;;AAezB,8DALW,WAAW,WACX,aAAa,GAEZ,aAAa;;;;;;;;;;;AAyBzB,iDANW,aAAa,YACb,aAAa,eACb,aAAa,GAEZ,aAAa;;;;;;;;;AAmBzB,mDAJW,aAAa,GAEZ,aAAa;;;;;;;;;AAoBzB,yCAJW,aAAa,GAEZ,aAAa;;mBA5FZ,OAAO,mBAAmB,EAAE;qBAE5B,OAAO,yBAAyB,EAAE","names":[],"ignoreList":[],"sources":["CategoryUtil.js"]}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
/**
|
|
7
7
|
* @typedef {import('../../BpmnFactory').default} BpmnFactory
|
|
8
8
|
*
|
|
9
|
-
* @typedef {import('
|
|
9
|
+
* @typedef {import('../../../../model/Types').ModdleElement} ModdleElement
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -31,6 +31,29 @@ export function createCategoryValue(bpmnFactory) {
|
|
|
31
31
|
return bpmnFactory.create('bpmn:CategoryValue');
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Returns a group's category value, creating one (including a
|
|
36
|
+
* category) if needed.
|
|
37
|
+
*
|
|
38
|
+
* @param {BpmnFactory} bpmnFactory
|
|
39
|
+
* @param {ModdleElement} groupBo
|
|
40
|
+
*
|
|
41
|
+
* @return {ModdleElement}
|
|
42
|
+
*/
|
|
43
|
+
export function getOrCreateCategoryValueForGroup(bpmnFactory, groupBo) {
|
|
44
|
+
var categoryValue = groupBo.get('categoryValueRef');
|
|
45
|
+
|
|
46
|
+
if (!categoryValue) {
|
|
47
|
+
categoryValue = groupBo.categoryValueRef = createCategoryValue(bpmnFactory);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (!categoryValue.$parent) {
|
|
51
|
+
categoryValue.$parent = createCategory(bpmnFactory);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return categoryValue;
|
|
55
|
+
}
|
|
56
|
+
|
|
34
57
|
/**
|
|
35
58
|
* Adds category value to definitions
|
|
36
59
|
*
|
|
@@ -84,4 +107,4 @@ export function unlinkCategory(category) {
|
|
|
84
107
|
}
|
|
85
108
|
|
|
86
109
|
return category;
|
|
87
|
-
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Updates category value references for flow elements visually enclosed by groups.
|
|
3
|
+
*
|
|
4
|
+
* A flow element is grouped only when it shares the group's diagram root and
|
|
5
|
+
* is geometrically enclosed by the group. Consequently, visible children of an
|
|
6
|
+
* expanded subprocess are grouped, while children of a collapsed subprocess
|
|
7
|
+
* are not.
|
|
8
|
+
*
|
|
9
|
+
* Groups without a category value are auto-healed: if such a group visually
|
|
10
|
+
* encloses an affected flow element a category value is created for it on the
|
|
11
|
+
* fly, so that legacy diagrams (groups modeled without a category value) start
|
|
12
|
+
* to categorize their contents as soon as they are interacted with.
|
|
13
|
+
*
|
|
14
|
+
* @implements {CommandHandler}
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export default class UpdateCategoryValueRefsHandler implements CommandHandler {
|
|
18
|
+
static $inject: string[];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param bpmnFactory
|
|
22
|
+
* @param elementRegistry
|
|
23
|
+
*/
|
|
24
|
+
constructor(bpmnFactory: BpmnFactory, elementRegistry: ElementRegistry);
|
|
25
|
+
|
|
26
|
+
execute(context: any): any[];
|
|
27
|
+
revert(context: any): any[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
type CommandHandler = import("diagram-js/lib/command/CommandHandler").default;
|
|
31
|
+
type ElementRegistry = import("diagram-js/lib/core/ElementRegistry").default;
|
|
32
|
+
type BpmnFactory = import("../BpmnFactory").default;
|
|
33
|
+
type Element = import("../../../model/Types").Element;
|
|
34
|
+
type ModdleElement = import("../../../model/Types").ModdleElement;
|
|
35
|
+
|
|
36
|
+
export type CategoryGroupEntry = {
|
|
37
|
+
categoryValue: ModdleElement;
|
|
38
|
+
root?: Element;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=UpdateCategoryValueRefsHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateCategoryValueRefsHandler.d.ts","mappings":";;;;;;;;;;;;;;;;AAyDAA;EAKAC;;;;;;EALAC;;EAqRyC;EAqBA;;;sBA5U5B,OAAO,uCAAuC,EAAE;uBAChD,OAAO,qCAAqC,EAAE;mBAC9C,OAAO,gBAAgB,EAAE;eAEzB,OAAO,sBAAsB,EAAE;qBAC/B,OAAO,sBAAsB,EAAE;;iCAE9B;IACT,aAAa,EAAE,aAAa;IAC5B,IAAI,CAAC,EAAE,OAAO;CAChB","names":["UpdateCategoryValueRefsHandler class","UpdateCategoryValueRefsHandler#$inject","UpdateCategoryValueRefsHandler constructor"],"ignoreList":[],"sources":["UpdateCategoryValueRefsHandler.js"]}
|