@processmaker/modeler 1.41.0 → 1.42.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/modeler.common.js +35 -20
- package/dist/modeler.common.js.map +1 -1
- package/dist/modeler.umd.js +37 -22
- package/dist/modeler.umd.js.map +1 -1
- package/dist/modeler.umd.min.js +1 -1
- package/dist/modeler.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/modeler/Modeler.vue +2 -0
- package/src/components/nodes/poolLane/index.js +9 -0
- package/src/multiplayer/multiplayer.js +13 -3
package/package.json
CHANGED
|
@@ -1128,6 +1128,8 @@ export default {
|
|
|
1128
1128
|
const diagram = this.nodeRegistry[data.type].diagram(this.moddle);
|
|
1129
1129
|
diagram.bounds.x = data.x;
|
|
1130
1130
|
diagram.bounds.y = data.y;
|
|
1131
|
+
diagram.bounds.width = data.width;
|
|
1132
|
+
diagram.bounds.height = data.height;
|
|
1131
1133
|
const newNode = this.createNode(data.type, definition, diagram);
|
|
1132
1134
|
//verify if the node has a pool as a container
|
|
1133
1135
|
if (data.poolId) {
|
|
@@ -58,6 +58,11 @@ export default {
|
|
|
58
58
|
const definition = modeler.moddle.create('bpmn:Lane', {
|
|
59
59
|
name: data.name,
|
|
60
60
|
});
|
|
61
|
+
// Set the position of the pool
|
|
62
|
+
if (data.poolX && data.poolY) {
|
|
63
|
+
pool.set('position', { x: data.poolX, y: data.poolY });
|
|
64
|
+
}
|
|
65
|
+
|
|
61
66
|
if (!pool.component.laneSet && pool.component.createLaneSet) {
|
|
62
67
|
pool.component.createLaneSet([data.laneSetId]);
|
|
63
68
|
/* If there are currently elements in the pool, add them to the first lane */
|
|
@@ -81,6 +86,10 @@ export default {
|
|
|
81
86
|
definition,
|
|
82
87
|
diagram,
|
|
83
88
|
);
|
|
89
|
+
|
|
90
|
+
// Set the pool as the parent of the lane
|
|
91
|
+
node.pool = pool;
|
|
92
|
+
|
|
84
93
|
await modeler.addNode(node, data.id, true);
|
|
85
94
|
modeler.setShapeStacking(pool.component.shape);
|
|
86
95
|
|
|
@@ -203,13 +203,17 @@ export default class Multiplayer {
|
|
|
203
203
|
* Sync the modeler nodes with the microservice
|
|
204
204
|
* @param {String} clientId
|
|
205
205
|
*/
|
|
206
|
-
syncLocalNodes(clientId){
|
|
206
|
+
syncLocalNodes(clientId) {
|
|
207
207
|
// Get the process definition
|
|
208
208
|
const nodes = this.modeler.nodes.map((node) => {
|
|
209
209
|
if (node.definition.$type === 'bpmn:BoundaryEvent') {
|
|
210
210
|
return getBoundaryEventData(node);
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
+
if (node.definition.$type === 'bpmn:Lane') {
|
|
214
|
+
return this.prepareLaneData(node);
|
|
215
|
+
}
|
|
216
|
+
|
|
213
217
|
return this.modeler.multiplayerHook(node, false, true);
|
|
214
218
|
});
|
|
215
219
|
|
|
@@ -484,7 +488,8 @@ export default class Multiplayer {
|
|
|
484
488
|
}
|
|
485
489
|
addLaneNodes(lanes) {
|
|
486
490
|
const pool = this.getPool(lanes);
|
|
487
|
-
|
|
491
|
+
|
|
492
|
+
const defaultPoolData = {
|
|
488
493
|
id: pool.component.node.definition.id,
|
|
489
494
|
properties: {
|
|
490
495
|
x: pool.component.node.diagram.bounds.x,
|
|
@@ -493,7 +498,10 @@ export default class Multiplayer {
|
|
|
493
498
|
width: pool.component.node.diagram.bounds.width,
|
|
494
499
|
isAddingLaneAbove: pool.isAddingLaneAbove,
|
|
495
500
|
},
|
|
496
|
-
}
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
window.ProcessMaker.EventBus.$emit('multiplayer-updateNodes', [defaultPoolData]);
|
|
504
|
+
|
|
497
505
|
this.yDoc.transact(() => {
|
|
498
506
|
lanes.forEach((lane) => {
|
|
499
507
|
const yMapNested = new Y.Map();
|
|
@@ -516,6 +524,8 @@ export default class Multiplayer {
|
|
|
516
524
|
height: lane.diagram.bounds.height,
|
|
517
525
|
poolId: lane.pool.component.node.definition.id,
|
|
518
526
|
laneSetId: lane.pool.component.laneSet.id,
|
|
527
|
+
poolX: lane.pool.component.node.diagram.bounds.x,
|
|
528
|
+
poolY: lane.pool.component.node.diagram.bounds.y,
|
|
519
529
|
};
|
|
520
530
|
return data;
|
|
521
531
|
}
|