@processmaker/modeler 1.39.20 → 1.39.21
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 +501 -406
- package/dist/modeler.common.js.map +1 -1
- package/dist/modeler.umd.js +501 -406
- 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 +52 -24
- package/src/multiplayer/multiplayer.js +33 -3
package/dist/modeler.common.js
CHANGED
|
@@ -47688,10 +47688,10 @@ var ValidationStatus_component = normalizeComponent(
|
|
|
47688
47688
|
)
|
|
47689
47689
|
|
|
47690
47690
|
/* harmony default export */ var ValidationStatus = (ValidationStatus_component.exports);
|
|
47691
|
-
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/modeler/Modeler.vue?vue&type=template&id=
|
|
47691
|
+
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/modeler/Modeler.vue?vue&type=template&id=5fd6d55f&
|
|
47692
47692
|
|
|
47693
47693
|
|
|
47694
|
-
var
|
|
47694
|
+
var Modelervue_type_template_id_5fd6d55f_render = function render() {
|
|
47695
47695
|
var _vm = this,
|
|
47696
47696
|
_c = _vm._self._c;
|
|
47697
47697
|
return _c('span', {
|
|
@@ -47910,9 +47910,9 @@ var Modelervue_type_template_id_83a477c8_render = function render() {
|
|
|
47910
47910
|
}
|
|
47911
47911
|
}) : _vm._e()], 2)], 1);
|
|
47912
47912
|
};
|
|
47913
|
-
var
|
|
47913
|
+
var Modelervue_type_template_id_5fd6d55f_staticRenderFns = [];
|
|
47914
47914
|
|
|
47915
|
-
;// CONCATENATED MODULE: ./src/components/modeler/Modeler.vue?vue&type=template&id=
|
|
47915
|
+
;// CONCATENATED MODULE: ./src/components/modeler/Modeler.vue?vue&type=template&id=5fd6d55f&
|
|
47916
47916
|
|
|
47917
47917
|
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/nodes/boundaryEvent/boundaryEvent.vue?vue&type=template&id=2979ecac&
|
|
47918
47918
|
var boundaryEventvue_type_template_id_2979ecac_render = function render() {
|
|
@@ -75581,6 +75581,30 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75581
75581
|
_this.modeler.removePlayer(payload.clientId);
|
|
75582
75582
|
_this.modeler.enableMultiplayer(payload.isMultiplayer);
|
|
75583
75583
|
});
|
|
75584
|
+
this.clientIO.on('requestProcess', function (payload) {
|
|
75585
|
+
var firstClient = payload.firstClient,
|
|
75586
|
+
clientId = payload.clientId;
|
|
75587
|
+
|
|
75588
|
+
// Check if the current client is the first client
|
|
75589
|
+
if (firstClient.id === _this.clientIO.id) {
|
|
75590
|
+
// Get the process definition
|
|
75591
|
+
var nodes = _this.modeler.nodes.map(function (node) {
|
|
75592
|
+
return _this.modeler.multiplayerHook(node, false, true);
|
|
75593
|
+
});
|
|
75594
|
+
nodes.forEach(function (node) {
|
|
75595
|
+
var yMapNested = new YMap();
|
|
75596
|
+
_this.doTransact(yMapNested, node);
|
|
75597
|
+
_this.yArray.push([yMapNested]);
|
|
75598
|
+
// Encode the state as an update and send it to the server
|
|
75599
|
+
var stateUpdate = encodeStateAsUpdate(_this.yDoc);
|
|
75600
|
+
// Send the update to the web socket server
|
|
75601
|
+
_this.clientIO.emit('createElement', {
|
|
75602
|
+
updateDoc: stateUpdate,
|
|
75603
|
+
clientId: clientId
|
|
75604
|
+
});
|
|
75605
|
+
});
|
|
75606
|
+
}
|
|
75607
|
+
});
|
|
75584
75608
|
|
|
75585
75609
|
// Listen for updates when a new element is added
|
|
75586
75610
|
this.clientIO.on('createElement', /*#__PURE__*/function () {
|
|
@@ -75604,6 +75628,32 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75604
75628
|
};
|
|
75605
75629
|
}());
|
|
75606
75630
|
|
|
75631
|
+
// Listen for updates when a new element is requested
|
|
75632
|
+
this.clientIO.on('createRequestedElement', /*#__PURE__*/function () {
|
|
75633
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(payload) {
|
|
75634
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
75635
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
75636
|
+
case 0:
|
|
75637
|
+
if (!(payload.clientId === _this.clientIO.id)) {
|
|
75638
|
+
_context2.next = 4;
|
|
75639
|
+
break;
|
|
75640
|
+
}
|
|
75641
|
+
_context2.next = 3;
|
|
75642
|
+
return _this.createRemoteShape(payload.changes);
|
|
75643
|
+
case 3:
|
|
75644
|
+
// Add the new element to the shared array
|
|
75645
|
+
applyUpdate(_this.yDoc, new Uint8Array(payload.updateDoc));
|
|
75646
|
+
case 4:
|
|
75647
|
+
case "end":
|
|
75648
|
+
return _context2.stop();
|
|
75649
|
+
}
|
|
75650
|
+
}, _callee2);
|
|
75651
|
+
}));
|
|
75652
|
+
return function (_x2) {
|
|
75653
|
+
return _ref2.apply(this, arguments);
|
|
75654
|
+
};
|
|
75655
|
+
}());
|
|
75656
|
+
|
|
75607
75657
|
// Listen for updates when an element is removed
|
|
75608
75658
|
this.clientIO.on('removeElement', function (payload) {
|
|
75609
75659
|
payload.deletedNodes.forEach(function (nodeId) {
|
|
@@ -75643,9 +75693,9 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75643
75693
|
window.ProcessMaker.EventBus.$on('multiplayer-updateNodes', function (data) {
|
|
75644
75694
|
_this.updateNodes(data);
|
|
75645
75695
|
});
|
|
75646
|
-
window.ProcessMaker.EventBus.$on('multiplayer-replaceNode', function (
|
|
75647
|
-
var nodeData =
|
|
75648
|
-
newControl =
|
|
75696
|
+
window.ProcessMaker.EventBus.$on('multiplayer-replaceNode', function (_ref3) {
|
|
75697
|
+
var nodeData = _ref3.nodeData,
|
|
75698
|
+
newControl = _ref3.newControl;
|
|
75649
75699
|
_this.replaceNode(nodeData, newControl);
|
|
75650
75700
|
});
|
|
75651
75701
|
window.ProcessMaker.EventBus.$on('multiplayer-addFlow', function (data) {
|
|
@@ -75665,7 +75715,9 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75665
75715
|
// Encode the state as an update and send it to the server
|
|
75666
75716
|
var stateUpdate = encodeStateAsUpdate(this.yDoc);
|
|
75667
75717
|
// Send the update to the web socket server
|
|
75668
|
-
this.clientIO.emit('createElement',
|
|
75718
|
+
this.clientIO.emit('createElement', {
|
|
75719
|
+
updateDoc: stateUpdate
|
|
75720
|
+
});
|
|
75669
75721
|
}
|
|
75670
75722
|
}, {
|
|
75671
75723
|
key: "createShape",
|
|
@@ -75828,17 +75880,17 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75828
75880
|
}, {
|
|
75829
75881
|
key: "updateShapes",
|
|
75830
75882
|
value: function () {
|
|
75831
|
-
var _updateShapes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
75883
|
+
var _updateShapes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {
|
|
75832
75884
|
var _this4 = this;
|
|
75833
75885
|
var paper, element, newPool, sourceElem, targetElem, waypoint, startWaypoint, endWaypoint, newWaypoint, node;
|
|
75834
|
-
return _regeneratorRuntime().wrap(function
|
|
75835
|
-
while (1) switch (
|
|
75886
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
75887
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
75836
75888
|
case 0:
|
|
75837
75889
|
paper = this.modeler.paper;
|
|
75838
75890
|
element = this.modeler.getElementByNodeId(data.id);
|
|
75839
75891
|
newPool = this.modeler.getElementByNodeId(data.poolId);
|
|
75840
75892
|
if (!this.modeler.flowTypes.includes(data.type)) {
|
|
75841
|
-
|
|
75893
|
+
_context3.next = 15;
|
|
75842
75894
|
break;
|
|
75843
75895
|
}
|
|
75844
75896
|
// Update the element's waypoints
|
|
@@ -75872,7 +75924,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75872
75924
|
name: 'boundary'
|
|
75873
75925
|
}
|
|
75874
75926
|
});
|
|
75875
|
-
|
|
75927
|
+
_context3.next = 26;
|
|
75876
75928
|
break;
|
|
75877
75929
|
case 15:
|
|
75878
75930
|
// Update the element's position attribute
|
|
@@ -75890,13 +75942,13 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75890
75942
|
});
|
|
75891
75943
|
|
|
75892
75944
|
// Trigger a rendering of the element on the paper
|
|
75893
|
-
|
|
75945
|
+
_context3.next = 21;
|
|
75894
75946
|
return paper.findViewByModel(element).update();
|
|
75895
75947
|
case 21:
|
|
75896
|
-
|
|
75948
|
+
_context3.next = 23;
|
|
75897
75949
|
return element.component.$nextTick();
|
|
75898
75950
|
case 23:
|
|
75899
|
-
|
|
75951
|
+
_context3.next = 25;
|
|
75900
75952
|
return this.modeler.paperManager.awaitScheduledUpdates();
|
|
75901
75953
|
case 25:
|
|
75902
75954
|
if (newPool && element.component.node.pool && element.component.node.pool.component.id !== data.poolId) {
|
|
@@ -75904,11 +75956,11 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75904
75956
|
}
|
|
75905
75957
|
case 26:
|
|
75906
75958
|
case "end":
|
|
75907
|
-
return
|
|
75959
|
+
return _context3.stop();
|
|
75908
75960
|
}
|
|
75909
|
-
},
|
|
75961
|
+
}, _callee3, this);
|
|
75910
75962
|
}));
|
|
75911
|
-
function updateShapes(
|
|
75963
|
+
function updateShapes(_x3) {
|
|
75912
75964
|
return _updateShapes.apply(this, arguments);
|
|
75913
75965
|
}
|
|
75914
75966
|
return updateShapes;
|
|
@@ -75922,7 +75974,9 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75922
75974
|
// Encode the state as an update and send it to the server
|
|
75923
75975
|
var stateUpdate = encodeStateAsUpdate(this.yDoc);
|
|
75924
75976
|
// Send the update to the web socket server
|
|
75925
|
-
this.clientIO.emit('createElement',
|
|
75977
|
+
this.clientIO.emit('createElement', {
|
|
75978
|
+
updateDoc: stateUpdate
|
|
75979
|
+
});
|
|
75926
75980
|
_classPrivateFieldGet(this, _nodeIdGenerator).updateCounters();
|
|
75927
75981
|
}
|
|
75928
75982
|
}, {
|
|
@@ -75947,7 +76001,9 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75947
76001
|
_this5.doTransact(yMapNested, data);
|
|
75948
76002
|
_this5.yArray.push([yMapNested]);
|
|
75949
76003
|
var stateUpdate = encodeStateAsUpdate(_this5.yDoc);
|
|
75950
|
-
_this5.clientIO.emit('createElement',
|
|
76004
|
+
_this5.clientIO.emit('createElement', {
|
|
76005
|
+
updateDoc: stateUpdate
|
|
76006
|
+
});
|
|
75951
76007
|
});
|
|
75952
76008
|
});
|
|
75953
76009
|
}
|
|
@@ -76968,7 +77024,11 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
76968
77024
|
while (1) switch (_context8.prev = _context8.next) {
|
|
76969
77025
|
case 0:
|
|
76970
77026
|
node = _this21.createNode(type, definition, diagram);
|
|
76971
|
-
|
|
77027
|
+
if (!_this21.isMultiplayer) {
|
|
77028
|
+
store.commit('addNode', node);
|
|
77029
|
+
} else {
|
|
77030
|
+
_this21.loadNodeForMultiplayer(node);
|
|
77031
|
+
}
|
|
76972
77032
|
case 2:
|
|
76973
77033
|
case "end":
|
|
76974
77034
|
return _context8.stop();
|
|
@@ -76976,6 +77036,39 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
76976
77036
|
}, _callee8);
|
|
76977
77037
|
}))();
|
|
76978
77038
|
},
|
|
77039
|
+
loadNodeForMultiplayer: function loadNodeForMultiplayer(node) {
|
|
77040
|
+
var _this22 = this;
|
|
77041
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
77042
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
77043
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
77044
|
+
case 0:
|
|
77045
|
+
if (!(node.type === 'processmaker-modeler-lane')) {
|
|
77046
|
+
_context9.next = 10;
|
|
77047
|
+
break;
|
|
77048
|
+
}
|
|
77049
|
+
_context9.next = 3;
|
|
77050
|
+
return _this22.addNode(node, node.definition.id, true);
|
|
77051
|
+
case 3:
|
|
77052
|
+
_this22.nodeIdGenerator.updateCounters();
|
|
77053
|
+
_context9.next = 6;
|
|
77054
|
+
return _this22.$nextTick();
|
|
77055
|
+
case 6:
|
|
77056
|
+
_context9.next = 8;
|
|
77057
|
+
return _this22.paperManager.awaitScheduledUpdates();
|
|
77058
|
+
case 8:
|
|
77059
|
+
window.ProcessMaker.EventBus.$emit('multiplayer-addLanes', [node]);
|
|
77060
|
+
return _context9.abrupt("return");
|
|
77061
|
+
case 10:
|
|
77062
|
+
_this22.multiplayerHook(node, false);
|
|
77063
|
+
store.commit('addNode', node);
|
|
77064
|
+
_this22.poolTarget = null;
|
|
77065
|
+
case 13:
|
|
77066
|
+
case "end":
|
|
77067
|
+
return _context9.stop();
|
|
77068
|
+
}
|
|
77069
|
+
}, _callee9);
|
|
77070
|
+
}))();
|
|
77071
|
+
},
|
|
76979
77072
|
createNode: function createNode(type, definition, diagram) {
|
|
76980
77073
|
if (Node.isTimerType(type)) {
|
|
76981
77074
|
return new TimerEventNode(type, definition, diagram);
|
|
@@ -76994,95 +77087,95 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
76994
77087
|
return hasSource && hasTarget;
|
|
76995
77088
|
},
|
|
76996
77089
|
waitForCursorToChange: function waitForCursorToChange() {
|
|
76997
|
-
var
|
|
76998
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77090
|
+
var _this23 = this;
|
|
77091
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
76999
77092
|
var cursorWaitTime;
|
|
77000
|
-
return _regeneratorRuntime().wrap(function
|
|
77001
|
-
while (1) switch (
|
|
77093
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
77094
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
77002
77095
|
case 0:
|
|
77003
77096
|
cursorWaitTime = 300;
|
|
77004
|
-
|
|
77005
|
-
return
|
|
77097
|
+
_context10.next = 3;
|
|
77098
|
+
return _this23.$nextTick();
|
|
77006
77099
|
case 3:
|
|
77007
|
-
return
|
|
77100
|
+
return _context10.abrupt("return", new Promise(function (resolve) {
|
|
77008
77101
|
return setTimeout(resolve, cursorWaitTime);
|
|
77009
77102
|
}));
|
|
77010
77103
|
case 4:
|
|
77011
77104
|
case "end":
|
|
77012
|
-
return
|
|
77105
|
+
return _context10.stop();
|
|
77013
77106
|
}
|
|
77014
|
-
},
|
|
77107
|
+
}, _callee10);
|
|
77015
77108
|
}))();
|
|
77016
77109
|
},
|
|
77017
77110
|
renderPaper: function renderPaper() {
|
|
77018
|
-
var
|
|
77019
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77020
|
-
return _regeneratorRuntime().wrap(function
|
|
77021
|
-
while (1) switch (
|
|
77111
|
+
var _this24 = this;
|
|
77112
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
77113
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
77114
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
77022
77115
|
case 0:
|
|
77023
|
-
|
|
77024
|
-
|
|
77025
|
-
return
|
|
77026
|
-
return _regeneratorRuntime().wrap(function
|
|
77027
|
-
while (1) switch (
|
|
77116
|
+
_this24.isRendering = true;
|
|
77117
|
+
_context12.next = 3;
|
|
77118
|
+
return _this24.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
77119
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
77120
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
77028
77121
|
case 0:
|
|
77029
|
-
|
|
77030
|
-
return
|
|
77122
|
+
_context11.next = 2;
|
|
77123
|
+
return _this24.waitForCursorToChange();
|
|
77031
77124
|
case 2:
|
|
77032
|
-
|
|
77033
|
-
|
|
77034
|
-
|
|
77125
|
+
_this24.parse();
|
|
77126
|
+
_this24.addPools();
|
|
77127
|
+
_this24.setUpDiagram();
|
|
77035
77128
|
case 5:
|
|
77036
77129
|
case "end":
|
|
77037
|
-
return
|
|
77130
|
+
return _context11.stop();
|
|
77038
77131
|
}
|
|
77039
|
-
},
|
|
77132
|
+
}, _callee11);
|
|
77040
77133
|
})));
|
|
77041
77134
|
case 3:
|
|
77042
|
-
|
|
77043
|
-
return
|
|
77135
|
+
_context12.next = 5;
|
|
77136
|
+
return _this24.paperManager.awaitScheduledUpdates();
|
|
77044
77137
|
case 5:
|
|
77045
|
-
|
|
77046
|
-
|
|
77138
|
+
_this24.isRendering = false;
|
|
77139
|
+
_this24.$emit('parsed');
|
|
77047
77140
|
case 7:
|
|
77048
77141
|
case "end":
|
|
77049
|
-
return
|
|
77142
|
+
return _context12.stop();
|
|
77050
77143
|
}
|
|
77051
|
-
},
|
|
77144
|
+
}, _callee12);
|
|
77052
77145
|
}))();
|
|
77053
77146
|
},
|
|
77054
77147
|
loadXML: function loadXML() {
|
|
77055
77148
|
var _arguments3 = arguments,
|
|
77056
|
-
|
|
77057
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77149
|
+
_this25 = this;
|
|
77150
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
77058
77151
|
var xml, emitChangeEvent;
|
|
77059
|
-
return _regeneratorRuntime().wrap(function
|
|
77060
|
-
while (1) switch (
|
|
77152
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
77153
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
77061
77154
|
case 0:
|
|
77062
77155
|
xml = _arguments3.length > 0 && _arguments3[0] !== undefined ? _arguments3[0] : null;
|
|
77063
77156
|
emitChangeEvent = false;
|
|
77064
77157
|
if (xml === null) {
|
|
77065
|
-
xml =
|
|
77158
|
+
xml = _this25.currentXML;
|
|
77066
77159
|
emitChangeEvent = true;
|
|
77067
77160
|
}
|
|
77068
|
-
|
|
77069
|
-
return
|
|
77161
|
+
_context13.next = 5;
|
|
77162
|
+
return _this25.xmlManager.getDefinitionsFromXml(xml);
|
|
77070
77163
|
case 5:
|
|
77071
|
-
|
|
77072
|
-
|
|
77073
|
-
|
|
77164
|
+
_this25.definitions = _context13.sent;
|
|
77165
|
+
_this25.xmlManager.definitions = _this25.definitions;
|
|
77166
|
+
_this25.nodeIdGenerator = getNodeIdGenerator(_this25.definitions);
|
|
77074
77167
|
store.commit('clearNodes');
|
|
77075
|
-
|
|
77076
|
-
return
|
|
77168
|
+
_context13.next = 11;
|
|
77169
|
+
return _this25.renderPaper();
|
|
77077
77170
|
case 11:
|
|
77078
77171
|
if (emitChangeEvent) {
|
|
77079
77172
|
window.ProcessMaker.EventBus.$emit('modeler-change');
|
|
77080
77173
|
}
|
|
77081
77174
|
case 12:
|
|
77082
77175
|
case "end":
|
|
77083
|
-
return
|
|
77176
|
+
return _context13.stop();
|
|
77084
77177
|
}
|
|
77085
|
-
},
|
|
77178
|
+
}, _callee13);
|
|
77086
77179
|
}))();
|
|
77087
77180
|
},
|
|
77088
77181
|
getBoundaryEvents: function getBoundaryEvents(process) {
|
|
@@ -77106,13 +77199,13 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77106
77199
|
return boundaryEvent;
|
|
77107
77200
|
},
|
|
77108
77201
|
ensureCancelActivityIsAddedToBoundaryEvents: function ensureCancelActivityIsAddedToBoundaryEvents(process) {
|
|
77109
|
-
var
|
|
77202
|
+
var _this26 = this;
|
|
77110
77203
|
this.getBoundaryEvents(process).forEach(function (definition) {
|
|
77111
|
-
var boundaryEvent =
|
|
77204
|
+
var boundaryEvent = _this26.createBoundaryEvent(definition);
|
|
77112
77205
|
definition.get('outgoing').forEach(function (outgoing) {
|
|
77113
77206
|
return outgoing.set('sourceRef', boundaryEvent);
|
|
77114
77207
|
});
|
|
77115
|
-
|
|
77208
|
+
_this26.replaceDefinition(definition, boundaryEvent, process);
|
|
77116
77209
|
});
|
|
77117
77210
|
},
|
|
77118
77211
|
replaceDefinition: function replaceDefinition(definition, boundaryEvent, process) {
|
|
@@ -77138,82 +77231,82 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77138
77231
|
});
|
|
77139
77232
|
},
|
|
77140
77233
|
addRemoteNode: function addRemoteNode(data) {
|
|
77141
|
-
var
|
|
77142
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77234
|
+
var _this27 = this;
|
|
77235
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
77143
77236
|
var definition, diagram, newNode;
|
|
77144
|
-
return _regeneratorRuntime().wrap(function
|
|
77145
|
-
while (1) switch (
|
|
77237
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
77238
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
77146
77239
|
case 0:
|
|
77147
|
-
definition =
|
|
77148
|
-
diagram =
|
|
77240
|
+
definition = _this27.nodeRegistry[data.type].definition(_this27.moddle, _this27.$t);
|
|
77241
|
+
diagram = _this27.nodeRegistry[data.type].diagram(_this27.moddle);
|
|
77149
77242
|
diagram.bounds.x = data.x;
|
|
77150
77243
|
diagram.bounds.y = data.y;
|
|
77151
|
-
newNode =
|
|
77152
|
-
|
|
77153
|
-
return
|
|
77244
|
+
newNode = _this27.createNode(data.type, definition, diagram);
|
|
77245
|
+
_context14.next = 7;
|
|
77246
|
+
return _this27.addNode(newNode, data.id, true);
|
|
77154
77247
|
case 7:
|
|
77155
|
-
|
|
77156
|
-
return
|
|
77248
|
+
_context14.next = 9;
|
|
77249
|
+
return _this27.$nextTick();
|
|
77157
77250
|
case 9:
|
|
77158
|
-
|
|
77159
|
-
return
|
|
77251
|
+
_context14.next = 11;
|
|
77252
|
+
return _this27.paperManager.awaitScheduledUpdates();
|
|
77160
77253
|
case 11:
|
|
77161
|
-
if (
|
|
77162
|
-
|
|
77254
|
+
if (_this27.autoValidate) {
|
|
77255
|
+
_this27.validateBpmnDiagram();
|
|
77163
77256
|
}
|
|
77164
77257
|
case 12:
|
|
77165
77258
|
case "end":
|
|
77166
|
-
return
|
|
77259
|
+
return _context14.stop();
|
|
77167
77260
|
}
|
|
77168
|
-
},
|
|
77261
|
+
}, _callee14);
|
|
77169
77262
|
}))();
|
|
77170
77263
|
},
|
|
77171
77264
|
handleDrop: function handleDrop(data) {
|
|
77172
|
-
var
|
|
77173
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77174
|
-
var clientX, clientY, control, nodeThatWillBeReplaced, definition, diagram,
|
|
77175
|
-
return _regeneratorRuntime().wrap(function
|
|
77176
|
-
while (1) switch (
|
|
77265
|
+
var _this28 = this;
|
|
77266
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
77267
|
+
var clientX, clientY, control, nodeThatWillBeReplaced, definition, diagram, _this28$paperManager$, x, y, newNode, nodeMigrator;
|
|
77268
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
77269
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
77177
77270
|
case 0:
|
|
77178
77271
|
clientX = data.clientX, clientY = data.clientY, control = data.control, nodeThatWillBeReplaced = data.nodeThatWillBeReplaced;
|
|
77179
|
-
|
|
77272
|
+
_this28.validateDropTarget({
|
|
77180
77273
|
clientX: clientX,
|
|
77181
77274
|
clientY: clientY,
|
|
77182
77275
|
control: control
|
|
77183
77276
|
});
|
|
77184
|
-
if (
|
|
77185
|
-
|
|
77277
|
+
if (_this28.allowDrop) {
|
|
77278
|
+
_context15.next = 4;
|
|
77186
77279
|
break;
|
|
77187
77280
|
}
|
|
77188
|
-
return
|
|
77281
|
+
return _context15.abrupt("return");
|
|
77189
77282
|
case 4:
|
|
77190
|
-
definition =
|
|
77191
|
-
diagram =
|
|
77192
|
-
|
|
77283
|
+
definition = _this28.nodeRegistry[control.type].definition(_this28.moddle, _this28.$t);
|
|
77284
|
+
diagram = _this28.nodeRegistry[control.type].diagram(_this28.moddle);
|
|
77285
|
+
_this28$paperManager$ = _this28.paperManager.clientToGridPoint(clientX, clientY), x = _this28$paperManager$.x, y = _this28$paperManager$.y;
|
|
77193
77286
|
diagram.bounds.x = x;
|
|
77194
77287
|
diagram.bounds.y = y;
|
|
77195
|
-
newNode =
|
|
77288
|
+
newNode = _this28.createNode(control.type, definition, diagram);
|
|
77196
77289
|
if (newNode.isBpmnType('bpmn:BoundaryEvent')) {
|
|
77197
|
-
|
|
77290
|
+
_this28.setShapeCenterUnderCursor(diagram);
|
|
77198
77291
|
}
|
|
77199
|
-
|
|
77200
|
-
|
|
77201
|
-
return
|
|
77292
|
+
_this28.highlightNode(newNode);
|
|
77293
|
+
_context15.next = 14;
|
|
77294
|
+
return _this28.addNode(newNode);
|
|
77202
77295
|
case 14:
|
|
77203
77296
|
if (nodeThatWillBeReplaced) {
|
|
77204
|
-
|
|
77297
|
+
_context15.next = 16;
|
|
77205
77298
|
break;
|
|
77206
77299
|
}
|
|
77207
|
-
return
|
|
77300
|
+
return _context15.abrupt("return");
|
|
77208
77301
|
case 16:
|
|
77209
|
-
nodeMigrator = new NodeMigrator(nodeThatWillBeReplaced, definition,
|
|
77302
|
+
nodeMigrator = new NodeMigrator(nodeThatWillBeReplaced, definition, _this28.graph, newNode, _this28.processes, _this28.collaboration);
|
|
77210
77303
|
nodeMigrator.migrate();
|
|
77211
|
-
return
|
|
77304
|
+
return _context15.abrupt("return", newNode);
|
|
77212
77305
|
case 19:
|
|
77213
77306
|
case "end":
|
|
77214
|
-
return
|
|
77307
|
+
return _context15.stop();
|
|
77215
77308
|
}
|
|
77216
|
-
},
|
|
77309
|
+
}, _callee15);
|
|
77217
77310
|
}))();
|
|
77218
77311
|
},
|
|
77219
77312
|
setShapeCenterUnderCursor: function setShapeCenterUnderCursor(diagram) {
|
|
@@ -77221,32 +77314,33 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77221
77314
|
diagram.bounds.y -= diagram.bounds.height / 2;
|
|
77222
77315
|
},
|
|
77223
77316
|
selectNewNode: function selectNewNode(node) {
|
|
77224
|
-
var
|
|
77225
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77317
|
+
var _this29 = this;
|
|
77318
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
77226
77319
|
var newNodeComponent, view;
|
|
77227
|
-
return _regeneratorRuntime().wrap(function
|
|
77228
|
-
while (1) switch (
|
|
77320
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
77321
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
77229
77322
|
case 0:
|
|
77230
|
-
|
|
77231
|
-
return
|
|
77323
|
+
_context16.next = 2;
|
|
77324
|
+
return _this29.$nextTick();
|
|
77232
77325
|
case 2:
|
|
77233
|
-
|
|
77234
|
-
return
|
|
77326
|
+
_context16.next = 4;
|
|
77327
|
+
return _this29.paperManager.awaitScheduledUpdates();
|
|
77235
77328
|
case 4:
|
|
77236
|
-
newNodeComponent =
|
|
77329
|
+
newNodeComponent = _this29.$refs.nodeComponent.find(function (component) {
|
|
77237
77330
|
return component.node === node;
|
|
77238
77331
|
});
|
|
77239
77332
|
view = newNodeComponent.shapeView;
|
|
77240
|
-
|
|
77241
|
-
return
|
|
77333
|
+
_context16.next = 8;
|
|
77334
|
+
return _this29.$refs.selector.selectElement(view);
|
|
77242
77335
|
case 8:
|
|
77243
77336
|
case "end":
|
|
77244
|
-
return
|
|
77337
|
+
return _context16.stop();
|
|
77245
77338
|
}
|
|
77246
|
-
},
|
|
77339
|
+
}, _callee16);
|
|
77247
77340
|
}))();
|
|
77248
77341
|
},
|
|
77249
77342
|
multiplayerHook: function multiplayerHook(node, fromClient) {
|
|
77343
|
+
var isProcessRequested = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
77250
77344
|
var blackList = ['processmaker-modeler-lane', 'processmaker-modeler-generic-flow', 'processmaker-modeler-sequence-flow', 'processmaker-modeler-association', 'processmaker-modeler-data-input-association', 'processmaker-modeler-data-output-association'];
|
|
77251
77345
|
if (!this.isMultiplayer) {
|
|
77252
77346
|
return;
|
|
@@ -77267,6 +77361,9 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77267
77361
|
if (node !== null && node !== void 0 && (_node$pool = node.pool) !== null && _node$pool !== void 0 && _node$pool.component) {
|
|
77268
77362
|
defaultData['poolId'] = node.pool.component.id;
|
|
77269
77363
|
}
|
|
77364
|
+
if (isProcessRequested) {
|
|
77365
|
+
return defaultData;
|
|
77366
|
+
}
|
|
77270
77367
|
window.ProcessMaker.EventBus.$emit('multiplayer-addNode', defaultData);
|
|
77271
77368
|
}
|
|
77272
77369
|
if (this.flowTypes.includes(node.type)) {
|
|
@@ -77274,218 +77371,222 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77274
77371
|
var sourceRefId = (_node$definition$sour = node.definition.sourceRef) === null || _node$definition$sour === void 0 ? void 0 : _node$definition$sour.id;
|
|
77275
77372
|
var targetRefId = (_node$definition$targ = node.definition.targetRef) === null || _node$definition$targ === void 0 ? void 0 : _node$definition$targ.id;
|
|
77276
77373
|
if (node.type === 'processmaker-modeler-data-input-association') {
|
|
77277
|
-
var _node$definition$sour2, _node$definition$targ2, _node$definition$targ3;
|
|
77374
|
+
var _node$definition$sour2, _node$definition$targ2, _node$definition$targ3, _node$definition$targ4;
|
|
77278
77375
|
sourceRefId = Array.isArray(node.definition.sourceRef) && ((_node$definition$sour2 = node.definition.sourceRef[0]) === null || _node$definition$sour2 === void 0 ? void 0 : _node$definition$sour2.id);
|
|
77279
|
-
targetRefId = (_node$definition$targ2 = node.definition.targetRef) === null || _node$definition$targ2 === void 0 ? void 0 : (_node$definition$targ3 = _node$definition$targ2.$parent) === null || _node$definition$targ3 === void 0 ? void 0 : _node$definition$targ3.$parent.get('id');
|
|
77376
|
+
targetRefId = (_node$definition$targ2 = node.definition.targetRef) === null || _node$definition$targ2 === void 0 ? void 0 : (_node$definition$targ3 = _node$definition$targ2.$parent) === null || _node$definition$targ3 === void 0 ? void 0 : (_node$definition$targ4 = _node$definition$targ3.$parent) === null || _node$definition$targ4 === void 0 ? void 0 : _node$definition$targ4.get('id');
|
|
77280
77377
|
}
|
|
77281
77378
|
if (sourceRefId && targetRefId) {
|
|
77282
|
-
|
|
77379
|
+
var flowData = {
|
|
77283
77380
|
id: node.definition.id,
|
|
77284
77381
|
type: node.type,
|
|
77285
77382
|
sourceRefId: sourceRefId,
|
|
77286
77383
|
targetRefId: targetRefId,
|
|
77287
77384
|
waypoint: node.diagram.waypoint
|
|
77288
|
-
}
|
|
77385
|
+
};
|
|
77386
|
+
if (isProcessRequested) {
|
|
77387
|
+
return flowData;
|
|
77388
|
+
}
|
|
77389
|
+
window.ProcessMaker.EventBus.$emit('multiplayer-addFlow', flowData);
|
|
77289
77390
|
}
|
|
77290
77391
|
}
|
|
77291
77392
|
}
|
|
77292
77393
|
},
|
|
77293
77394
|
addNode: function addNode(node) {
|
|
77294
77395
|
var _arguments4 = arguments,
|
|
77295
|
-
|
|
77296
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77396
|
+
_this30 = this;
|
|
77397
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
77297
77398
|
var id, fromClient, targetProcess;
|
|
77298
|
-
return _regeneratorRuntime().wrap(function
|
|
77299
|
-
while (1) switch (
|
|
77399
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
77400
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
77300
77401
|
case 0:
|
|
77301
77402
|
id = _arguments4.length > 1 && _arguments4[1] !== undefined ? _arguments4[1] : null;
|
|
77302
77403
|
fromClient = _arguments4.length > 2 && _arguments4[2] !== undefined ? _arguments4[2] : false;
|
|
77303
77404
|
if (!node.pool) {
|
|
77304
|
-
node.pool =
|
|
77405
|
+
node.pool = _this30.poolTarget;
|
|
77305
77406
|
}
|
|
77306
|
-
targetProcess = node.getTargetProcess(
|
|
77407
|
+
targetProcess = node.getTargetProcess(_this30.processes, _this30.processNode);
|
|
77307
77408
|
addNodeToProcess(node, targetProcess);
|
|
77308
|
-
node.setIds(
|
|
77309
|
-
|
|
77409
|
+
node.setIds(_this30.nodeIdGenerator, id);
|
|
77410
|
+
_this30.planeElements.push(node.diagram);
|
|
77310
77411
|
// add multiplayer logic as a hook
|
|
77311
|
-
|
|
77412
|
+
_this30.multiplayerHook(node, fromClient);
|
|
77312
77413
|
store.commit('addNode', node);
|
|
77313
|
-
|
|
77414
|
+
_this30.poolTarget = null;
|
|
77314
77415
|
|
|
77315
77416
|
// add processmaker-modeler-generic-flow
|
|
77316
77417
|
if (![sequenceFlow_id, poolLane_config_id, associationConfig_id, messageFlow_config_id, config_id, dataInputAssociation_config_id, genericFlow_config_id].includes(node.type)) {
|
|
77317
|
-
|
|
77418
|
+
_context17.next = 12;
|
|
77318
77419
|
break;
|
|
77319
77420
|
}
|
|
77320
|
-
return
|
|
77421
|
+
return _context17.abrupt("return");
|
|
77321
77422
|
case 12:
|
|
77322
77423
|
if (!fromClient) {
|
|
77323
77424
|
// Select the node after it has been added to the store (does not apply to flows)
|
|
77324
|
-
|
|
77425
|
+
_this30.selectNewNode(node);
|
|
77325
77426
|
}
|
|
77326
|
-
return
|
|
77427
|
+
return _context17.abrupt("return", new Promise(function (resolve) {
|
|
77327
77428
|
setTimeout(function () {
|
|
77328
|
-
|
|
77429
|
+
_this30.pushToUndoStack();
|
|
77329
77430
|
resolve();
|
|
77330
77431
|
});
|
|
77331
77432
|
}));
|
|
77332
77433
|
case 14:
|
|
77333
77434
|
case "end":
|
|
77334
|
-
return
|
|
77435
|
+
return _context17.stop();
|
|
77335
77436
|
}
|
|
77336
|
-
},
|
|
77437
|
+
}, _callee17);
|
|
77337
77438
|
}))();
|
|
77338
77439
|
},
|
|
77339
77440
|
addClonedNodes: function addClonedNodes(nodes) {
|
|
77340
|
-
var
|
|
77341
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77342
|
-
return _regeneratorRuntime().wrap(function
|
|
77343
|
-
while (1) switch (
|
|
77441
|
+
var _this31 = this;
|
|
77442
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
77443
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
77444
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
77344
77445
|
case 0:
|
|
77345
77446
|
nodes.forEach(function (node) {
|
|
77346
77447
|
if (!node.pool) {
|
|
77347
|
-
node.pool =
|
|
77448
|
+
node.pool = _this31.poolTarget;
|
|
77348
77449
|
}
|
|
77349
|
-
var targetProcess = node.getTargetProcess(
|
|
77450
|
+
var targetProcess = node.getTargetProcess(_this31.processes, _this31.processNode);
|
|
77350
77451
|
addNodeToProcess(node, targetProcess);
|
|
77351
|
-
|
|
77352
|
-
|
|
77452
|
+
_this31.planeElements.push(node.diagram);
|
|
77453
|
+
_this31.multiplayerHook(node, false);
|
|
77353
77454
|
store.commit('addNode', node);
|
|
77354
|
-
|
|
77455
|
+
_this31.poolTarget = null;
|
|
77355
77456
|
});
|
|
77356
77457
|
case 1:
|
|
77357
77458
|
case "end":
|
|
77358
|
-
return
|
|
77459
|
+
return _context18.stop();
|
|
77359
77460
|
}
|
|
77360
|
-
},
|
|
77461
|
+
}, _callee18);
|
|
77361
77462
|
}))();
|
|
77362
77463
|
},
|
|
77363
77464
|
removeNode: function removeNode(node, options) {
|
|
77364
|
-
var
|
|
77365
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77366
|
-
return _regeneratorRuntime().wrap(function
|
|
77367
|
-
while (1) switch (
|
|
77465
|
+
var _this32 = this;
|
|
77466
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
77467
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
77468
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
77368
77469
|
case 0:
|
|
77369
77470
|
// Check if the node is not replaced
|
|
77370
|
-
if (
|
|
77471
|
+
if (_this32.isMultiplayer && !(options !== null && options !== void 0 && options.isReplaced)) {
|
|
77371
77472
|
// Emit event to server to remove node
|
|
77372
77473
|
window.ProcessMaker.EventBus.$emit('multiplayer-removeNode', node);
|
|
77373
77474
|
}
|
|
77374
|
-
|
|
77475
|
+
_this32.removeNodeProcedure(node, options);
|
|
77375
77476
|
case 2:
|
|
77376
77477
|
case "end":
|
|
77377
|
-
return
|
|
77478
|
+
return _context19.stop();
|
|
77378
77479
|
}
|
|
77379
|
-
},
|
|
77480
|
+
}, _callee19);
|
|
77380
77481
|
}))();
|
|
77381
77482
|
},
|
|
77382
77483
|
removeNodeProcedure: function removeNodeProcedure(node) {
|
|
77383
77484
|
var _arguments5 = arguments,
|
|
77384
|
-
|
|
77385
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77485
|
+
_this33 = this;
|
|
77486
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
|
|
77386
77487
|
var _ref6, _ref6$removeRelations, removeRelationships;
|
|
77387
|
-
return _regeneratorRuntime().wrap(function
|
|
77388
|
-
while (1) switch (
|
|
77488
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
77489
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
77389
77490
|
case 0:
|
|
77390
77491
|
_ref6 = _arguments5.length > 1 && _arguments5[1] !== undefined ? _arguments5[1] : {}, _ref6$removeRelations = _ref6.removeRelationships, removeRelationships = _ref6$removeRelations === void 0 ? true : _ref6$removeRelations;
|
|
77391
77492
|
if (node) {
|
|
77392
|
-
|
|
77493
|
+
_context20.next = 3;
|
|
77393
77494
|
break;
|
|
77394
77495
|
}
|
|
77395
|
-
return
|
|
77496
|
+
return _context20.abrupt("return");
|
|
77396
77497
|
case 3:
|
|
77397
77498
|
if (removeRelationships) {
|
|
77398
|
-
removeNodeFlows(node,
|
|
77399
|
-
removeNodeMessageFlows(node,
|
|
77400
|
-
removeNodeAssociations(node,
|
|
77499
|
+
removeNodeFlows(node, _this33);
|
|
77500
|
+
removeNodeMessageFlows(node, _this33);
|
|
77501
|
+
removeNodeAssociations(node, _this33);
|
|
77401
77502
|
}
|
|
77402
77503
|
removeOutgoingAndIncomingRefsToFlow(node);
|
|
77403
|
-
removeBoundaryEvents(
|
|
77504
|
+
removeBoundaryEvents(_this33.graph, node, _this33.removeNode);
|
|
77404
77505
|
removeSourceDefault(node);
|
|
77405
|
-
|
|
77406
|
-
|
|
77506
|
+
_this33.removeNodesFromLane(node);
|
|
77507
|
+
_this33.removeNodesFromPool(node);
|
|
77407
77508
|
store.commit('removeNode', node);
|
|
77408
|
-
store.commit('highlightNode',
|
|
77409
|
-
|
|
77410
|
-
|
|
77411
|
-
return
|
|
77509
|
+
store.commit('highlightNode', _this33.processNode);
|
|
77510
|
+
_this33.$refs.selector.clearSelection();
|
|
77511
|
+
_context20.next = 14;
|
|
77512
|
+
return _this33.$nextTick();
|
|
77412
77513
|
case 14:
|
|
77413
|
-
|
|
77414
|
-
return
|
|
77514
|
+
_context20.next = 16;
|
|
77515
|
+
return _this33.pushToUndoStack();
|
|
77415
77516
|
case 16:
|
|
77416
77517
|
// force to update the processNode property in every delete
|
|
77417
|
-
|
|
77418
|
-
if (
|
|
77419
|
-
|
|
77420
|
-
return diagram.bpmnElement.id ===
|
|
77518
|
+
_this33.processes = _this33.getProcesses();
|
|
77519
|
+
if (_this33.processes && _this33.processes.length > 0) {
|
|
77520
|
+
_this33.processNode = new Node('processmaker-modeler-process', _this33.processes[0], _this33.planeElements.find(function (diagram) {
|
|
77521
|
+
return diagram.bpmnElement.id === _this33.processes[0].id;
|
|
77421
77522
|
}));
|
|
77422
77523
|
}
|
|
77423
77524
|
case 18:
|
|
77424
77525
|
case "end":
|
|
77425
|
-
return
|
|
77526
|
+
return _context20.stop();
|
|
77426
77527
|
}
|
|
77427
|
-
},
|
|
77528
|
+
}, _callee20);
|
|
77428
77529
|
}))();
|
|
77429
77530
|
},
|
|
77430
77531
|
removeNodes: function removeNodes() {
|
|
77431
|
-
var
|
|
77432
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77433
|
-
return _regeneratorRuntime().wrap(function
|
|
77434
|
-
while (1) switch (
|
|
77532
|
+
var _this34 = this;
|
|
77533
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
77534
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
77535
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
77435
77536
|
case 0:
|
|
77436
|
-
|
|
77437
|
-
return
|
|
77438
|
-
return _regeneratorRuntime().wrap(function
|
|
77439
|
-
while (1) switch (
|
|
77537
|
+
_context23.next = 2;
|
|
77538
|
+
return _this34.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
|
77539
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
77540
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
77440
77541
|
case 0:
|
|
77441
|
-
|
|
77442
|
-
return
|
|
77542
|
+
_context22.next = 2;
|
|
77543
|
+
return _this34.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
77443
77544
|
var waitPromises;
|
|
77444
|
-
return _regeneratorRuntime().wrap(function
|
|
77445
|
-
while (1) switch (
|
|
77545
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
77546
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
77446
77547
|
case 0:
|
|
77447
77548
|
waitPromises = [];
|
|
77448
|
-
|
|
77449
|
-
return waitPromises.push(
|
|
77549
|
+
_this34.highlightedNodes.forEach(function (node) {
|
|
77550
|
+
return waitPromises.push(_this34.removeNode(node, {
|
|
77450
77551
|
removeRelationships: true
|
|
77451
77552
|
}));
|
|
77452
77553
|
});
|
|
77453
|
-
|
|
77554
|
+
_context21.next = 4;
|
|
77454
77555
|
return Promise.all(waitPromises);
|
|
77455
77556
|
case 4:
|
|
77456
77557
|
store.commit('highlightNode');
|
|
77457
77558
|
case 5:
|
|
77458
77559
|
case "end":
|
|
77459
|
-
return
|
|
77560
|
+
return _context21.stop();
|
|
77460
77561
|
}
|
|
77461
|
-
},
|
|
77562
|
+
}, _callee21);
|
|
77462
77563
|
})));
|
|
77463
77564
|
case 2:
|
|
77464
77565
|
case "end":
|
|
77465
|
-
return
|
|
77566
|
+
return _context22.stop();
|
|
77466
77567
|
}
|
|
77467
|
-
},
|
|
77568
|
+
}, _callee22);
|
|
77468
77569
|
})));
|
|
77469
77570
|
case 2:
|
|
77470
77571
|
case "end":
|
|
77471
|
-
return
|
|
77572
|
+
return _context23.stop();
|
|
77472
77573
|
}
|
|
77473
|
-
},
|
|
77574
|
+
}, _callee23);
|
|
77474
77575
|
}))();
|
|
77475
77576
|
},
|
|
77476
77577
|
replaceNode: function replaceNode(_ref9) {
|
|
77477
|
-
var
|
|
77578
|
+
var _this35 = this;
|
|
77478
77579
|
var node = _ref9.node,
|
|
77479
77580
|
typeToReplaceWith = _ref9.typeToReplaceWith;
|
|
77480
|
-
this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77481
|
-
return _regeneratorRuntime().wrap(function
|
|
77482
|
-
while (1) switch (
|
|
77581
|
+
this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
|
|
77582
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
77583
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
77483
77584
|
case 0:
|
|
77484
|
-
|
|
77485
|
-
return
|
|
77486
|
-
var _node$diagram$bounds, x, y, nodeData
|
|
77487
|
-
return _regeneratorRuntime().wrap(function
|
|
77488
|
-
while (1) switch (
|
|
77585
|
+
_context25.next = 2;
|
|
77586
|
+
return _this35.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
|
|
77587
|
+
var _node$diagram$bounds, x, y, nodeData;
|
|
77588
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
77589
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
77489
77590
|
case 0:
|
|
77490
77591
|
_node$diagram$bounds = node.diagram.bounds, x = _node$diagram$bounds.x, y = _node$diagram$bounds.y;
|
|
77491
77592
|
nodeData = {
|
|
@@ -77496,96 +77597,89 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77496
77597
|
},
|
|
77497
77598
|
nodeThatWillBeReplaced: node
|
|
77498
77599
|
};
|
|
77499
|
-
|
|
77500
|
-
|
|
77501
|
-
|
|
77502
|
-
}
|
|
77503
|
-
// Get all node types
|
|
77504
|
-
nodeTypes = nodeTypesStore.getters.getNodeTypes; // Get the new control
|
|
77505
|
-
newControl = nodeTypes.flatMap(function (nodeType) {
|
|
77506
|
-
var _nodeType$items;
|
|
77507
|
-
return (_nodeType$items = nodeType.items) === null || _nodeType$items === void 0 ? void 0 : _nodeType$items.filter(function (item) {
|
|
77508
|
-
return item.type === typeToReplaceWith;
|
|
77509
|
-
});
|
|
77510
|
-
}).filter(Boolean); // If the new control is found, emit event to server to replace node
|
|
77511
|
-
if (newControl.length === 1) {
|
|
77512
|
-
window.ProcessMaker.EventBus.$emit('multiplayer-replaceNode', {
|
|
77513
|
-
nodeData: nodeData,
|
|
77514
|
-
newControl: newControl[0].type
|
|
77515
|
-
});
|
|
77516
|
-
}
|
|
77517
|
-
_context23.next = 10;
|
|
77518
|
-
break;
|
|
77519
|
-
case 8:
|
|
77520
|
-
_context23.next = 10;
|
|
77521
|
-
return _this34.replaceNodeProcedure(nodeData, true);
|
|
77522
|
-
case 10:
|
|
77600
|
+
_context24.next = 4;
|
|
77601
|
+
return _this35.replaceNodeProcedure(nodeData);
|
|
77602
|
+
case 4:
|
|
77523
77603
|
case "end":
|
|
77524
|
-
return
|
|
77604
|
+
return _context24.stop();
|
|
77525
77605
|
}
|
|
77526
|
-
},
|
|
77606
|
+
}, _callee24);
|
|
77527
77607
|
})));
|
|
77528
77608
|
case 2:
|
|
77529
77609
|
case "end":
|
|
77530
|
-
return
|
|
77610
|
+
return _context25.stop();
|
|
77531
77611
|
}
|
|
77532
|
-
},
|
|
77612
|
+
}, _callee25);
|
|
77533
77613
|
})));
|
|
77534
77614
|
},
|
|
77535
77615
|
replaceNodeProcedure: function replaceNodeProcedure(data) {
|
|
77536
77616
|
var _arguments6 = arguments,
|
|
77537
|
-
|
|
77538
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77539
|
-
var isReplaced,
|
|
77540
|
-
return _regeneratorRuntime().wrap(function
|
|
77541
|
-
while (1) switch (
|
|
77617
|
+
_this36 = this;
|
|
77618
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
|
|
77619
|
+
var isReplaced, _this36$paper$localTo, clientX, clientY, newNode, nodeTypes, newControl;
|
|
77620
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
77621
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
77542
77622
|
case 0:
|
|
77543
77623
|
isReplaced = _arguments6.length > 1 && _arguments6[1] !== undefined ? _arguments6[1] : false;
|
|
77544
|
-
|
|
77545
|
-
|
|
77546
|
-
|
|
77547
|
-
|
|
77548
|
-
|
|
77549
|
-
|
|
77550
|
-
|
|
77551
|
-
|
|
77552
|
-
|
|
77553
|
-
|
|
77554
|
-
_context25.next = 7;
|
|
77555
|
-
return _this35.removeNode(data.nodeThatWillBeReplaced, {
|
|
77624
|
+
// Get the clientX and clientY from the node that will be replaced
|
|
77625
|
+
_this36$paper$localTo = _this36.paper.localToClientPoint(data.nodeThatWillBeReplaced.diagram.bounds), clientX = _this36$paper$localTo.x, clientY = _this36$paper$localTo.y;
|
|
77626
|
+
data.clientX = clientX;
|
|
77627
|
+
data.clientY = clientY;
|
|
77628
|
+
_context26.next = 6;
|
|
77629
|
+
return _this36.handleDrop(data);
|
|
77630
|
+
case 6:
|
|
77631
|
+
newNode = _context26.sent;
|
|
77632
|
+
_context26.next = 9;
|
|
77633
|
+
return _this36.removeNode(data.nodeThatWillBeReplaced, {
|
|
77556
77634
|
removeRelationships: false,
|
|
77557
77635
|
isReplaced: isReplaced
|
|
77558
77636
|
});
|
|
77559
|
-
case 7:
|
|
77560
|
-
_this35.highlightNode(newNode);
|
|
77561
|
-
_this35.selectNewNode(newNode);
|
|
77562
77637
|
case 9:
|
|
77638
|
+
_this36.highlightNode(newNode);
|
|
77639
|
+
_this36.selectNewNode(newNode);
|
|
77640
|
+
if (_this36.isMultiplayer && !isReplaced) {
|
|
77641
|
+
// Get all node types
|
|
77642
|
+
nodeTypes = nodeTypesStore.getters.getNodeTypes; // Get the new control
|
|
77643
|
+
newControl = nodeTypes.flatMap(function (nodeType) {
|
|
77644
|
+
var _nodeType$items;
|
|
77645
|
+
return (_nodeType$items = nodeType.items) === null || _nodeType$items === void 0 ? void 0 : _nodeType$items.filter(function (item) {
|
|
77646
|
+
return item.type === data.typeToReplaceWith;
|
|
77647
|
+
});
|
|
77648
|
+
}).filter(Boolean); // If the new control is found, emit event to server to replace node
|
|
77649
|
+
if (newControl.length === 1) {
|
|
77650
|
+
window.ProcessMaker.EventBus.$emit('multiplayer-replaceNode', {
|
|
77651
|
+
data: data,
|
|
77652
|
+
newControl: newControl[0].type
|
|
77653
|
+
});
|
|
77654
|
+
}
|
|
77655
|
+
}
|
|
77656
|
+
case 12:
|
|
77563
77657
|
case "end":
|
|
77564
|
-
return
|
|
77658
|
+
return _context26.stop();
|
|
77565
77659
|
}
|
|
77566
|
-
},
|
|
77660
|
+
}, _callee26);
|
|
77567
77661
|
}))();
|
|
77568
77662
|
},
|
|
77569
77663
|
replaceAiNode: function replaceAiNode(_ref12) {
|
|
77570
|
-
var
|
|
77664
|
+
var _this37 = this;
|
|
77571
77665
|
var node = _ref12.node,
|
|
77572
77666
|
typeToReplaceWith = _ref12.typeToReplaceWith,
|
|
77573
77667
|
assetId = _ref12.assetId,
|
|
77574
77668
|
assetName = _ref12.assetName,
|
|
77575
77669
|
redirectTo = _ref12.redirectTo;
|
|
77576
|
-
this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77577
|
-
return _regeneratorRuntime().wrap(function
|
|
77578
|
-
while (1) switch (
|
|
77670
|
+
this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
|
|
77671
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
77672
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
77579
77673
|
case 0:
|
|
77580
|
-
|
|
77581
|
-
return
|
|
77582
|
-
var
|
|
77583
|
-
return _regeneratorRuntime().wrap(function
|
|
77584
|
-
while (1) switch (
|
|
77674
|
+
_context28.next = 2;
|
|
77675
|
+
return _this37.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
|
|
77676
|
+
var _this37$paper$localTo, clientX, clientY, newNode;
|
|
77677
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
77678
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
77585
77679
|
case 0:
|
|
77586
|
-
|
|
77587
|
-
|
|
77588
|
-
return
|
|
77680
|
+
_this37$paper$localTo = _this37.paper.localToClientPoint(node.diagram.bounds), clientX = _this37$paper$localTo.x, clientY = _this37$paper$localTo.y;
|
|
77681
|
+
_context27.next = 3;
|
|
77682
|
+
return _this37.handleDrop({
|
|
77589
77683
|
clientX: clientX,
|
|
77590
77684
|
clientY: clientY,
|
|
77591
77685
|
control: {
|
|
@@ -77594,7 +77688,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77594
77688
|
nodeThatWillBeReplaced: node
|
|
77595
77689
|
});
|
|
77596
77690
|
case 3:
|
|
77597
|
-
newNode =
|
|
77691
|
+
newNode = _context27.sent;
|
|
77598
77692
|
if (typeToReplaceWith === 'processmaker-modeler-task') {
|
|
77599
77693
|
newNode.definition.screenRef = assetId;
|
|
77600
77694
|
newNode.definition.name = assetName;
|
|
@@ -77609,98 +77703,98 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77609
77703
|
newNode.definition.config = "{\"calledElement\":\"ProcessId-".concat(assetId, "\",\"processId\":").concat(assetId, ",\"startEvent\":\"node_1\",\"name\":\"").concat(assetName, "\"}");
|
|
77610
77704
|
redirectTo = "".concat(redirectTo, "/").concat(newNode.id);
|
|
77611
77705
|
}
|
|
77612
|
-
|
|
77613
|
-
return
|
|
77706
|
+
_context27.next = 9;
|
|
77707
|
+
return _this37.removeNode(node, {
|
|
77614
77708
|
removeRelationships: false
|
|
77615
77709
|
});
|
|
77616
77710
|
case 9:
|
|
77617
|
-
|
|
77618
|
-
|
|
77619
|
-
|
|
77620
|
-
return
|
|
77711
|
+
_this37.highlightNode(newNode);
|
|
77712
|
+
_this37.selectNewNode(newNode);
|
|
77713
|
+
_context27.next = 13;
|
|
77714
|
+
return _this37.pushToUndoStack();
|
|
77621
77715
|
case 13:
|
|
77622
|
-
|
|
77623
|
-
return
|
|
77716
|
+
_context27.next = 15;
|
|
77717
|
+
return _this37.$nextTick();
|
|
77624
77718
|
case 15:
|
|
77625
|
-
|
|
77719
|
+
_this37.saveBpmn(redirectTo, newNode.id);
|
|
77626
77720
|
case 16:
|
|
77627
77721
|
case "end":
|
|
77628
|
-
return
|
|
77722
|
+
return _context27.stop();
|
|
77629
77723
|
}
|
|
77630
|
-
},
|
|
77724
|
+
}, _callee27);
|
|
77631
77725
|
})));
|
|
77632
77726
|
case 2:
|
|
77633
77727
|
case "end":
|
|
77634
|
-
return
|
|
77728
|
+
return _context28.stop();
|
|
77635
77729
|
}
|
|
77636
|
-
},
|
|
77730
|
+
}, _callee28);
|
|
77637
77731
|
})));
|
|
77638
77732
|
},
|
|
77639
77733
|
replaceGenericFlow: function replaceGenericFlow(_ref15) {
|
|
77640
|
-
var
|
|
77734
|
+
var _this38 = this;
|
|
77641
77735
|
var actualFlow = _ref15.actualFlow,
|
|
77642
77736
|
genericFlow = _ref15.genericFlow,
|
|
77643
77737
|
targetNode = _ref15.targetNode;
|
|
77644
|
-
this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77645
|
-
return _regeneratorRuntime().wrap(function
|
|
77646
|
-
while (1) switch (
|
|
77738
|
+
this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
|
|
77739
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
77740
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
77647
77741
|
case 0:
|
|
77648
|
-
|
|
77649
|
-
return
|
|
77650
|
-
return _regeneratorRuntime().wrap(function
|
|
77651
|
-
while (1) switch (
|
|
77742
|
+
_context30.next = 2;
|
|
77743
|
+
return _this38.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
|
|
77744
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
77745
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
77652
77746
|
case 0:
|
|
77653
|
-
|
|
77654
|
-
return
|
|
77747
|
+
_context29.next = 2;
|
|
77748
|
+
return _this38.highlightNode(null);
|
|
77655
77749
|
case 2:
|
|
77656
|
-
|
|
77657
|
-
return
|
|
77750
|
+
_context29.next = 4;
|
|
77751
|
+
return _this38.$nextTick();
|
|
77658
77752
|
case 4:
|
|
77659
|
-
|
|
77753
|
+
_context29.next = 6;
|
|
77660
77754
|
return store.commit('removeNode', genericFlow);
|
|
77661
77755
|
case 6:
|
|
77662
|
-
|
|
77663
|
-
return
|
|
77756
|
+
_context29.next = 8;
|
|
77757
|
+
return _this38.$nextTick();
|
|
77664
77758
|
case 8:
|
|
77665
|
-
|
|
77666
|
-
return
|
|
77759
|
+
_context29.next = 10;
|
|
77760
|
+
return _this38.addNode(actualFlow, genericFlow.definition.id);
|
|
77667
77761
|
case 10:
|
|
77668
|
-
|
|
77669
|
-
return
|
|
77762
|
+
_context29.next = 12;
|
|
77763
|
+
return _this38.$nextTick();
|
|
77670
77764
|
case 12:
|
|
77671
|
-
|
|
77672
|
-
return
|
|
77765
|
+
_context29.next = 14;
|
|
77766
|
+
return _this38.highlightNode(targetNode);
|
|
77673
77767
|
case 14:
|
|
77674
77768
|
case "end":
|
|
77675
|
-
return
|
|
77769
|
+
return _context29.stop();
|
|
77676
77770
|
}
|
|
77677
|
-
},
|
|
77771
|
+
}, _callee29);
|
|
77678
77772
|
})));
|
|
77679
77773
|
case 2:
|
|
77680
77774
|
case "end":
|
|
77681
|
-
return
|
|
77775
|
+
return _context30.stop();
|
|
77682
77776
|
}
|
|
77683
|
-
},
|
|
77777
|
+
}, _callee30);
|
|
77684
77778
|
})));
|
|
77685
77779
|
},
|
|
77686
77780
|
performSingleUndoRedoTransaction: function performSingleUndoRedoTransaction(cb) {
|
|
77687
|
-
var
|
|
77688
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77689
|
-
return _regeneratorRuntime().wrap(function
|
|
77690
|
-
while (1) switch (
|
|
77781
|
+
var _this39 = this;
|
|
77782
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
|
|
77783
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
77784
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
77691
77785
|
case 0:
|
|
77692
77786
|
undoRedoStore.commit('disableSavingState');
|
|
77693
|
-
|
|
77787
|
+
_context31.next = 3;
|
|
77694
77788
|
return cb();
|
|
77695
77789
|
case 3:
|
|
77696
77790
|
undoRedoStore.commit('enableSavingState');
|
|
77697
|
-
|
|
77698
|
-
return
|
|
77791
|
+
_context31.next = 6;
|
|
77792
|
+
return _this39.pushToUndoStack();
|
|
77699
77793
|
case 6:
|
|
77700
77794
|
case "end":
|
|
77701
|
-
return
|
|
77795
|
+
return _context31.stop();
|
|
77702
77796
|
}
|
|
77703
|
-
},
|
|
77797
|
+
}, _callee31);
|
|
77704
77798
|
}))();
|
|
77705
77799
|
},
|
|
77706
77800
|
removeNodesFromLane: function removeNodesFromLane(node) {
|
|
@@ -77713,36 +77807,36 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77713
77807
|
pull_default()(containingLane.get('flowNodeRef'), node.definition);
|
|
77714
77808
|
},
|
|
77715
77809
|
removeNodesFromPool: function removeNodesFromPool(node) {
|
|
77716
|
-
var
|
|
77810
|
+
var _this40 = this;
|
|
77717
77811
|
if (node.type === 'processmaker-modeler-pool' && node.definition.processRef) {
|
|
77718
77812
|
if (node.definition.processRef.artifacts) {
|
|
77719
77813
|
node.definition.processRef.artifacts.forEach(function (artifact) {
|
|
77720
|
-
var nodeToRemove =
|
|
77814
|
+
var nodeToRemove = _this40.nodes.find(function (n) {
|
|
77721
77815
|
return n.definition === artifact;
|
|
77722
77816
|
});
|
|
77723
77817
|
if (nodeToRemove) {
|
|
77724
|
-
|
|
77818
|
+
_this40.removeNode(nodeToRemove);
|
|
77725
77819
|
}
|
|
77726
77820
|
});
|
|
77727
77821
|
}
|
|
77728
77822
|
if (node.definition.processRef.flowElements) {
|
|
77729
77823
|
node.definition.processRef.flowElements.forEach(function (flowElement) {
|
|
77730
|
-
var nodeToRemove =
|
|
77824
|
+
var nodeToRemove = _this40.nodes.find(function (n) {
|
|
77731
77825
|
return n.definition === flowElement;
|
|
77732
77826
|
});
|
|
77733
77827
|
if (nodeToRemove) {
|
|
77734
|
-
|
|
77828
|
+
_this40.removeNode(nodeToRemove);
|
|
77735
77829
|
}
|
|
77736
77830
|
});
|
|
77737
77831
|
}
|
|
77738
77832
|
var laneSets = node.definition.processRef.laneSets;
|
|
77739
77833
|
if (!!laneSets && laneSets.length > 0) {
|
|
77740
77834
|
laneSets[0].lanes.forEach(function (lane) {
|
|
77741
|
-
var nodeToRemove =
|
|
77835
|
+
var nodeToRemove = _this40.nodes.find(function (n) {
|
|
77742
77836
|
return n.definition === lane;
|
|
77743
77837
|
});
|
|
77744
77838
|
if (nodeToRemove) {
|
|
77745
|
-
|
|
77839
|
+
_this40.removeNode(nodeToRemove);
|
|
77746
77840
|
}
|
|
77747
77841
|
});
|
|
77748
77842
|
}
|
|
@@ -77770,13 +77864,13 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77770
77864
|
return shape.component != null;
|
|
77771
77865
|
},
|
|
77772
77866
|
setShapeStacking: function setShapeStacking(shape) {
|
|
77773
|
-
var
|
|
77867
|
+
var _this41 = this;
|
|
77774
77868
|
if (this.isRendering || !shape.component.node.isType('processmaker-modeler-pool') && shape === this.previouslyStackedShape) {
|
|
77775
77869
|
return;
|
|
77776
77870
|
}
|
|
77777
77871
|
this.previouslyStackedShape = shape;
|
|
77778
77872
|
this.paperManager.performAtomicAction(function () {
|
|
77779
|
-
return ensureShapeIsNotCovered(shape,
|
|
77873
|
+
return ensureShapeIsNotCovered(shape, _this41.graph);
|
|
77780
77874
|
});
|
|
77781
77875
|
},
|
|
77782
77876
|
showSavedNotification: function showSavedNotification() {
|
|
@@ -77810,49 +77904,49 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77810
77904
|
return false;
|
|
77811
77905
|
},
|
|
77812
77906
|
pointerDowInShape: function pointerDowInShape(event, element) {
|
|
77813
|
-
var
|
|
77814
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77907
|
+
var _this42 = this;
|
|
77908
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
|
|
77815
77909
|
var x, y, shapeView;
|
|
77816
|
-
return _regeneratorRuntime().wrap(function
|
|
77817
|
-
while (1) switch (
|
|
77910
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
77911
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
77818
77912
|
case 0:
|
|
77819
77913
|
x = event.clientX, y = event.clientY;
|
|
77820
|
-
shapeView =
|
|
77821
|
-
|
|
77822
|
-
|
|
77823
|
-
|
|
77824
|
-
|
|
77914
|
+
shapeView = _this42.paper.findViewByModel(element);
|
|
77915
|
+
_this42.isDragging = false;
|
|
77916
|
+
_this42.isSelecting = false;
|
|
77917
|
+
_this42.isIntoTheSelection = false;
|
|
77918
|
+
_this42.dragStart = {
|
|
77825
77919
|
x: x,
|
|
77826
77920
|
y: y
|
|
77827
77921
|
};
|
|
77828
77922
|
// Verify if is in the selection box
|
|
77829
|
-
if (!
|
|
77830
|
-
|
|
77923
|
+
if (!_this42.isPointInSelection(event)) {
|
|
77924
|
+
_context32.next = 10;
|
|
77831
77925
|
break;
|
|
77832
77926
|
}
|
|
77833
|
-
|
|
77834
|
-
|
|
77927
|
+
_this42.isIntoTheSelection = true;
|
|
77928
|
+
_context32.next = 15;
|
|
77835
77929
|
break;
|
|
77836
77930
|
case 10:
|
|
77837
77931
|
if (event.shiftKey) {
|
|
77838
|
-
|
|
77932
|
+
_context32.next = 15;
|
|
77839
77933
|
break;
|
|
77840
77934
|
}
|
|
77841
|
-
|
|
77842
|
-
return
|
|
77935
|
+
_context32.next = 13;
|
|
77936
|
+
return _this42.$refs.selector.selectElement(shapeView);
|
|
77843
77937
|
case 13:
|
|
77844
|
-
|
|
77845
|
-
return
|
|
77938
|
+
_context32.next = 15;
|
|
77939
|
+
return _this42.$nextTick();
|
|
77846
77940
|
case 15:
|
|
77847
|
-
|
|
77941
|
+
_this42.$refs.selector.startDrag({
|
|
77848
77942
|
clientX: event.clientX,
|
|
77849
77943
|
clientY: event.clientY
|
|
77850
77944
|
});
|
|
77851
77945
|
case 16:
|
|
77852
77946
|
case "end":
|
|
77853
|
-
return
|
|
77947
|
+
return _context32.stop();
|
|
77854
77948
|
}
|
|
77855
|
-
},
|
|
77949
|
+
}, _callee32);
|
|
77856
77950
|
}))();
|
|
77857
77951
|
},
|
|
77858
77952
|
pointerDownHandler: function pointerDownHandler(event) {
|
|
@@ -77973,7 +78067,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77973
78067
|
this.$emit('set-xml-manager', this.xmlManager);
|
|
77974
78068
|
},
|
|
77975
78069
|
mounted: function mounted() {
|
|
77976
|
-
var
|
|
78070
|
+
var _this43 = this;
|
|
77977
78071
|
store.commit('setReadOnly', this.readOnly);
|
|
77978
78072
|
this.graph = new external_jointjs_namespaceObject.dia.Graph();
|
|
77979
78073
|
store.commit('setGraph', this.graph);
|
|
@@ -77992,47 +78086,47 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77992
78086
|
store.commit('setPaper', this.paperManager.paper);
|
|
77993
78087
|
this.paperManager.addEventHandler('element:pointerclick', this.blurFocusedScreenBuilderElement, this);
|
|
77994
78088
|
this.paperManager.addEventHandler('blank:pointerdown', function (event, x, y) {
|
|
77995
|
-
if (
|
|
78089
|
+
if (_this43.isGrabbing) return;
|
|
77996
78090
|
if (store.getters.isReadOnly) {
|
|
77997
|
-
|
|
78091
|
+
_this43.isGrabbing = true;
|
|
77998
78092
|
}
|
|
77999
|
-
var scale =
|
|
78000
|
-
|
|
78093
|
+
var scale = _this43.paperManager.scale;
|
|
78094
|
+
_this43.canvasDragPosition = {
|
|
78001
78095
|
x: x * scale.sx,
|
|
78002
78096
|
y: y * scale.sy
|
|
78003
78097
|
};
|
|
78004
|
-
|
|
78005
|
-
|
|
78098
|
+
_this43.isOverShape = false;
|
|
78099
|
+
_this43.pointerDownHandler(event);
|
|
78006
78100
|
}, this);
|
|
78007
78101
|
this.paperManager.addEventHandler('cell:mouseover element:mouseover', function (_ref19) {
|
|
78008
78102
|
var shape = _ref19.model;
|
|
78009
|
-
if (
|
|
78103
|
+
if (_this43.isBpmnNode(shape) && shape.attr('body/cursor') !== 'default' && !_this43.isGrabbing) {
|
|
78010
78104
|
shape.attr('body/cursor', 'move');
|
|
78011
78105
|
}
|
|
78012
78106
|
// If the user is panning the Paper while hovering an element, ignore the default move cursor
|
|
78013
|
-
if (
|
|
78107
|
+
if (_this43.isGrabbing && _this43.isBpmnNode(shape)) {
|
|
78014
78108
|
shape.attr('body/cursor', 'grabbing');
|
|
78015
78109
|
}
|
|
78016
78110
|
});
|
|
78017
78111
|
this.paperManager.addEventHandler('blank:pointerup', function (event) {
|
|
78018
|
-
|
|
78019
|
-
|
|
78020
|
-
|
|
78021
|
-
|
|
78112
|
+
_this43.isGrabbing = false;
|
|
78113
|
+
_this43.canvasDragPosition = null;
|
|
78114
|
+
_this43.activeNode = null;
|
|
78115
|
+
_this43.pointerUpHandler(event);
|
|
78022
78116
|
}, this);
|
|
78023
78117
|
this.paperManager.addEventHandler('cell:pointerup', function (cellView, event) {
|
|
78024
|
-
|
|
78025
|
-
|
|
78026
|
-
|
|
78118
|
+
_this43.canvasDragPosition = null;
|
|
78119
|
+
_this43.activeNode = null;
|
|
78120
|
+
_this43.pointerUpHandler(event, cellView);
|
|
78027
78121
|
}, this);
|
|
78028
78122
|
this.$refs['paper-container'].addEventListener('mouseenter', function () {
|
|
78029
78123
|
store.commit('setClientLeftPaper', false);
|
|
78030
78124
|
});
|
|
78031
78125
|
this.$el.addEventListener('mousemove', function (event) {
|
|
78032
|
-
|
|
78126
|
+
_this43.pointerMoveHandler(event);
|
|
78033
78127
|
});
|
|
78034
78128
|
this.$refs['paper-container'].addEventListener('mouseleave', function () {
|
|
78035
|
-
|
|
78129
|
+
_this43.paperManager.removeEventHandler('blank:pointermove');
|
|
78036
78130
|
store.commit('setClientLeftPaper', true);
|
|
78037
78131
|
});
|
|
78038
78132
|
this.paperManager.addEventHandler('cell:pointerclick', function (cellView, evt, x, y) {
|
|
@@ -78043,44 +78137,44 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
78043
78137
|
});
|
|
78044
78138
|
this.paperManager.addEventHandler('cell:pointerclick', function (_ref20, event) {
|
|
78045
78139
|
var shape = _ref20.model;
|
|
78046
|
-
if (!
|
|
78140
|
+
if (!_this43.isBpmnNode(shape)) {
|
|
78047
78141
|
return;
|
|
78048
78142
|
}
|
|
78049
78143
|
|
|
78050
78144
|
// ignore click event if the user is Grabbing the paper
|
|
78051
|
-
if (
|
|
78145
|
+
if (_this43.isGrabbing) return;
|
|
78052
78146
|
shape.component.$emit('click', event);
|
|
78053
|
-
|
|
78147
|
+
_this43.$emit('click', {
|
|
78054
78148
|
event: event,
|
|
78055
|
-
node:
|
|
78149
|
+
node: _this43.highlightedNode.definition
|
|
78056
78150
|
});
|
|
78057
78151
|
});
|
|
78058
78152
|
this.paperManager.addEventHandler('cell:pointerdown', function (_ref21, event) {
|
|
78059
78153
|
var shape = _ref21.model;
|
|
78060
|
-
if (!
|
|
78154
|
+
if (!_this43.isBpmnNode(shape)) {
|
|
78061
78155
|
return;
|
|
78062
78156
|
}
|
|
78063
78157
|
// If the user is pressing Space (grabbing) and clicking on a Cell, return
|
|
78064
|
-
if (
|
|
78158
|
+
if (_this43.isGrabbing) {
|
|
78065
78159
|
return;
|
|
78066
78160
|
}
|
|
78067
|
-
|
|
78068
|
-
|
|
78069
|
-
|
|
78070
|
-
|
|
78161
|
+
_this43.setShapeStacking(shape);
|
|
78162
|
+
_this43.activeNode = shape.component.node;
|
|
78163
|
+
_this43.isOverShape = true;
|
|
78164
|
+
_this43.pointerDowInShape(event, shape);
|
|
78071
78165
|
});
|
|
78072
78166
|
// If the user is grabbing the paper while he clicked in a cell, move the paper and not the cell
|
|
78073
78167
|
this.paperManager.addEventHandler('cell:pointermove', function (_, event, x, y) {
|
|
78074
|
-
if (
|
|
78075
|
-
if (!
|
|
78076
|
-
var scale =
|
|
78077
|
-
|
|
78168
|
+
if (_this43.isGrabbing) {
|
|
78169
|
+
if (!_this43.canvasDragPosition) {
|
|
78170
|
+
var scale = _this43.paperManager.scale;
|
|
78171
|
+
_this43.canvasDragPosition = {
|
|
78078
78172
|
x: x * scale.sx,
|
|
78079
78173
|
y: y * scale.sy
|
|
78080
78174
|
};
|
|
78081
78175
|
}
|
|
78082
|
-
if (
|
|
78083
|
-
|
|
78176
|
+
if (_this43.canvasDragPosition && !_this43.clientLeftPaper) {
|
|
78177
|
+
_this43.paperManager.translate(event.offsetX - _this43.canvasDragPosition.x, event.offsetY - _this43.canvasDragPosition.y);
|
|
78084
78178
|
}
|
|
78085
78179
|
}
|
|
78086
78180
|
});
|
|
@@ -78091,28 +78185,29 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
78091
78185
|
modeler: this,
|
|
78092
78186
|
registerMenuAction: this.registerMenuAction,
|
|
78093
78187
|
loadXML: function () {
|
|
78094
|
-
var _loadXML = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
78188
|
+
var _loadXML = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(xml) {
|
|
78095
78189
|
var multiplayer;
|
|
78096
|
-
return _regeneratorRuntime().wrap(function
|
|
78097
|
-
while (1) switch (
|
|
78190
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
78191
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
78098
78192
|
case 0:
|
|
78099
|
-
|
|
78100
|
-
return
|
|
78193
|
+
_context33.next = 2;
|
|
78194
|
+
return _this43.loadXML(xml);
|
|
78101
78195
|
case 2:
|
|
78102
|
-
|
|
78196
|
+
_context33.next = 4;
|
|
78103
78197
|
return undoRedoStore.dispatch('pushState', xml);
|
|
78104
78198
|
case 4:
|
|
78105
78199
|
try {
|
|
78106
|
-
multiplayer = new Multiplayer(
|
|
78200
|
+
multiplayer = new Multiplayer(_this43);
|
|
78107
78201
|
multiplayer.init();
|
|
78202
|
+
_this43.multiplayer = multiplayer;
|
|
78108
78203
|
} catch (error) {
|
|
78109
78204
|
console.warn('Could not initialize multiplayer', error);
|
|
78110
78205
|
}
|
|
78111
78206
|
case 5:
|
|
78112
78207
|
case "end":
|
|
78113
|
-
return
|
|
78208
|
+
return _context33.stop();
|
|
78114
78209
|
}
|
|
78115
|
-
},
|
|
78210
|
+
}, _callee33);
|
|
78116
78211
|
}));
|
|
78117
78212
|
function loadXML(_x) {
|
|
78118
78213
|
return _loadXML.apply(this, arguments);
|
|
@@ -78120,18 +78215,18 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
78120
78215
|
return loadXML;
|
|
78121
78216
|
}(),
|
|
78122
78217
|
addWarnings: function addWarnings(warnings) {
|
|
78123
|
-
return
|
|
78218
|
+
return _this43.$emit('warnings', warnings);
|
|
78124
78219
|
},
|
|
78125
78220
|
addBreadcrumbs: function addBreadcrumbs(breadcrumbs) {
|
|
78126
|
-
return
|
|
78221
|
+
return _this43.breadcrumbData.push(breadcrumbs);
|
|
78127
78222
|
}
|
|
78128
78223
|
});
|
|
78129
78224
|
this.$root.$on('replace-ai-node', function (data) {
|
|
78130
|
-
|
|
78225
|
+
_this43.replaceAiNode(data);
|
|
78131
78226
|
});
|
|
78132
78227
|
window.ProcessMaker.EventBus.$on('save-changes', function (redirectUrl) {
|
|
78133
78228
|
if (redirectUrl) {
|
|
78134
|
-
|
|
78229
|
+
_this43.redirect(redirectUrl);
|
|
78135
78230
|
}
|
|
78136
78231
|
});
|
|
78137
78232
|
}
|
|
@@ -78153,8 +78248,8 @@ var modelervue_type_style_index_0_prod_lang_scss_ = __webpack_require__(88242);
|
|
|
78153
78248
|
|
|
78154
78249
|
var Modeler_component = normalizeComponent(
|
|
78155
78250
|
modeler_Modelervue_type_script_lang_js_,
|
|
78156
|
-
|
|
78157
|
-
|
|
78251
|
+
Modelervue_type_template_id_5fd6d55f_render,
|
|
78252
|
+
Modelervue_type_template_id_5fd6d55f_staticRenderFns,
|
|
78158
78253
|
false,
|
|
78159
78254
|
null,
|
|
78160
78255
|
null,
|