@processmaker/modeler 1.40.2 → 1.40.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/modeler",
3
- "version": "1.40.2",
3
+ "version": "1.40.3",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve --mode development",
6
6
  "test:unit": "vue-cli-service test:unit",
@@ -102,6 +102,8 @@ export default {
102
102
  'highlightedNode.definition.assignedUsers'(current, previous) { this.handleAssignmentChanges(current, previous); },
103
103
  'highlightedNode.definition.assignedGroups'(current, previous) { this.handleAssignmentChanges(current, previous); },
104
104
  'highlightedNode.definition.assignmentRules'(current, previous) { this.handleAssignmentChanges(current, previous); },
105
+ 'highlightedNode.definition.allowInterstitial'(current, previous) { this.handleAssignmentChanges(current, previous); },
106
+ 'highlightedNode.definition.interstitialScreenRef'(current, previous) { this.handleAssignmentChanges(current, previous); },
105
107
  },
106
108
  computed: {
107
109
  inspectorHeaderTitle() {
@@ -254,7 +256,7 @@ export default {
254
256
  defaultInspectorHandler(value, isMultiplayer) {
255
257
  /* Go through each property and rebind it to our data */
256
258
  for (const key in omit(value, ['$type', 'eventDefinitions'])) {
257
- if (this.highlightedNode.definition.get(key) !== value[key]) {
259
+ if (this.highlightedNode.definition.get(key) !== value[key]) {
258
260
  this.multiplayerHook(key, value[key], isMultiplayer);
259
261
  this.setNodeProp(this.highlightedNode, key, value[key]);
260
262
  }
@@ -238,6 +238,7 @@ import ProcessmakerModelerGenericFlow from '@/components/nodes/genericFlow/gener
238
238
  import Selection from './Selection';
239
239
  import RemoteCursor from '@/components/multiplayer/remoteCursor/RemoteCursor.vue';
240
240
  import Multiplayer from '@/multiplayer/multiplayer';
241
+ import { getBoundaryEventData } from '../nodes/boundaryEvent/boundaryEventUtils';
241
242
 
242
243
  export default {
243
244
  components: {
@@ -354,6 +355,13 @@ export default {
354
355
  'processmaker-modeler-data-output-association',
355
356
  'processmaker-modeler-association',
356
357
  ],
358
+ boundaryEventTypes: [
359
+ 'processmaker-modeler-boundary-timer-event',
360
+ 'processmaker-modeler-boundary-error-event',
361
+ 'processmaker-modeler-boundary-signal-event',
362
+ 'processmaker-modeler-boundary-conditional-event',
363
+ 'processmaker-modeler-boundary-message-event',
364
+ ],
357
365
  };
358
366
  },
359
367
  watch: {
@@ -1184,11 +1192,7 @@ export default {
1184
1192
  'processmaker-modeler-sequence-flow',
1185
1193
  'processmaker-modeler-association',
1186
1194
  'processmaker-modeler-data-input-association',
1187
- 'processmaker-modeler-boundary-timer-event',
1188
- 'processmaker-modeler-boundary-error-event',
1189
- 'processmaker-modeler-boundary-signal-event',
1190
- 'processmaker-modeler-boundary-conditional-event',
1191
- 'processmaker-modeler-boundary-message-event',
1195
+ ...this.boundaryEventTypes,
1192
1196
  ];
1193
1197
  if (!this.isMultiplayer) {
1194
1198
  return;
@@ -1305,6 +1309,8 @@ export default {
1305
1309
  });
1306
1310
  },
1307
1311
  async addClonedNodes(nodes) {
1312
+ const flowNodes = [];
1313
+
1308
1314
  nodes.forEach(node => {
1309
1315
  if (!node.pool) {
1310
1316
  node.pool = this.poolTarget;
@@ -1314,10 +1320,24 @@ export default {
1314
1320
  addNodeToProcess(node, targetProcess);
1315
1321
 
1316
1322
  this.planeElements.push(node.diagram);
1317
- this.multiplayerHook(node, false);
1323
+
1324
+ if (this.flowTypes.includes(node.type)) {
1325
+ // Add flow to array to render after
1326
+ flowNodes.push(node);
1327
+ } else if (this.boundaryEventTypes.includes(node.type)) {
1328
+ // Get boundary event data
1329
+ const defaultData = getBoundaryEventData(node);
1330
+ window.ProcessMaker.EventBus.$emit('multiplayer-addBoundaryEvent', defaultData);
1331
+ } else {
1332
+ this.multiplayerHook(node, false);
1333
+ }
1334
+
1318
1335
  store.commit('addNode', node);
1319
1336
  this.poolTarget = null;
1320
1337
  });
1338
+
1339
+ // Render flows after all nodes have been added
1340
+ flowNodes.forEach(node => this.multiplayerHook(node, false));
1321
1341
  },
1322
1342
  async removeNode(node, options) {
1323
1343
  // Check if the node is not replaced
@@ -347,7 +347,7 @@ export default {
347
347
  */
348
348
  prepareConectedLinks(shapes){
349
349
  const { paper } = this.paperManager;
350
- this.conectedLinks = [];
350
+ this.connectedLinks = [];
351
351
  this.isValidSelectionLinks = true;
352
352
  shapes.forEach((shape) => {
353
353
  let conectedLinks = this.graph.getConnectedLinks(shape.model);
@@ -368,8 +368,8 @@ export default {
368
368
  }
369
369
  conectedLinks.forEach((link) => {
370
370
  const linkView = paper.findViewByModel(link);
371
- if (!this.conectedLinks.some(obj => obj.id === linkView.id)) {
372
- this.conectedLinks.push(linkView);
371
+ if (!this.connectedLinks.some(obj => obj.id === linkView.id)) {
372
+ this.connectedLinks.push(linkView);
373
373
  this.validateSelectionLinks(linkView);
374
374
  }
375
375
  });
@@ -585,6 +585,7 @@ export default {
585
585
  this.updateSelectionBox();
586
586
  if (this.isMultiplayer) {
587
587
  window.ProcessMaker.EventBus.$emit('multiplayer-updateNodes', this.getProperties(this.selected));
588
+ window.ProcessMaker.EventBus.$emit('multiplayer-updateNodes', this.getConnectedLinkProperties(this.connectedLinks));
588
589
  }
589
590
  },
590
591
 
@@ -600,7 +601,6 @@ export default {
600
601
  if (shape.model.get('type') === 'processmaker.modeler.bpmn.pool') {
601
602
  const childrens = shape.model.component.getElementsUnderArea(shape.model, this.graph)
602
603
  .filter((element) => element.component);
603
-
604
604
  changed = [...changed, ...this.getContainerProperties(childrens, changed)];
605
605
  } else {
606
606
  const { node } = shape.model.component;
@@ -626,6 +626,38 @@ export default {
626
626
 
627
627
  return changed;
628
628
  },
629
+ /**
630
+ * Get connected link properties
631
+ * @param {Array} links
632
+ */
633
+ getConnectedLinkProperties(links) {
634
+ let changed = [];
635
+ links.forEach((linkView) => {
636
+ const waypoint = [];
637
+ const { node } = linkView.model.component;
638
+ node.diagram.waypoint?.forEach(point => {
639
+ waypoint.push({
640
+ x: point.x,
641
+ y: point.y,
642
+ });
643
+ });
644
+ const sourceRefId = linkView.sourceView.model.component.node.definition.id;
645
+ const targetRefId = linkView.targetView.model.component.node.definition.id;
646
+ const nodeType = linkView.model.component.node.type;
647
+ changed.push(
648
+ {
649
+ id: node.definition.id,
650
+ properties: {
651
+ type: nodeType,
652
+ waypoint,
653
+ sourceRefId,
654
+ targetRefId,
655
+ },
656
+ });
657
+
658
+ });
659
+ return changed;
660
+ },
629
661
  /**
630
662
  * Get properties for each boundary inside a shape
631
663
  */
@@ -677,7 +709,7 @@ export default {
677
709
  * Selector will update the waypoints of the related flows
678
710
  */
679
711
  updateFlowsWaypoint(){
680
- this.conectedLinks.forEach((link)=> {
712
+ this.connectedLinks.forEach((link)=> {
681
713
  if (link.model.component && link.model.get('type') === 'standard.Link'){
682
714
  const start = link.sourceAnchor;
683
715
  const end = link.targetAnchor;
@@ -885,7 +917,7 @@ export default {
885
917
  if (this.newPool){
886
918
  /* Remove the shape from its current pool */
887
919
  this.moveElements(this.selected, this.oldPool, this.newPool);
888
- this.moveConectedLinks(this.conectedLinks, this.oldPool, this.newPool);
920
+ this.moveConnectedLinks(this.connectedLinks, this.oldPool, this.newPool);
889
921
  this.newPool = null;
890
922
  this.oldPool = null;
891
923
  this.updateLaneChildren(this.selected);
@@ -1025,7 +1057,7 @@ export default {
1025
1057
  oldPool.model.component.moveElement(shape.model, newPool.model);
1026
1058
  });
1027
1059
  },
1028
- moveConectedLinks(links, oldPool, newPool){
1060
+ moveConnectedLinks(links, oldPool, newPool){
1029
1061
  links.forEach(link => {
1030
1062
  oldPool.model.component.moveFlow(link.model, newPool.model);
1031
1063
  });
@@ -15,13 +15,9 @@ export const setEventTimerDefinition = (moddle, node, type, body) => {
15
15
  [type]: moddle.create('bpmn:Expression', { body }),
16
16
  };
17
17
 
18
- const eventDefinitions = [
18
+ return [
19
19
  moddle.create('bpmn:TimerEventDefinition', eventDefinition),
20
20
  ];
21
-
22
- eventDefinitions[0].id = node.definition.get('eventDefinitions')[0].id;
23
-
24
- return eventDefinitions;
25
21
  };
26
22
 
27
23
  export default merge(cloneDeep(boundaryEventConfig), {
@@ -73,9 +69,7 @@ export default merge(cloneDeep(boundaryEventConfig), {
73
69
  }
74
70
 
75
71
  const eventDefinitions = setEventTimerDefinition(moddle, node, type, body);
76
-
77
72
  setNodeProp(node, 'eventDefinitions', eventDefinitions);
78
-
79
73
  window.ProcessMaker.EventBus.$emit('multiplayer-updateInspectorProperty', {
80
74
  id: node.definition.id,
81
75
  key: 'eventTimerDefinition',
@@ -47,7 +47,6 @@ export default {
47
47
  if (node.definition && node.definition.$type !== 'bpmn:BoundaryEvent') {
48
48
  clonedNodes.push(clonedElement);
49
49
  } else {
50
- clonedElement.fromCrown = true;
51
50
  clonedBoundaryEvents.push(clonedElement);
52
51
  }
53
52
  }