Skip to content

Commit

Permalink
fix lanes children movements
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo Quelca committed Oct 17, 2023
1 parent bd86d8a commit 354bb97
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
19 changes: 10 additions & 9 deletions src/components/crown/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,16 @@ export function removeNodeAssociations(node, modeler) {

export function removeBoundaryEvents(graph, node, removeNode) {
const nodeShape = graph.getCells().find(el => el.component && el.component.node === node);

nodeShape.getEmbeddedCells({ deep: true })
.filter(cell => {
return cell.component && cell.component.node.isBpmnType('bpmn:BoundaryEvent');
})
.forEach(boundaryEventShape => {
graph.getConnectedLinks(boundaryEventShape).forEach(shape => removeNode(shape.component.node));
removeNode(boundaryEventShape.component.node);
});
if (nodeShape) {
nodeShape.getEmbeddedCells({ deep: true })
.filter(cell => {
return cell.component && cell.component.node.isBpmnType('bpmn:BoundaryEvent');
})
.forEach(boundaryEventShape => {
graph.getConnectedLinks(boundaryEventShape).forEach(shape => removeNode(shape.component.node));
removeNode(boundaryEventShape.component.node);
});
}
}

export function removeOutgoingAndIncomingRefsToFlow(node){
Expand Down
7 changes: 4 additions & 3 deletions src/components/nodes/pool/pool.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,13 @@ export default {
/* Remove references to the element from the current process */
pull(this.containingProcess.get('flowElements'), elementDefinition);
toPool.component.containingProcess.get('flowElements').push(elementDefinition);
this.moveEmbeddedElements(element, toPool);
element.component.node.pool = toPool;
this.shape.unembed(element);
toPool.component.shape.embed(element);
if (element.component.node.type !== laneId && toPool.component.laneSet) {
toPool.component.updateLaneChildren();
}
},
moveElement(element, toPool) {
Expand Down
12 changes: 7 additions & 5 deletions src/multiplayer/multiplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,6 @@ export default class Multiplayer {
const { paper } = this.modeler;
const element = this.modeler.getElementByNodeId(data.id);
const newPool = this.modeler.getElementByNodeId(data.poolId);
// validate if the parent pool was updated
if (newPool && element.component.node.pool && element.component.node.pool.component.id !== data.poolId) {
element.component.node.pool.component.moveElementRemote(element, newPool);
}
// Update the element's position attribute
element.resize(
/* Add labelWidth to ensure elements don't overlap with the pool label */
Expand All @@ -260,7 +256,13 @@ export default class Multiplayer {
);
element.set('position', { x: data.x, y: data.y });
// Trigger a rendering of the element on the paper
paper.findViewByModel(element).update();
await paper.findViewByModel(element).update();
// validate if the parent pool was updated
await element.component.$nextTick();
await this.modeler.paperManager.awaitScheduledUpdates();
if (newPool && element.component.node.pool && element.component.node.pool.component.id !== data.poolId) {
element.component.node.pool.component.moveElementRemote(element, newPool);
}
}

addFlow(data) {
Expand Down

0 comments on commit 354bb97

Please sign in to comment.