@processmaker/modeler 1.39.30 → 1.39.31
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 +121 -49
- package/dist/modeler.common.js.map +1 -1
- package/dist/modeler.umd.js +121 -49
- package/dist/modeler.umd.js.map +1 -1
- package/dist/modeler.umd.min.js +4 -4
- package/dist/modeler.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/inspectors/MessageSelect.vue +1 -1
- package/src/components/modeler/Modeler.vue +4 -0
- package/src/components/nodes/errorEndEvent/index.js +3 -1
- package/src/components/nodes/messageEventDefinition/index.js +13 -1
- package/src/components/nodes/sequenceFlow/index.js +15 -0
- package/src/multiplayer/multiplayer.js +46 -14
package/package.json
CHANGED
|
@@ -1172,6 +1172,8 @@ export default {
|
|
|
1172
1172
|
config: node.definition.config,
|
|
1173
1173
|
loopCharacteristics: null,
|
|
1174
1174
|
gatewayDirection: null,
|
|
1175
|
+
messageRef: null,
|
|
1176
|
+
extras: {},
|
|
1175
1177
|
};
|
|
1176
1178
|
if (node?.pool?.component) {
|
|
1177
1179
|
defaultData['poolId'] = node.pool.component.id;
|
|
@@ -1199,6 +1201,8 @@ export default {
|
|
|
1199
1201
|
sourceRefId,
|
|
1200
1202
|
targetRefId,
|
|
1201
1203
|
waypoint: node.diagram.waypoint,
|
|
1204
|
+
name: node.definition.name,
|
|
1205
|
+
conditionExpression: null,
|
|
1202
1206
|
};
|
|
1203
1207
|
|
|
1204
1208
|
if (isProcessRequested) {
|
|
@@ -52,7 +52,7 @@ export default merge(cloneDeep(endEventConfig), {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
multiplayerInspectorHandler(node, data){
|
|
55
|
+
multiplayerInspectorHandler(node, data, setNodeProp) {
|
|
56
56
|
const keys = Object.keys(data).filter((key) => key !== 'id');
|
|
57
57
|
if (keys[0] === 'eventDefinitions') {
|
|
58
58
|
const error = data[keys[0]][0].errorRef;
|
|
@@ -62,7 +62,9 @@ export default merge(cloneDeep(endEventConfig), {
|
|
|
62
62
|
errorRef.name = error.name;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
+
return;
|
|
65
66
|
}
|
|
67
|
+
setNodeProp(node, keys[0], data[keys[0]]);
|
|
66
68
|
},
|
|
67
69
|
inspectorConfig: [
|
|
68
70
|
{
|
|
@@ -34,8 +34,9 @@ export default {
|
|
|
34
34
|
});
|
|
35
35
|
setNodeProp(node, key, value[key]);
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
let message = definitions.rootElements.find(element => element.id === value.messageRef);
|
|
39
|
+
|
|
39
40
|
if (!message && value.messageRef) {
|
|
40
41
|
message = moddle.create('bpmn:Message', {
|
|
41
42
|
id: value.messageRef,
|
|
@@ -44,5 +45,16 @@ export default {
|
|
|
44
45
|
definitions.rootElements.push(message);
|
|
45
46
|
}
|
|
46
47
|
node.definition.get('eventDefinitions')[0].messageRef = message;
|
|
48
|
+
|
|
49
|
+
window.ProcessMaker.EventBus.$emit('multiplayer-updateInspectorProperty', {
|
|
50
|
+
id: node.definition.id,
|
|
51
|
+
key: 'messageRef',
|
|
52
|
+
value: value.messageRef,
|
|
53
|
+
extras: {
|
|
54
|
+
messageName: message?.name,
|
|
55
|
+
allowedUsers: node.definition.get('allowedUsers'),
|
|
56
|
+
allowedGroups: node.definition.get('allowedGroups'),
|
|
57
|
+
},
|
|
58
|
+
});
|
|
47
59
|
},
|
|
48
60
|
};
|
|
@@ -52,6 +52,9 @@ export default {
|
|
|
52
52
|
// Set the condition expression IFF the expresion body changed
|
|
53
53
|
if (definition[key].body !== value[key]) {
|
|
54
54
|
const conditionExpression = moddle.create('bpmn:FormalExpression', { body: value[key] });
|
|
55
|
+
window.ProcessMaker.EventBus.$emit('multiplayer-updateInspectorProperty', {
|
|
56
|
+
id: node.definition.id , key, value: [conditionExpression],
|
|
57
|
+
});
|
|
55
58
|
setNodeProp(node, key, conditionExpression);
|
|
56
59
|
}
|
|
57
60
|
} else {
|
|
@@ -62,6 +65,18 @@ export default {
|
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
},
|
|
68
|
+
multiplayerInspectorHandler(node, data, setNodeProp, moddle) {
|
|
69
|
+
const keys = Object.keys(data).filter((key) => key !== 'id');
|
|
70
|
+
if (keys.length === 0) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (keys[0] === 'conditionExpression') {
|
|
74
|
+
const conditionExpression = moddle.create('bpmn:FormalExpression', { body: data[keys[0]][0].body });
|
|
75
|
+
setNodeProp(node, keys[0], conditionExpression);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
setNodeProp(node, keys[0], data[keys[0]]);
|
|
79
|
+
},
|
|
65
80
|
inspectorConfig: [
|
|
66
81
|
{
|
|
67
82
|
name: 'Sequence Flow',
|
|
@@ -56,7 +56,6 @@ export default class Multiplayer {
|
|
|
56
56
|
};
|
|
57
57
|
this.modeler.addPlayer(newPlayer);
|
|
58
58
|
});
|
|
59
|
-
this.syncLocalNodes(this.clientIO.id);
|
|
60
59
|
}
|
|
61
60
|
});
|
|
62
61
|
|
|
@@ -68,10 +67,9 @@ export default class Multiplayer {
|
|
|
68
67
|
});
|
|
69
68
|
|
|
70
69
|
this.clientIO.on('requestProcess', (payload) => {
|
|
71
|
-
const {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (firstClient.id === this.clientIO.id) {
|
|
70
|
+
const { clientId } = payload;
|
|
71
|
+
// Sync the local Nodes
|
|
72
|
+
if (clientId) {
|
|
75
73
|
this.syncLocalNodes(clientId);
|
|
76
74
|
}
|
|
77
75
|
});
|
|
@@ -171,7 +169,7 @@ export default class Multiplayer {
|
|
|
171
169
|
}
|
|
172
170
|
/**
|
|
173
171
|
* Sync the modeler nodes with the microservice
|
|
174
|
-
* @param {String} clientId
|
|
172
|
+
* @param {String} clientId
|
|
175
173
|
*/
|
|
176
174
|
syncLocalNodes(clientId){
|
|
177
175
|
// Get the process definition
|
|
@@ -481,6 +479,10 @@ export default class Multiplayer {
|
|
|
481
479
|
}
|
|
482
480
|
nodeToUpdate.set(data.key, newValue);
|
|
483
481
|
|
|
482
|
+
if (data.extras && Object.keys(data.extras).length > 0) {
|
|
483
|
+
nodeToUpdate.set('extras', data.extras);
|
|
484
|
+
}
|
|
485
|
+
|
|
484
486
|
const stateUpdate = Y.encodeStateAsUpdate(this.yDoc);
|
|
485
487
|
// Send the update to the web socket server
|
|
486
488
|
this.clientIO.emit('updateFromInspector', { updateDoc: stateUpdate, isReplaced: false });
|
|
@@ -503,6 +505,11 @@ export default class Multiplayer {
|
|
|
503
505
|
node = this.getNodeById(data.id);
|
|
504
506
|
|
|
505
507
|
if (node) {
|
|
508
|
+
let extras = {};
|
|
509
|
+
// extras property section
|
|
510
|
+
if (data.extras && Object.keys(data.extras).length > 0) {
|
|
511
|
+
extras = data.extras;
|
|
512
|
+
}
|
|
506
513
|
// loopCharacteristics property section
|
|
507
514
|
if (data.loopCharacteristics) {
|
|
508
515
|
const loopCharacteristics = JSON.parse(data.loopCharacteristics);
|
|
@@ -515,22 +522,47 @@ export default class Multiplayer {
|
|
|
515
522
|
}, node, this.setNodeProp, this.modeler.moddle, this.modeler.definitions, false);
|
|
516
523
|
return;
|
|
517
524
|
}
|
|
518
|
-
if (this.modeler.nodeRegistry[node.type]
|
|
519
|
-
this.modeler.nodeRegistry[node.type].multiplayerInspectorHandler(node, data);
|
|
525
|
+
if (this.modeler.nodeRegistry[node.type]?.multiplayerInspectorHandler) {
|
|
526
|
+
this.modeler.nodeRegistry[node.type].multiplayerInspectorHandler(node, data,this.setNodeProp, this.modeler.moddle);
|
|
520
527
|
return;
|
|
521
528
|
}
|
|
522
529
|
const keys = Object.keys(data).filter((key) => key !== 'id');
|
|
530
|
+
const key = keys[0];
|
|
531
|
+
const value = data[key];
|
|
523
532
|
|
|
524
|
-
if (
|
|
525
|
-
node.definition.get('eventDefinitions')[0].get('condition').body =
|
|
533
|
+
if (key === 'condition') {
|
|
534
|
+
node.definition.get('eventDefinitions')[0].get('condition').body = value;
|
|
526
535
|
}
|
|
527
536
|
|
|
528
|
-
if (
|
|
529
|
-
node.definition.set('gatewayDirection',
|
|
537
|
+
if (key === 'gatewayDirection') {
|
|
538
|
+
node.definition.set('gatewayDirection', value);
|
|
530
539
|
}
|
|
531
540
|
|
|
532
|
-
|
|
533
|
-
|
|
541
|
+
if (key === 'messageRef') {
|
|
542
|
+
let message = this.modeler.definitions.rootElements.find(element => element.id === value);
|
|
543
|
+
|
|
544
|
+
if (!message) {
|
|
545
|
+
message = this.modeler.moddle.create('bpmn:Message', {
|
|
546
|
+
id: value,
|
|
547
|
+
name: extras?.messageName || value,
|
|
548
|
+
});
|
|
549
|
+
this.modeler.definitions.rootElements.push(message);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
node.definition.get('eventDefinitions')[0].messageRef = message;
|
|
534
553
|
|
|
554
|
+
if (extras?.allowedUsers) {
|
|
555
|
+
node.definition.set('allowedUsers', extras.allowedUsers);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
if (extras?.allowedGroups) {
|
|
559
|
+
node.definition.set('allowedGroups', extras.allowedGroups);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
if (!['messageRef', 'gatewayDirection', 'condition', 'allowedUsers', 'allowedGroups'].includes(key)) {
|
|
564
|
+
store.commit('updateNodeProp', { node, key, value });
|
|
565
|
+
}
|
|
566
|
+
}
|
|
535
567
|
}
|
|
536
568
|
}
|