Skip to content

Commit de8e5d6

Browse files
committed
fix: move elements into subprocess after all elements are created
1 parent 569ce9f commit de8e5d6

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

lib/features/modeling/behavior/SubProcessPlaneBehavior.js

+21-8
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,30 @@ export default function SubProcessPlaneBehavior(
107107
}, true);
108108

109109

110-
this.postExecuted('shape.create', function(context) {
111-
var shape = context.shape,
112-
rootElement = context.newRootElement;
110+
this.postExecuted('elements.create', function(context) {
113111

114-
if (!rootElement || !shape.children) {
115-
return;
116-
}
112+
var elements = context.elements;
113+
114+
elements.forEach(function(element) {
115+
116+
var rootElement = elementRegistry.get(getPlaneIdFromShape(element));
117117

118-
self._showRecursively(shape.children);
118+
if (!rootElement || !element.children) {
119+
return;
120+
}
119121

120-
self._moveChildrenToShape(shape, rootElement);
122+
if (element.type !== 'bpmn:SubProcess') {
123+
return;
124+
}
125+
126+
console.log('elements.create post ecexuted', element.type);
127+
128+
129+
self._showRecursively(element.children);
130+
131+
self._moveChildrenToShape(element, rootElement);
132+
133+
});
121134
}, true);
122135

123136

0 commit comments

Comments
 (0)