bpmn-js 9.0.0-subprocesses.0 → 9.0.0-subprocesses.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/CHANGELOG.md +17 -1
- package/dist/assets/bpmn-js.css +58 -0
- package/dist/assets/diagram-js.css +1 -0
- package/dist/bpmn-modeler.development.js +1756 -1632
- package/dist/bpmn-modeler.production.min.js +8 -7
- package/dist/bpmn-navigated-viewer.development.js +20855 -20345
- package/dist/bpmn-navigated-viewer.production.min.js +22 -20
- package/dist/bpmn-viewer.development.js +20049 -19562
- package/dist/bpmn-viewer.production.min.js +22 -20
- package/lib/Modeler.js +1 -4
- package/lib/Viewer.js +2 -2
- package/lib/draw/BpmnRenderer.js +367 -296
- package/lib/draw/PathMap.js +2 -2
- package/lib/features/auto-resize/BpmnAutoResizeProvider.js +3 -6
- package/lib/features/copy-paste/ModdleCopy.js +19 -2
- package/lib/features/modeling/BpmnFactory.js +8 -8
- package/lib/features/modeling/BpmnUpdater.js +0 -5
- package/lib/features/modeling/ElementFactory.js +27 -13
- package/lib/features/modeling/behavior/ResizeBehavior.js +129 -3
- package/lib/features/modeling/behavior/util/ResizeUtil.js +1 -132
- package/lib/features/replace/BpmnReplace.js +38 -16
- package/lib/features/subprocess-navigation/SubprocessCentering.js +55 -0
- package/lib/features/subprocess-navigation/SubprocessCompatibility.js +135 -0
- package/lib/features/subprocess-navigation/SubprocessElements.js +55 -0
- package/lib/features/subprocess-navigation/SubprocessFlows.js +109 -0
- package/lib/features/subprocess-navigation/SubprocessOverlays.js +104 -0
- package/lib/features/subprocess-navigation/index.js +18 -0
- package/lib/import/BpmnImporter.js +59 -10
- package/lib/import/BpmnTreeWalker.js +2 -2
- package/lib/import/Importer.js +4 -4
- package/lib/util/DiUtil.js +1 -0
- package/package.json +2 -2
- package/test/helper/index.js +6 -1
- package/test/util/MockEvents.js +10 -2
- package/lib/features/collapsed-subprocesses/DeleteBehaviour.js +0 -65
- package/lib/features/collapsed-subprocesses/ToggleCollapseBehaviour.js +0 -133
- package/lib/features/collapsed-subprocesses/diagramFactory.js +0 -56
- package/lib/features/collapsed-subprocesses/index.js +0 -12
- package/lib/features/collapsed-subprocesses-navigation/CollapsedSubprocessNavigation.js +0 -198
- package/lib/features/collapsed-subprocesses-navigation/index.js +0 -7
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import inherits from 'inherits';
|
|
2
|
-
|
|
3
|
-
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
4
|
-
|
|
5
|
-
import { is } from '../../util/ModelUtil';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export default function RemoveDiagramBehavior(canvas, bpmnjs, injector, elementRegistry, commandStack) {
|
|
9
|
-
|
|
10
|
-
var removeNestedProcesses = function(process) {
|
|
11
|
-
var removedProcesses = [];
|
|
12
|
-
|
|
13
|
-
process.flowElements && process.flowElements.forEach(element => {
|
|
14
|
-
if (is(element, 'bpmn:SubProcess')) {
|
|
15
|
-
removedProcesses = removedProcesses.concat(removeNestedProcesses(element));
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
var removedDi = removeProcess(process.id);
|
|
20
|
-
|
|
21
|
-
if (removedDi) {
|
|
22
|
-
removedProcesses.push(removedDi);
|
|
23
|
-
}
|
|
24
|
-
return removedProcesses;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
injector.invoke(CommandInterceptor, this);
|
|
28
|
-
|
|
29
|
-
this.executed('shape.delete', function(event) {
|
|
30
|
-
var context = event.context;
|
|
31
|
-
|
|
32
|
-
if (is(context.shape, 'bpmn:SubProcess')) {
|
|
33
|
-
var removedDi = removeNestedProcesses(context.shape.businessObject);
|
|
34
|
-
context.removedDiDiagrams = removedDi;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
this.reverted('shape.delete', function(event) {
|
|
39
|
-
var context = event.context;
|
|
40
|
-
|
|
41
|
-
if (is(context.shape, 'bpmn:SubProcess') && context.removedDiDiagrams) {
|
|
42
|
-
var diagrams = bpmnjs.getDefinitions().diagrams;
|
|
43
|
-
Array.prototype.push.apply(diagrams, context.removedDiDiagrams);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
// Util
|
|
48
|
-
var removeProcess = function(id) {
|
|
49
|
-
var diagrams = bpmnjs.getDefinitions().diagrams,
|
|
50
|
-
removedDiagram;
|
|
51
|
-
var diagramIndex = diagrams.findIndex(element => {
|
|
52
|
-
return element.plane.bpmnElement.id === id;
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
if (diagramIndex > -1) {
|
|
56
|
-
removedDiagram = diagrams[diagramIndex];
|
|
57
|
-
diagrams.splice(diagramIndex, 1);
|
|
58
|
-
}
|
|
59
|
-
return removedDiagram;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
inherits(RemoveDiagramBehavior, CommandInterceptor);
|
|
64
|
-
|
|
65
|
-
RemoveDiagramBehavior.$inject = [ 'canvas', 'bpmnjs', 'injector', 'elementRegistry', 'commandStack' ];
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import inherits from 'inherits';
|
|
2
|
-
|
|
3
|
-
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
find
|
|
7
|
-
} from 'min-dash';
|
|
8
|
-
|
|
9
|
-
import { getBusinessObject, getDi, is } from '../../util/ModelUtil';
|
|
10
|
-
import { selfAndAllChildren } from '../../../../diagram-js/lib/util/Elements';
|
|
11
|
-
|
|
12
|
-
var HIGH_PRIORITY = 5000;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export default function ExpandBehaviour(commandStack, injector, canvas, bpmnImporter, bpmnUpdater, bpmnjs, elementRegistry, eventBus, modeling, bpmnFactory) {
|
|
16
|
-
|
|
17
|
-
injector.invoke(CommandInterceptor, this);
|
|
18
|
-
|
|
19
|
-
var handler = function(event) {
|
|
20
|
-
const shape = event.context.shape;
|
|
21
|
-
const diagrams = bpmnjs.getDefinitions().diagrams;
|
|
22
|
-
|
|
23
|
-
if (!is(shape, 'bpmn:SubProcess')) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (!shape.collapsed) {
|
|
28
|
-
|
|
29
|
-
// expand
|
|
30
|
-
var oldDiagram = findDiagram(shape.id);
|
|
31
|
-
var newDiagram = findRootDiagram(getDi(shape));
|
|
32
|
-
|
|
33
|
-
// Add elements to parent diagram
|
|
34
|
-
oldDiagram.plane.planeElement.forEach(di => {
|
|
35
|
-
var childElement = elementRegistry.get(di.bpmnElement.id);
|
|
36
|
-
var bo = childElement.businessObject;
|
|
37
|
-
var parent = elementRegistry.get(bo.$parent.id);
|
|
38
|
-
|
|
39
|
-
if (parent === shape) {
|
|
40
|
-
childElement.parent = shape;
|
|
41
|
-
eventBus.fire('elements.changed', { elements: [childElement] });
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// reorder di
|
|
45
|
-
newDiagram.plane.planeElement.push(di);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
diagrams.splice(diagrams.indexOf(oldDiagram), 1);
|
|
49
|
-
|
|
50
|
-
// debugger;
|
|
51
|
-
canvas.setRootElementForPlane(null, shape.id, true);
|
|
52
|
-
elementRegistry.remove(shape.id + '_layer');
|
|
53
|
-
} else {
|
|
54
|
-
|
|
55
|
-
// Collapse
|
|
56
|
-
var bo = getBusinessObject(shape);
|
|
57
|
-
newDiagram = createDiagram(shape);
|
|
58
|
-
diagrams.push(newDiagram);
|
|
59
|
-
console.log(shape, bo, newDiagram.plane);
|
|
60
|
-
var newShape = bpmnImporter.add({ element: bo, di: newDiagram.plane });
|
|
61
|
-
var planeElements = newDiagram.plane.get('planeElement');
|
|
62
|
-
|
|
63
|
-
oldDiagram = findRootDiagram(getDi(shape));
|
|
64
|
-
|
|
65
|
-
selfAndAllChildren(shape).forEach(function(childShape) {
|
|
66
|
-
if (childShape === shape) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (childShape.parent === shape) {
|
|
71
|
-
childShape.parent = newShape;
|
|
72
|
-
}
|
|
73
|
-
childShape.hidden = false;
|
|
74
|
-
|
|
75
|
-
var di = getDi(childShape);
|
|
76
|
-
|
|
77
|
-
// Remove DI from old Plane and add it to the new one
|
|
78
|
-
var parentPlaneElements = oldDiagram.plane.get('planeElement');
|
|
79
|
-
parentPlaneElements.splice(parentPlaneElements.indexOf(di), 1);
|
|
80
|
-
planeElements.push(di);
|
|
81
|
-
|
|
82
|
-
eventBus.fire('elements.changed', { elements: [childShape] });
|
|
83
|
-
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
bo.flowElements.forEach(el => {
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
this.executed([ 'shape.toggleCollapse' ], HIGH_PRIORITY, handler);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.reverted([ 'shape.toggleCollapse' ], HIGH_PRIORITY, handler);
|
|
95
|
-
|
|
96
|
-
// Util
|
|
97
|
-
|
|
98
|
-
var findRootDiagram = function(element) {
|
|
99
|
-
if (is(element, 'bpmndi:BPMNDiagram')) {
|
|
100
|
-
return element;
|
|
101
|
-
} else {
|
|
102
|
-
return findRootDiagram(element.$parent);
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
var findDiagram = function(id) {
|
|
107
|
-
return find(bpmnjs.getDefinitions().diagrams, function(diagram) {
|
|
108
|
-
const plane = diagram.plane,
|
|
109
|
-
bpmnElement = plane.bpmnElement;
|
|
110
|
-
|
|
111
|
-
console.log(diagram, bpmnElement, id);
|
|
112
|
-
return bpmnElement.id === id;
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
var createDiagram = function(shape) {
|
|
117
|
-
var bo = getBusinessObject(shape);
|
|
118
|
-
var plane = bpmnFactory.createDiPlane(bo);
|
|
119
|
-
var diagram = bpmnFactory.create('bpmndi:BPMNDiagram', {
|
|
120
|
-
plane: plane
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
// shape.di = plane;
|
|
124
|
-
plane.$parent = diagram;
|
|
125
|
-
plane.bpmnElement = bo;
|
|
126
|
-
diagram.$parent = bpmnjs.getDefinitions();
|
|
127
|
-
return diagram;
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
inherits(ExpandBehaviour, CommandInterceptor);
|
|
132
|
-
|
|
133
|
-
ExpandBehaviour.$inject = [ 'commandStack', 'injector', 'canvas', 'bpmnImporter', 'bpmnUpdater', 'bpmnjs', 'elementRegistry', 'eventBus', 'modeling', 'bpmnFactory' ];
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
find
|
|
3
|
-
} from 'min-dash';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export default function DiagramRegistry(bpmnjs, bpmnFactory) {
|
|
7
|
-
this._bpmnjs = bpmnjs;
|
|
8
|
-
this._bpmnFactory = bpmnFactory;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
DiagramRegistry.prototype.getDefinitions = function() {
|
|
12
|
-
return this._bpmnjs._definitions || [];
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
DiagramRegistry.prototype.getDiagrams = function() {
|
|
16
|
-
return this.getDefinitions().diagrams || [];
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
DiagramRegistry.prototype.findDiagram = function(id) {
|
|
20
|
-
return find(this._bpmnjs.getDefinitions().diagrams, function(diagram) {
|
|
21
|
-
const plane = diagram.plane,
|
|
22
|
-
bpmnElement = plane.bpmnElement;
|
|
23
|
-
|
|
24
|
-
return bpmnElement.id === id;
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
DiagramRegistry.prototype.createProcess = function() {
|
|
29
|
-
var process = this._bpmnFactory.create('bpmn:Process', {});
|
|
30
|
-
process.$parent = this.getDefinitions();
|
|
31
|
-
return process;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
DiagramRegistry.prototype.createDiagram = function(rootElement) {
|
|
35
|
-
var plane = this._bpmnFactory.createDiPlane(rootElement);
|
|
36
|
-
var diagram = this._bpmnFactory.create('bpmndi:BPMNDiagram', {
|
|
37
|
-
plane: plane
|
|
38
|
-
});
|
|
39
|
-
rootElement.di = plane;
|
|
40
|
-
plane.$parent = diagram;
|
|
41
|
-
plane.bpmnElement = rootElement;
|
|
42
|
-
diagram.$parent = this.getDefinitions();
|
|
43
|
-
return diagram;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
DiagramRegistry.prototype.removeProcess = function(id) {
|
|
47
|
-
let diagramIndex = this.getDiagrams().findIndex(element => {
|
|
48
|
-
return element.plane.bpmnElement.id === id;
|
|
49
|
-
});
|
|
50
|
-
if (diagramIndex > -1) {
|
|
51
|
-
this.getDiagrams().splice(diagramIndex, 1);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
DiagramRegistry.$inject = ['bpmnjs', 'bpmnFactory'];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import ExpandBehaviour from './ToggleCollapseBehaviour';
|
|
2
|
-
import RemoveDiagramBehavior from './DeleteBehaviour';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
__depends__: [ ],
|
|
6
|
-
__init__: [
|
|
7
|
-
'removeDiagramBehavior',
|
|
8
|
-
'expandBehaviour'
|
|
9
|
-
],
|
|
10
|
-
removeDiagramBehavior: ['type', RemoveDiagramBehavior],
|
|
11
|
-
expandBehaviour: ['type', ExpandBehaviour]
|
|
12
|
-
};
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import inherits from 'inherits';
|
|
2
|
-
|
|
3
|
-
import { assign } from 'min-dash';
|
|
4
|
-
import { domify } from 'min-dom';
|
|
5
|
-
import { getBusinessObject, is } from '../../util/ModelUtil';
|
|
6
|
-
|
|
7
|
-
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
8
|
-
import { selfAndAllChildren } from 'diagram-js/lib/util/Elements';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var ARROW_DOWN_SVG = '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>';
|
|
12
|
-
|
|
13
|
-
export default function CollapsedProcesses(injector, eventBus, elementRegistry, overlays, canvas) {
|
|
14
|
-
var breadcrumbs = domify('<ul class="breadcrumbs" style="display: none; position: absolute; top: 10px; left: 100px;"></ul>');
|
|
15
|
-
|
|
16
|
-
injector.invoke(CommandInterceptor, this);
|
|
17
|
-
|
|
18
|
-
assign(breadcrumbs.style, {
|
|
19
|
-
fontFamily: 'Arial, sans-serif'
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
var container = canvas.getContainer();
|
|
23
|
-
|
|
24
|
-
container.appendChild(breadcrumbs);
|
|
25
|
-
|
|
26
|
-
eventBus.on('plane.set', function(event) {
|
|
27
|
-
var plane = event.plane;
|
|
28
|
-
|
|
29
|
-
updateBreadcrumbs(plane);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const updateBreadcrumbs = function(plane) {
|
|
33
|
-
var parents = getParentChain(plane.rootElement);
|
|
34
|
-
|
|
35
|
-
var path = parents.flatMap(function(el, idx, array) {
|
|
36
|
-
|
|
37
|
-
var separator = domify('<span>»</span>');
|
|
38
|
-
|
|
39
|
-
assign(separator.style, {
|
|
40
|
-
padding: '8px'
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
var html = domify(`<li><a>${el.name || el.id}</a></li>`);
|
|
44
|
-
|
|
45
|
-
assign(html.style, {
|
|
46
|
-
display: 'inline',
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
html.addEventListener('click', () => {
|
|
50
|
-
if (elementRegistry.get(el.id + '_layer')) {
|
|
51
|
-
canvas.setActivePlane(el.id);
|
|
52
|
-
} else {
|
|
53
|
-
var plane = canvas.findPlane(el.id);
|
|
54
|
-
canvas.setActivePlane(plane);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
if (idx + 1 < array.length) {
|
|
59
|
-
assign(html.style, {
|
|
60
|
-
color: '#4d90ff',
|
|
61
|
-
cursor: 'pointer'
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (idx !== 0) {
|
|
66
|
-
return [separator, html];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return [html];
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
breadcrumbs.innerHTML = '';
|
|
73
|
-
breadcrumbs.style.display = path.length > 1 ? '' : 'none';
|
|
74
|
-
breadcrumbs.append(...path);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
var overlayMap = {};
|
|
78
|
-
|
|
79
|
-
var createOverlay = function(element) {
|
|
80
|
-
if (overlayMap[element.id]) {
|
|
81
|
-
|
|
82
|
-
// New overlay, remove old one
|
|
83
|
-
removeOverlay(element);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
let html = domify(`<button>${ARROW_DOWN_SVG}</button>`);
|
|
87
|
-
|
|
88
|
-
assign(html.style, {
|
|
89
|
-
padding: '0px',
|
|
90
|
-
marginLeft: '-20px',
|
|
91
|
-
fontSize: '0',
|
|
92
|
-
border: 'none',
|
|
93
|
-
borderRadius: '2px',
|
|
94
|
-
fill: 'white',
|
|
95
|
-
outline: 'none',
|
|
96
|
-
cursor: 'pointer',
|
|
97
|
-
backgroundColor: '#4d90ff',
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
html.addEventListener('click', () => {
|
|
101
|
-
canvas.setActivePlane(element.id);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
overlayMap[element.id] = overlays.add(element, {
|
|
106
|
-
position: {
|
|
107
|
-
bottom: -7,
|
|
108
|
-
right: -8
|
|
109
|
-
},
|
|
110
|
-
html
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
var removeOverlay = function(element) {
|
|
115
|
-
if (overlayMap[element.id]) {
|
|
116
|
-
overlays.remove(overlayMap[element.id]);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
var removeOverlays = function(elements) {
|
|
121
|
-
elements.forEach(removeOverlay);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
var addOverlays = (elements) => {
|
|
125
|
-
elements.forEach(element => {
|
|
126
|
-
if (element.type === 'bpmn:SubProcess' && element.collapsed) {
|
|
127
|
-
createOverlay(element);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
eventBus.on('import.done', function() {
|
|
133
|
-
addOverlays(elementRegistry.getAll());
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
this.executed([ 'shape.toggleCollapse' ], function(event) {
|
|
137
|
-
var shape = event.context.shape;
|
|
138
|
-
|
|
139
|
-
if (!is(shape, 'bpmn:SubProcess')) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (shape.collapsed) {
|
|
144
|
-
|
|
145
|
-
// Collapse
|
|
146
|
-
removeOverlays(selfAndAllChildren(shape));
|
|
147
|
-
createOverlay(shape);
|
|
148
|
-
|
|
149
|
-
var plane = elementRegistry.get(shape.id + '_layer');
|
|
150
|
-
addOverlays(selfAndAllChildren(plane));
|
|
151
|
-
} else {
|
|
152
|
-
|
|
153
|
-
// Expand
|
|
154
|
-
addOverlays(selfAndAllChildren(shape));
|
|
155
|
-
removeOverlay(shape);
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
this.reverted([ 'shape.toggleCollapse' ], function(event) {
|
|
160
|
-
var shape = event.context.shape;
|
|
161
|
-
|
|
162
|
-
if (!is(shape, 'bpmn:SubProcess')) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (shape.collapsed) {
|
|
167
|
-
removeOverlays(selfAndAllChildren(shape));
|
|
168
|
-
createOverlay(shape);
|
|
169
|
-
|
|
170
|
-
var plane = elementRegistry.get(shape.id + '_layer');
|
|
171
|
-
addOverlays(selfAndAllChildren(plane));
|
|
172
|
-
} else {
|
|
173
|
-
addOverlays(selfAndAllChildren(shape));
|
|
174
|
-
removeOverlay(shape);
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
inherits(CollapsedProcesses, CommandInterceptor);
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
CollapsedProcesses.$inject = [ 'injector', 'eventBus', 'elementRegistry', 'overlays', 'canvas' ];
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
var getParentChain = function(child) {
|
|
187
|
-
var bo = getBusinessObject(child);
|
|
188
|
-
|
|
189
|
-
var parents = [];
|
|
190
|
-
|
|
191
|
-
for (var element = bo; element; element = element.$parent) {
|
|
192
|
-
if (is(element, 'bpmn:SubProcess') || is(element, 'bpmn:Process')) {
|
|
193
|
-
parents.push(element);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
return parents.reverse();
|
|
198
|
-
};
|