@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.umd.js
CHANGED
|
@@ -47786,10 +47786,10 @@ var ValidationStatus_component = normalizeComponent(
|
|
|
47786
47786
|
)
|
|
47787
47787
|
|
|
47788
47788
|
/* harmony default export */ var ValidationStatus = (ValidationStatus_component.exports);
|
|
47789
|
-
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.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=
|
|
47789
|
+
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.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&
|
|
47790
47790
|
|
|
47791
47791
|
|
|
47792
|
-
var
|
|
47792
|
+
var Modelervue_type_template_id_5fd6d55f_render = function render() {
|
|
47793
47793
|
var _vm = this,
|
|
47794
47794
|
_c = _vm._self._c;
|
|
47795
47795
|
return _c('span', {
|
|
@@ -48008,9 +48008,9 @@ var Modelervue_type_template_id_83a477c8_render = function render() {
|
|
|
48008
48008
|
}
|
|
48009
48009
|
}) : _vm._e()], 2)], 1);
|
|
48010
48010
|
};
|
|
48011
|
-
var
|
|
48011
|
+
var Modelervue_type_template_id_5fd6d55f_staticRenderFns = [];
|
|
48012
48012
|
|
|
48013
|
-
;// CONCATENATED MODULE: ./src/components/modeler/Modeler.vue?vue&type=template&id=
|
|
48013
|
+
;// CONCATENATED MODULE: ./src/components/modeler/Modeler.vue?vue&type=template&id=5fd6d55f&
|
|
48014
48014
|
|
|
48015
48015
|
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.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&
|
|
48016
48016
|
var boundaryEventvue_type_template_id_2979ecac_render = function render() {
|
|
@@ -75679,6 +75679,30 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75679
75679
|
_this.modeler.removePlayer(payload.clientId);
|
|
75680
75680
|
_this.modeler.enableMultiplayer(payload.isMultiplayer);
|
|
75681
75681
|
});
|
|
75682
|
+
this.clientIO.on('requestProcess', function (payload) {
|
|
75683
|
+
var firstClient = payload.firstClient,
|
|
75684
|
+
clientId = payload.clientId;
|
|
75685
|
+
|
|
75686
|
+
// Check if the current client is the first client
|
|
75687
|
+
if (firstClient.id === _this.clientIO.id) {
|
|
75688
|
+
// Get the process definition
|
|
75689
|
+
var nodes = _this.modeler.nodes.map(function (node) {
|
|
75690
|
+
return _this.modeler.multiplayerHook(node, false, true);
|
|
75691
|
+
});
|
|
75692
|
+
nodes.forEach(function (node) {
|
|
75693
|
+
var yMapNested = new YMap();
|
|
75694
|
+
_this.doTransact(yMapNested, node);
|
|
75695
|
+
_this.yArray.push([yMapNested]);
|
|
75696
|
+
// Encode the state as an update and send it to the server
|
|
75697
|
+
var stateUpdate = encodeStateAsUpdate(_this.yDoc);
|
|
75698
|
+
// Send the update to the web socket server
|
|
75699
|
+
_this.clientIO.emit('createElement', {
|
|
75700
|
+
updateDoc: stateUpdate,
|
|
75701
|
+
clientId: clientId
|
|
75702
|
+
});
|
|
75703
|
+
});
|
|
75704
|
+
}
|
|
75705
|
+
});
|
|
75682
75706
|
|
|
75683
75707
|
// Listen for updates when a new element is added
|
|
75684
75708
|
this.clientIO.on('createElement', /*#__PURE__*/function () {
|
|
@@ -75702,6 +75726,32 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75702
75726
|
};
|
|
75703
75727
|
}());
|
|
75704
75728
|
|
|
75729
|
+
// Listen for updates when a new element is requested
|
|
75730
|
+
this.clientIO.on('createRequestedElement', /*#__PURE__*/function () {
|
|
75731
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(payload) {
|
|
75732
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
75733
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
75734
|
+
case 0:
|
|
75735
|
+
if (!(payload.clientId === _this.clientIO.id)) {
|
|
75736
|
+
_context2.next = 4;
|
|
75737
|
+
break;
|
|
75738
|
+
}
|
|
75739
|
+
_context2.next = 3;
|
|
75740
|
+
return _this.createRemoteShape(payload.changes);
|
|
75741
|
+
case 3:
|
|
75742
|
+
// Add the new element to the shared array
|
|
75743
|
+
applyUpdate(_this.yDoc, new Uint8Array(payload.updateDoc));
|
|
75744
|
+
case 4:
|
|
75745
|
+
case "end":
|
|
75746
|
+
return _context2.stop();
|
|
75747
|
+
}
|
|
75748
|
+
}, _callee2);
|
|
75749
|
+
}));
|
|
75750
|
+
return function (_x2) {
|
|
75751
|
+
return _ref2.apply(this, arguments);
|
|
75752
|
+
};
|
|
75753
|
+
}());
|
|
75754
|
+
|
|
75705
75755
|
// Listen for updates when an element is removed
|
|
75706
75756
|
this.clientIO.on('removeElement', function (payload) {
|
|
75707
75757
|
payload.deletedNodes.forEach(function (nodeId) {
|
|
@@ -75741,9 +75791,9 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75741
75791
|
window.ProcessMaker.EventBus.$on('multiplayer-updateNodes', function (data) {
|
|
75742
75792
|
_this.updateNodes(data);
|
|
75743
75793
|
});
|
|
75744
|
-
window.ProcessMaker.EventBus.$on('multiplayer-replaceNode', function (
|
|
75745
|
-
var nodeData =
|
|
75746
|
-
newControl =
|
|
75794
|
+
window.ProcessMaker.EventBus.$on('multiplayer-replaceNode', function (_ref3) {
|
|
75795
|
+
var nodeData = _ref3.nodeData,
|
|
75796
|
+
newControl = _ref3.newControl;
|
|
75747
75797
|
_this.replaceNode(nodeData, newControl);
|
|
75748
75798
|
});
|
|
75749
75799
|
window.ProcessMaker.EventBus.$on('multiplayer-addFlow', function (data) {
|
|
@@ -75763,7 +75813,9 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75763
75813
|
// Encode the state as an update and send it to the server
|
|
75764
75814
|
var stateUpdate = encodeStateAsUpdate(this.yDoc);
|
|
75765
75815
|
// Send the update to the web socket server
|
|
75766
|
-
this.clientIO.emit('createElement',
|
|
75816
|
+
this.clientIO.emit('createElement', {
|
|
75817
|
+
updateDoc: stateUpdate
|
|
75818
|
+
});
|
|
75767
75819
|
}
|
|
75768
75820
|
}, {
|
|
75769
75821
|
key: "createShape",
|
|
@@ -75926,17 +75978,17 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75926
75978
|
}, {
|
|
75927
75979
|
key: "updateShapes",
|
|
75928
75980
|
value: function () {
|
|
75929
|
-
var _updateShapes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
75981
|
+
var _updateShapes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {
|
|
75930
75982
|
var _this4 = this;
|
|
75931
75983
|
var paper, element, newPool, sourceElem, targetElem, waypoint, startWaypoint, endWaypoint, newWaypoint, node;
|
|
75932
|
-
return _regeneratorRuntime().wrap(function
|
|
75933
|
-
while (1) switch (
|
|
75984
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
75985
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
75934
75986
|
case 0:
|
|
75935
75987
|
paper = this.modeler.paper;
|
|
75936
75988
|
element = this.modeler.getElementByNodeId(data.id);
|
|
75937
75989
|
newPool = this.modeler.getElementByNodeId(data.poolId);
|
|
75938
75990
|
if (!this.modeler.flowTypes.includes(data.type)) {
|
|
75939
|
-
|
|
75991
|
+
_context3.next = 15;
|
|
75940
75992
|
break;
|
|
75941
75993
|
}
|
|
75942
75994
|
// Update the element's waypoints
|
|
@@ -75970,7 +76022,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75970
76022
|
name: 'boundary'
|
|
75971
76023
|
}
|
|
75972
76024
|
});
|
|
75973
|
-
|
|
76025
|
+
_context3.next = 26;
|
|
75974
76026
|
break;
|
|
75975
76027
|
case 15:
|
|
75976
76028
|
// Update the element's position attribute
|
|
@@ -75988,13 +76040,13 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75988
76040
|
});
|
|
75989
76041
|
|
|
75990
76042
|
// Trigger a rendering of the element on the paper
|
|
75991
|
-
|
|
76043
|
+
_context3.next = 21;
|
|
75992
76044
|
return paper.findViewByModel(element).update();
|
|
75993
76045
|
case 21:
|
|
75994
|
-
|
|
76046
|
+
_context3.next = 23;
|
|
75995
76047
|
return element.component.$nextTick();
|
|
75996
76048
|
case 23:
|
|
75997
|
-
|
|
76049
|
+
_context3.next = 25;
|
|
75998
76050
|
return this.modeler.paperManager.awaitScheduledUpdates();
|
|
75999
76051
|
case 25:
|
|
76000
76052
|
if (newPool && element.component.node.pool && element.component.node.pool.component.id !== data.poolId) {
|
|
@@ -76002,11 +76054,11 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
76002
76054
|
}
|
|
76003
76055
|
case 26:
|
|
76004
76056
|
case "end":
|
|
76005
|
-
return
|
|
76057
|
+
return _context3.stop();
|
|
76006
76058
|
}
|
|
76007
|
-
},
|
|
76059
|
+
}, _callee3, this);
|
|
76008
76060
|
}));
|
|
76009
|
-
function updateShapes(
|
|
76061
|
+
function updateShapes(_x3) {
|
|
76010
76062
|
return _updateShapes.apply(this, arguments);
|
|
76011
76063
|
}
|
|
76012
76064
|
return updateShapes;
|
|
@@ -76020,7 +76072,9 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
76020
76072
|
// Encode the state as an update and send it to the server
|
|
76021
76073
|
var stateUpdate = encodeStateAsUpdate(this.yDoc);
|
|
76022
76074
|
// Send the update to the web socket server
|
|
76023
|
-
this.clientIO.emit('createElement',
|
|
76075
|
+
this.clientIO.emit('createElement', {
|
|
76076
|
+
updateDoc: stateUpdate
|
|
76077
|
+
});
|
|
76024
76078
|
_classPrivateFieldGet(this, _nodeIdGenerator).updateCounters();
|
|
76025
76079
|
}
|
|
76026
76080
|
}, {
|
|
@@ -76045,7 +76099,9 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
76045
76099
|
_this5.doTransact(yMapNested, data);
|
|
76046
76100
|
_this5.yArray.push([yMapNested]);
|
|
76047
76101
|
var stateUpdate = encodeStateAsUpdate(_this5.yDoc);
|
|
76048
|
-
_this5.clientIO.emit('createElement',
|
|
76102
|
+
_this5.clientIO.emit('createElement', {
|
|
76103
|
+
updateDoc: stateUpdate
|
|
76104
|
+
});
|
|
76049
76105
|
});
|
|
76050
76106
|
});
|
|
76051
76107
|
}
|
|
@@ -77066,7 +77122,11 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77066
77122
|
while (1) switch (_context8.prev = _context8.next) {
|
|
77067
77123
|
case 0:
|
|
77068
77124
|
node = _this21.createNode(type, definition, diagram);
|
|
77069
|
-
|
|
77125
|
+
if (!_this21.isMultiplayer) {
|
|
77126
|
+
store.commit('addNode', node);
|
|
77127
|
+
} else {
|
|
77128
|
+
_this21.loadNodeForMultiplayer(node);
|
|
77129
|
+
}
|
|
77070
77130
|
case 2:
|
|
77071
77131
|
case "end":
|
|
77072
77132
|
return _context8.stop();
|
|
@@ -77074,6 +77134,39 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77074
77134
|
}, _callee8);
|
|
77075
77135
|
}))();
|
|
77076
77136
|
},
|
|
77137
|
+
loadNodeForMultiplayer: function loadNodeForMultiplayer(node) {
|
|
77138
|
+
var _this22 = this;
|
|
77139
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
77140
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
77141
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
77142
|
+
case 0:
|
|
77143
|
+
if (!(node.type === 'processmaker-modeler-lane')) {
|
|
77144
|
+
_context9.next = 10;
|
|
77145
|
+
break;
|
|
77146
|
+
}
|
|
77147
|
+
_context9.next = 3;
|
|
77148
|
+
return _this22.addNode(node, node.definition.id, true);
|
|
77149
|
+
case 3:
|
|
77150
|
+
_this22.nodeIdGenerator.updateCounters();
|
|
77151
|
+
_context9.next = 6;
|
|
77152
|
+
return _this22.$nextTick();
|
|
77153
|
+
case 6:
|
|
77154
|
+
_context9.next = 8;
|
|
77155
|
+
return _this22.paperManager.awaitScheduledUpdates();
|
|
77156
|
+
case 8:
|
|
77157
|
+
window.ProcessMaker.EventBus.$emit('multiplayer-addLanes', [node]);
|
|
77158
|
+
return _context9.abrupt("return");
|
|
77159
|
+
case 10:
|
|
77160
|
+
_this22.multiplayerHook(node, false);
|
|
77161
|
+
store.commit('addNode', node);
|
|
77162
|
+
_this22.poolTarget = null;
|
|
77163
|
+
case 13:
|
|
77164
|
+
case "end":
|
|
77165
|
+
return _context9.stop();
|
|
77166
|
+
}
|
|
77167
|
+
}, _callee9);
|
|
77168
|
+
}))();
|
|
77169
|
+
},
|
|
77077
77170
|
createNode: function createNode(type, definition, diagram) {
|
|
77078
77171
|
if (Node.isTimerType(type)) {
|
|
77079
77172
|
return new TimerEventNode(type, definition, diagram);
|
|
@@ -77092,95 +77185,95 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77092
77185
|
return hasSource && hasTarget;
|
|
77093
77186
|
},
|
|
77094
77187
|
waitForCursorToChange: function waitForCursorToChange() {
|
|
77095
|
-
var
|
|
77096
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77188
|
+
var _this23 = this;
|
|
77189
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
77097
77190
|
var cursorWaitTime;
|
|
77098
|
-
return _regeneratorRuntime().wrap(function
|
|
77099
|
-
while (1) switch (
|
|
77191
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
77192
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
77100
77193
|
case 0:
|
|
77101
77194
|
cursorWaitTime = 300;
|
|
77102
|
-
|
|
77103
|
-
return
|
|
77195
|
+
_context10.next = 3;
|
|
77196
|
+
return _this23.$nextTick();
|
|
77104
77197
|
case 3:
|
|
77105
|
-
return
|
|
77198
|
+
return _context10.abrupt("return", new Promise(function (resolve) {
|
|
77106
77199
|
return setTimeout(resolve, cursorWaitTime);
|
|
77107
77200
|
}));
|
|
77108
77201
|
case 4:
|
|
77109
77202
|
case "end":
|
|
77110
|
-
return
|
|
77203
|
+
return _context10.stop();
|
|
77111
77204
|
}
|
|
77112
|
-
},
|
|
77205
|
+
}, _callee10);
|
|
77113
77206
|
}))();
|
|
77114
77207
|
},
|
|
77115
77208
|
renderPaper: function renderPaper() {
|
|
77116
|
-
var
|
|
77117
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77118
|
-
return _regeneratorRuntime().wrap(function
|
|
77119
|
-
while (1) switch (
|
|
77209
|
+
var _this24 = this;
|
|
77210
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
77211
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
77212
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
77120
77213
|
case 0:
|
|
77121
|
-
|
|
77122
|
-
|
|
77123
|
-
return
|
|
77124
|
-
return _regeneratorRuntime().wrap(function
|
|
77125
|
-
while (1) switch (
|
|
77214
|
+
_this24.isRendering = true;
|
|
77215
|
+
_context12.next = 3;
|
|
77216
|
+
return _this24.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
77217
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
77218
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
77126
77219
|
case 0:
|
|
77127
|
-
|
|
77128
|
-
return
|
|
77220
|
+
_context11.next = 2;
|
|
77221
|
+
return _this24.waitForCursorToChange();
|
|
77129
77222
|
case 2:
|
|
77130
|
-
|
|
77131
|
-
|
|
77132
|
-
|
|
77223
|
+
_this24.parse();
|
|
77224
|
+
_this24.addPools();
|
|
77225
|
+
_this24.setUpDiagram();
|
|
77133
77226
|
case 5:
|
|
77134
77227
|
case "end":
|
|
77135
|
-
return
|
|
77228
|
+
return _context11.stop();
|
|
77136
77229
|
}
|
|
77137
|
-
},
|
|
77230
|
+
}, _callee11);
|
|
77138
77231
|
})));
|
|
77139
77232
|
case 3:
|
|
77140
|
-
|
|
77141
|
-
return
|
|
77233
|
+
_context12.next = 5;
|
|
77234
|
+
return _this24.paperManager.awaitScheduledUpdates();
|
|
77142
77235
|
case 5:
|
|
77143
|
-
|
|
77144
|
-
|
|
77236
|
+
_this24.isRendering = false;
|
|
77237
|
+
_this24.$emit('parsed');
|
|
77145
77238
|
case 7:
|
|
77146
77239
|
case "end":
|
|
77147
|
-
return
|
|
77240
|
+
return _context12.stop();
|
|
77148
77241
|
}
|
|
77149
|
-
},
|
|
77242
|
+
}, _callee12);
|
|
77150
77243
|
}))();
|
|
77151
77244
|
},
|
|
77152
77245
|
loadXML: function loadXML() {
|
|
77153
77246
|
var _arguments3 = arguments,
|
|
77154
|
-
|
|
77155
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77247
|
+
_this25 = this;
|
|
77248
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
77156
77249
|
var xml, emitChangeEvent;
|
|
77157
|
-
return _regeneratorRuntime().wrap(function
|
|
77158
|
-
while (1) switch (
|
|
77250
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
77251
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
77159
77252
|
case 0:
|
|
77160
77253
|
xml = _arguments3.length > 0 && _arguments3[0] !== undefined ? _arguments3[0] : null;
|
|
77161
77254
|
emitChangeEvent = false;
|
|
77162
77255
|
if (xml === null) {
|
|
77163
|
-
xml =
|
|
77256
|
+
xml = _this25.currentXML;
|
|
77164
77257
|
emitChangeEvent = true;
|
|
77165
77258
|
}
|
|
77166
|
-
|
|
77167
|
-
return
|
|
77259
|
+
_context13.next = 5;
|
|
77260
|
+
return _this25.xmlManager.getDefinitionsFromXml(xml);
|
|
77168
77261
|
case 5:
|
|
77169
|
-
|
|
77170
|
-
|
|
77171
|
-
|
|
77262
|
+
_this25.definitions = _context13.sent;
|
|
77263
|
+
_this25.xmlManager.definitions = _this25.definitions;
|
|
77264
|
+
_this25.nodeIdGenerator = getNodeIdGenerator(_this25.definitions);
|
|
77172
77265
|
store.commit('clearNodes');
|
|
77173
|
-
|
|
77174
|
-
return
|
|
77266
|
+
_context13.next = 11;
|
|
77267
|
+
return _this25.renderPaper();
|
|
77175
77268
|
case 11:
|
|
77176
77269
|
if (emitChangeEvent) {
|
|
77177
77270
|
window.ProcessMaker.EventBus.$emit('modeler-change');
|
|
77178
77271
|
}
|
|
77179
77272
|
case 12:
|
|
77180
77273
|
case "end":
|
|
77181
|
-
return
|
|
77274
|
+
return _context13.stop();
|
|
77182
77275
|
}
|
|
77183
|
-
},
|
|
77276
|
+
}, _callee13);
|
|
77184
77277
|
}))();
|
|
77185
77278
|
},
|
|
77186
77279
|
getBoundaryEvents: function getBoundaryEvents(process) {
|
|
@@ -77204,13 +77297,13 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77204
77297
|
return boundaryEvent;
|
|
77205
77298
|
},
|
|
77206
77299
|
ensureCancelActivityIsAddedToBoundaryEvents: function ensureCancelActivityIsAddedToBoundaryEvents(process) {
|
|
77207
|
-
var
|
|
77300
|
+
var _this26 = this;
|
|
77208
77301
|
this.getBoundaryEvents(process).forEach(function (definition) {
|
|
77209
|
-
var boundaryEvent =
|
|
77302
|
+
var boundaryEvent = _this26.createBoundaryEvent(definition);
|
|
77210
77303
|
definition.get('outgoing').forEach(function (outgoing) {
|
|
77211
77304
|
return outgoing.set('sourceRef', boundaryEvent);
|
|
77212
77305
|
});
|
|
77213
|
-
|
|
77306
|
+
_this26.replaceDefinition(definition, boundaryEvent, process);
|
|
77214
77307
|
});
|
|
77215
77308
|
},
|
|
77216
77309
|
replaceDefinition: function replaceDefinition(definition, boundaryEvent, process) {
|
|
@@ -77236,82 +77329,82 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77236
77329
|
});
|
|
77237
77330
|
},
|
|
77238
77331
|
addRemoteNode: function addRemoteNode(data) {
|
|
77239
|
-
var
|
|
77240
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77332
|
+
var _this27 = this;
|
|
77333
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
77241
77334
|
var definition, diagram, newNode;
|
|
77242
|
-
return _regeneratorRuntime().wrap(function
|
|
77243
|
-
while (1) switch (
|
|
77335
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
77336
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
77244
77337
|
case 0:
|
|
77245
|
-
definition =
|
|
77246
|
-
diagram =
|
|
77338
|
+
definition = _this27.nodeRegistry[data.type].definition(_this27.moddle, _this27.$t);
|
|
77339
|
+
diagram = _this27.nodeRegistry[data.type].diagram(_this27.moddle);
|
|
77247
77340
|
diagram.bounds.x = data.x;
|
|
77248
77341
|
diagram.bounds.y = data.y;
|
|
77249
|
-
newNode =
|
|
77250
|
-
|
|
77251
|
-
return
|
|
77342
|
+
newNode = _this27.createNode(data.type, definition, diagram);
|
|
77343
|
+
_context14.next = 7;
|
|
77344
|
+
return _this27.addNode(newNode, data.id, true);
|
|
77252
77345
|
case 7:
|
|
77253
|
-
|
|
77254
|
-
return
|
|
77346
|
+
_context14.next = 9;
|
|
77347
|
+
return _this27.$nextTick();
|
|
77255
77348
|
case 9:
|
|
77256
|
-
|
|
77257
|
-
return
|
|
77349
|
+
_context14.next = 11;
|
|
77350
|
+
return _this27.paperManager.awaitScheduledUpdates();
|
|
77258
77351
|
case 11:
|
|
77259
|
-
if (
|
|
77260
|
-
|
|
77352
|
+
if (_this27.autoValidate) {
|
|
77353
|
+
_this27.validateBpmnDiagram();
|
|
77261
77354
|
}
|
|
77262
77355
|
case 12:
|
|
77263
77356
|
case "end":
|
|
77264
|
-
return
|
|
77357
|
+
return _context14.stop();
|
|
77265
77358
|
}
|
|
77266
|
-
},
|
|
77359
|
+
}, _callee14);
|
|
77267
77360
|
}))();
|
|
77268
77361
|
},
|
|
77269
77362
|
handleDrop: function handleDrop(data) {
|
|
77270
|
-
var
|
|
77271
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77272
|
-
var clientX, clientY, control, nodeThatWillBeReplaced, definition, diagram,
|
|
77273
|
-
return _regeneratorRuntime().wrap(function
|
|
77274
|
-
while (1) switch (
|
|
77363
|
+
var _this28 = this;
|
|
77364
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
77365
|
+
var clientX, clientY, control, nodeThatWillBeReplaced, definition, diagram, _this28$paperManager$, x, y, newNode, nodeMigrator;
|
|
77366
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
77367
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
77275
77368
|
case 0:
|
|
77276
77369
|
clientX = data.clientX, clientY = data.clientY, control = data.control, nodeThatWillBeReplaced = data.nodeThatWillBeReplaced;
|
|
77277
|
-
|
|
77370
|
+
_this28.validateDropTarget({
|
|
77278
77371
|
clientX: clientX,
|
|
77279
77372
|
clientY: clientY,
|
|
77280
77373
|
control: control
|
|
77281
77374
|
});
|
|
77282
|
-
if (
|
|
77283
|
-
|
|
77375
|
+
if (_this28.allowDrop) {
|
|
77376
|
+
_context15.next = 4;
|
|
77284
77377
|
break;
|
|
77285
77378
|
}
|
|
77286
|
-
return
|
|
77379
|
+
return _context15.abrupt("return");
|
|
77287
77380
|
case 4:
|
|
77288
|
-
definition =
|
|
77289
|
-
diagram =
|
|
77290
|
-
|
|
77381
|
+
definition = _this28.nodeRegistry[control.type].definition(_this28.moddle, _this28.$t);
|
|
77382
|
+
diagram = _this28.nodeRegistry[control.type].diagram(_this28.moddle);
|
|
77383
|
+
_this28$paperManager$ = _this28.paperManager.clientToGridPoint(clientX, clientY), x = _this28$paperManager$.x, y = _this28$paperManager$.y;
|
|
77291
77384
|
diagram.bounds.x = x;
|
|
77292
77385
|
diagram.bounds.y = y;
|
|
77293
|
-
newNode =
|
|
77386
|
+
newNode = _this28.createNode(control.type, definition, diagram);
|
|
77294
77387
|
if (newNode.isBpmnType('bpmn:BoundaryEvent')) {
|
|
77295
|
-
|
|
77388
|
+
_this28.setShapeCenterUnderCursor(diagram);
|
|
77296
77389
|
}
|
|
77297
|
-
|
|
77298
|
-
|
|
77299
|
-
return
|
|
77390
|
+
_this28.highlightNode(newNode);
|
|
77391
|
+
_context15.next = 14;
|
|
77392
|
+
return _this28.addNode(newNode);
|
|
77300
77393
|
case 14:
|
|
77301
77394
|
if (nodeThatWillBeReplaced) {
|
|
77302
|
-
|
|
77395
|
+
_context15.next = 16;
|
|
77303
77396
|
break;
|
|
77304
77397
|
}
|
|
77305
|
-
return
|
|
77398
|
+
return _context15.abrupt("return");
|
|
77306
77399
|
case 16:
|
|
77307
|
-
nodeMigrator = new NodeMigrator(nodeThatWillBeReplaced, definition,
|
|
77400
|
+
nodeMigrator = new NodeMigrator(nodeThatWillBeReplaced, definition, _this28.graph, newNode, _this28.processes, _this28.collaboration);
|
|
77308
77401
|
nodeMigrator.migrate();
|
|
77309
|
-
return
|
|
77402
|
+
return _context15.abrupt("return", newNode);
|
|
77310
77403
|
case 19:
|
|
77311
77404
|
case "end":
|
|
77312
|
-
return
|
|
77405
|
+
return _context15.stop();
|
|
77313
77406
|
}
|
|
77314
|
-
},
|
|
77407
|
+
}, _callee15);
|
|
77315
77408
|
}))();
|
|
77316
77409
|
},
|
|
77317
77410
|
setShapeCenterUnderCursor: function setShapeCenterUnderCursor(diagram) {
|
|
@@ -77319,32 +77412,33 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77319
77412
|
diagram.bounds.y -= diagram.bounds.height / 2;
|
|
77320
77413
|
},
|
|
77321
77414
|
selectNewNode: function selectNewNode(node) {
|
|
77322
|
-
var
|
|
77323
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77415
|
+
var _this29 = this;
|
|
77416
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
77324
77417
|
var newNodeComponent, view;
|
|
77325
|
-
return _regeneratorRuntime().wrap(function
|
|
77326
|
-
while (1) switch (
|
|
77418
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
77419
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
77327
77420
|
case 0:
|
|
77328
|
-
|
|
77329
|
-
return
|
|
77421
|
+
_context16.next = 2;
|
|
77422
|
+
return _this29.$nextTick();
|
|
77330
77423
|
case 2:
|
|
77331
|
-
|
|
77332
|
-
return
|
|
77424
|
+
_context16.next = 4;
|
|
77425
|
+
return _this29.paperManager.awaitScheduledUpdates();
|
|
77333
77426
|
case 4:
|
|
77334
|
-
newNodeComponent =
|
|
77427
|
+
newNodeComponent = _this29.$refs.nodeComponent.find(function (component) {
|
|
77335
77428
|
return component.node === node;
|
|
77336
77429
|
});
|
|
77337
77430
|
view = newNodeComponent.shapeView;
|
|
77338
|
-
|
|
77339
|
-
return
|
|
77431
|
+
_context16.next = 8;
|
|
77432
|
+
return _this29.$refs.selector.selectElement(view);
|
|
77340
77433
|
case 8:
|
|
77341
77434
|
case "end":
|
|
77342
|
-
return
|
|
77435
|
+
return _context16.stop();
|
|
77343
77436
|
}
|
|
77344
|
-
},
|
|
77437
|
+
}, _callee16);
|
|
77345
77438
|
}))();
|
|
77346
77439
|
},
|
|
77347
77440
|
multiplayerHook: function multiplayerHook(node, fromClient) {
|
|
77441
|
+
var isProcessRequested = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
77348
77442
|
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'];
|
|
77349
77443
|
if (!this.isMultiplayer) {
|
|
77350
77444
|
return;
|
|
@@ -77365,6 +77459,9 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77365
77459
|
if (node !== null && node !== void 0 && (_node$pool = node.pool) !== null && _node$pool !== void 0 && _node$pool.component) {
|
|
77366
77460
|
defaultData['poolId'] = node.pool.component.id;
|
|
77367
77461
|
}
|
|
77462
|
+
if (isProcessRequested) {
|
|
77463
|
+
return defaultData;
|
|
77464
|
+
}
|
|
77368
77465
|
window.ProcessMaker.EventBus.$emit('multiplayer-addNode', defaultData);
|
|
77369
77466
|
}
|
|
77370
77467
|
if (this.flowTypes.includes(node.type)) {
|
|
@@ -77372,218 +77469,222 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77372
77469
|
var sourceRefId = (_node$definition$sour = node.definition.sourceRef) === null || _node$definition$sour === void 0 ? void 0 : _node$definition$sour.id;
|
|
77373
77470
|
var targetRefId = (_node$definition$targ = node.definition.targetRef) === null || _node$definition$targ === void 0 ? void 0 : _node$definition$targ.id;
|
|
77374
77471
|
if (node.type === 'processmaker-modeler-data-input-association') {
|
|
77375
|
-
var _node$definition$sour2, _node$definition$targ2, _node$definition$targ3;
|
|
77472
|
+
var _node$definition$sour2, _node$definition$targ2, _node$definition$targ3, _node$definition$targ4;
|
|
77376
77473
|
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);
|
|
77377
|
-
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');
|
|
77474
|
+
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');
|
|
77378
77475
|
}
|
|
77379
77476
|
if (sourceRefId && targetRefId) {
|
|
77380
|
-
|
|
77477
|
+
var flowData = {
|
|
77381
77478
|
id: node.definition.id,
|
|
77382
77479
|
type: node.type,
|
|
77383
77480
|
sourceRefId: sourceRefId,
|
|
77384
77481
|
targetRefId: targetRefId,
|
|
77385
77482
|
waypoint: node.diagram.waypoint
|
|
77386
|
-
}
|
|
77483
|
+
};
|
|
77484
|
+
if (isProcessRequested) {
|
|
77485
|
+
return flowData;
|
|
77486
|
+
}
|
|
77487
|
+
window.ProcessMaker.EventBus.$emit('multiplayer-addFlow', flowData);
|
|
77387
77488
|
}
|
|
77388
77489
|
}
|
|
77389
77490
|
}
|
|
77390
77491
|
},
|
|
77391
77492
|
addNode: function addNode(node) {
|
|
77392
77493
|
var _arguments4 = arguments,
|
|
77393
|
-
|
|
77394
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77494
|
+
_this30 = this;
|
|
77495
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
77395
77496
|
var id, fromClient, targetProcess;
|
|
77396
|
-
return _regeneratorRuntime().wrap(function
|
|
77397
|
-
while (1) switch (
|
|
77497
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
77498
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
77398
77499
|
case 0:
|
|
77399
77500
|
id = _arguments4.length > 1 && _arguments4[1] !== undefined ? _arguments4[1] : null;
|
|
77400
77501
|
fromClient = _arguments4.length > 2 && _arguments4[2] !== undefined ? _arguments4[2] : false;
|
|
77401
77502
|
if (!node.pool) {
|
|
77402
|
-
node.pool =
|
|
77503
|
+
node.pool = _this30.poolTarget;
|
|
77403
77504
|
}
|
|
77404
|
-
targetProcess = node.getTargetProcess(
|
|
77505
|
+
targetProcess = node.getTargetProcess(_this30.processes, _this30.processNode);
|
|
77405
77506
|
addNodeToProcess(node, targetProcess);
|
|
77406
|
-
node.setIds(
|
|
77407
|
-
|
|
77507
|
+
node.setIds(_this30.nodeIdGenerator, id);
|
|
77508
|
+
_this30.planeElements.push(node.diagram);
|
|
77408
77509
|
// add multiplayer logic as a hook
|
|
77409
|
-
|
|
77510
|
+
_this30.multiplayerHook(node, fromClient);
|
|
77410
77511
|
store.commit('addNode', node);
|
|
77411
|
-
|
|
77512
|
+
_this30.poolTarget = null;
|
|
77412
77513
|
|
|
77413
77514
|
// add processmaker-modeler-generic-flow
|
|
77414
77515
|
if (![sequenceFlow_id, poolLane_config_id, associationConfig_id, messageFlow_config_id, config_id, dataInputAssociation_config_id, genericFlow_config_id].includes(node.type)) {
|
|
77415
|
-
|
|
77516
|
+
_context17.next = 12;
|
|
77416
77517
|
break;
|
|
77417
77518
|
}
|
|
77418
|
-
return
|
|
77519
|
+
return _context17.abrupt("return");
|
|
77419
77520
|
case 12:
|
|
77420
77521
|
if (!fromClient) {
|
|
77421
77522
|
// Select the node after it has been added to the store (does not apply to flows)
|
|
77422
|
-
|
|
77523
|
+
_this30.selectNewNode(node);
|
|
77423
77524
|
}
|
|
77424
|
-
return
|
|
77525
|
+
return _context17.abrupt("return", new Promise(function (resolve) {
|
|
77425
77526
|
setTimeout(function () {
|
|
77426
|
-
|
|
77527
|
+
_this30.pushToUndoStack();
|
|
77427
77528
|
resolve();
|
|
77428
77529
|
});
|
|
77429
77530
|
}));
|
|
77430
77531
|
case 14:
|
|
77431
77532
|
case "end":
|
|
77432
|
-
return
|
|
77533
|
+
return _context17.stop();
|
|
77433
77534
|
}
|
|
77434
|
-
},
|
|
77535
|
+
}, _callee17);
|
|
77435
77536
|
}))();
|
|
77436
77537
|
},
|
|
77437
77538
|
addClonedNodes: function addClonedNodes(nodes) {
|
|
77438
|
-
var
|
|
77439
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77440
|
-
return _regeneratorRuntime().wrap(function
|
|
77441
|
-
while (1) switch (
|
|
77539
|
+
var _this31 = this;
|
|
77540
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
77541
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
77542
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
77442
77543
|
case 0:
|
|
77443
77544
|
nodes.forEach(function (node) {
|
|
77444
77545
|
if (!node.pool) {
|
|
77445
|
-
node.pool =
|
|
77546
|
+
node.pool = _this31.poolTarget;
|
|
77446
77547
|
}
|
|
77447
|
-
var targetProcess = node.getTargetProcess(
|
|
77548
|
+
var targetProcess = node.getTargetProcess(_this31.processes, _this31.processNode);
|
|
77448
77549
|
addNodeToProcess(node, targetProcess);
|
|
77449
|
-
|
|
77450
|
-
|
|
77550
|
+
_this31.planeElements.push(node.diagram);
|
|
77551
|
+
_this31.multiplayerHook(node, false);
|
|
77451
77552
|
store.commit('addNode', node);
|
|
77452
|
-
|
|
77553
|
+
_this31.poolTarget = null;
|
|
77453
77554
|
});
|
|
77454
77555
|
case 1:
|
|
77455
77556
|
case "end":
|
|
77456
|
-
return
|
|
77557
|
+
return _context18.stop();
|
|
77457
77558
|
}
|
|
77458
|
-
},
|
|
77559
|
+
}, _callee18);
|
|
77459
77560
|
}))();
|
|
77460
77561
|
},
|
|
77461
77562
|
removeNode: function removeNode(node, options) {
|
|
77462
|
-
var
|
|
77463
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77464
|
-
return _regeneratorRuntime().wrap(function
|
|
77465
|
-
while (1) switch (
|
|
77563
|
+
var _this32 = this;
|
|
77564
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
77565
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
77566
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
77466
77567
|
case 0:
|
|
77467
77568
|
// Check if the node is not replaced
|
|
77468
|
-
if (
|
|
77569
|
+
if (_this32.isMultiplayer && !(options !== null && options !== void 0 && options.isReplaced)) {
|
|
77469
77570
|
// Emit event to server to remove node
|
|
77470
77571
|
window.ProcessMaker.EventBus.$emit('multiplayer-removeNode', node);
|
|
77471
77572
|
}
|
|
77472
|
-
|
|
77573
|
+
_this32.removeNodeProcedure(node, options);
|
|
77473
77574
|
case 2:
|
|
77474
77575
|
case "end":
|
|
77475
|
-
return
|
|
77576
|
+
return _context19.stop();
|
|
77476
77577
|
}
|
|
77477
|
-
},
|
|
77578
|
+
}, _callee19);
|
|
77478
77579
|
}))();
|
|
77479
77580
|
},
|
|
77480
77581
|
removeNodeProcedure: function removeNodeProcedure(node) {
|
|
77481
77582
|
var _arguments5 = arguments,
|
|
77482
|
-
|
|
77483
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77583
|
+
_this33 = this;
|
|
77584
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
|
|
77484
77585
|
var _ref6, _ref6$removeRelations, removeRelationships;
|
|
77485
|
-
return _regeneratorRuntime().wrap(function
|
|
77486
|
-
while (1) switch (
|
|
77586
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
77587
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
77487
77588
|
case 0:
|
|
77488
77589
|
_ref6 = _arguments5.length > 1 && _arguments5[1] !== undefined ? _arguments5[1] : {}, _ref6$removeRelations = _ref6.removeRelationships, removeRelationships = _ref6$removeRelations === void 0 ? true : _ref6$removeRelations;
|
|
77489
77590
|
if (node) {
|
|
77490
|
-
|
|
77591
|
+
_context20.next = 3;
|
|
77491
77592
|
break;
|
|
77492
77593
|
}
|
|
77493
|
-
return
|
|
77594
|
+
return _context20.abrupt("return");
|
|
77494
77595
|
case 3:
|
|
77495
77596
|
if (removeRelationships) {
|
|
77496
|
-
removeNodeFlows(node,
|
|
77497
|
-
removeNodeMessageFlows(node,
|
|
77498
|
-
removeNodeAssociations(node,
|
|
77597
|
+
removeNodeFlows(node, _this33);
|
|
77598
|
+
removeNodeMessageFlows(node, _this33);
|
|
77599
|
+
removeNodeAssociations(node, _this33);
|
|
77499
77600
|
}
|
|
77500
77601
|
removeOutgoingAndIncomingRefsToFlow(node);
|
|
77501
|
-
removeBoundaryEvents(
|
|
77602
|
+
removeBoundaryEvents(_this33.graph, node, _this33.removeNode);
|
|
77502
77603
|
removeSourceDefault(node);
|
|
77503
|
-
|
|
77504
|
-
|
|
77604
|
+
_this33.removeNodesFromLane(node);
|
|
77605
|
+
_this33.removeNodesFromPool(node);
|
|
77505
77606
|
store.commit('removeNode', node);
|
|
77506
|
-
store.commit('highlightNode',
|
|
77507
|
-
|
|
77508
|
-
|
|
77509
|
-
return
|
|
77607
|
+
store.commit('highlightNode', _this33.processNode);
|
|
77608
|
+
_this33.$refs.selector.clearSelection();
|
|
77609
|
+
_context20.next = 14;
|
|
77610
|
+
return _this33.$nextTick();
|
|
77510
77611
|
case 14:
|
|
77511
|
-
|
|
77512
|
-
return
|
|
77612
|
+
_context20.next = 16;
|
|
77613
|
+
return _this33.pushToUndoStack();
|
|
77513
77614
|
case 16:
|
|
77514
77615
|
// force to update the processNode property in every delete
|
|
77515
|
-
|
|
77516
|
-
if (
|
|
77517
|
-
|
|
77518
|
-
return diagram.bpmnElement.id ===
|
|
77616
|
+
_this33.processes = _this33.getProcesses();
|
|
77617
|
+
if (_this33.processes && _this33.processes.length > 0) {
|
|
77618
|
+
_this33.processNode = new Node('processmaker-modeler-process', _this33.processes[0], _this33.planeElements.find(function (diagram) {
|
|
77619
|
+
return diagram.bpmnElement.id === _this33.processes[0].id;
|
|
77519
77620
|
}));
|
|
77520
77621
|
}
|
|
77521
77622
|
case 18:
|
|
77522
77623
|
case "end":
|
|
77523
|
-
return
|
|
77624
|
+
return _context20.stop();
|
|
77524
77625
|
}
|
|
77525
|
-
},
|
|
77626
|
+
}, _callee20);
|
|
77526
77627
|
}))();
|
|
77527
77628
|
},
|
|
77528
77629
|
removeNodes: function removeNodes() {
|
|
77529
|
-
var
|
|
77530
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77531
|
-
return _regeneratorRuntime().wrap(function
|
|
77532
|
-
while (1) switch (
|
|
77630
|
+
var _this34 = this;
|
|
77631
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
77632
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
77633
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
77533
77634
|
case 0:
|
|
77534
|
-
|
|
77535
|
-
return
|
|
77536
|
-
return _regeneratorRuntime().wrap(function
|
|
77537
|
-
while (1) switch (
|
|
77635
|
+
_context23.next = 2;
|
|
77636
|
+
return _this34.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
|
77637
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
77638
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
77538
77639
|
case 0:
|
|
77539
|
-
|
|
77540
|
-
return
|
|
77640
|
+
_context22.next = 2;
|
|
77641
|
+
return _this34.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
77541
77642
|
var waitPromises;
|
|
77542
|
-
return _regeneratorRuntime().wrap(function
|
|
77543
|
-
while (1) switch (
|
|
77643
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
77644
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
77544
77645
|
case 0:
|
|
77545
77646
|
waitPromises = [];
|
|
77546
|
-
|
|
77547
|
-
return waitPromises.push(
|
|
77647
|
+
_this34.highlightedNodes.forEach(function (node) {
|
|
77648
|
+
return waitPromises.push(_this34.removeNode(node, {
|
|
77548
77649
|
removeRelationships: true
|
|
77549
77650
|
}));
|
|
77550
77651
|
});
|
|
77551
|
-
|
|
77652
|
+
_context21.next = 4;
|
|
77552
77653
|
return Promise.all(waitPromises);
|
|
77553
77654
|
case 4:
|
|
77554
77655
|
store.commit('highlightNode');
|
|
77555
77656
|
case 5:
|
|
77556
77657
|
case "end":
|
|
77557
|
-
return
|
|
77658
|
+
return _context21.stop();
|
|
77558
77659
|
}
|
|
77559
|
-
},
|
|
77660
|
+
}, _callee21);
|
|
77560
77661
|
})));
|
|
77561
77662
|
case 2:
|
|
77562
77663
|
case "end":
|
|
77563
|
-
return
|
|
77664
|
+
return _context22.stop();
|
|
77564
77665
|
}
|
|
77565
|
-
},
|
|
77666
|
+
}, _callee22);
|
|
77566
77667
|
})));
|
|
77567
77668
|
case 2:
|
|
77568
77669
|
case "end":
|
|
77569
|
-
return
|
|
77670
|
+
return _context23.stop();
|
|
77570
77671
|
}
|
|
77571
|
-
},
|
|
77672
|
+
}, _callee23);
|
|
77572
77673
|
}))();
|
|
77573
77674
|
},
|
|
77574
77675
|
replaceNode: function replaceNode(_ref9) {
|
|
77575
|
-
var
|
|
77676
|
+
var _this35 = this;
|
|
77576
77677
|
var node = _ref9.node,
|
|
77577
77678
|
typeToReplaceWith = _ref9.typeToReplaceWith;
|
|
77578
|
-
this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77579
|
-
return _regeneratorRuntime().wrap(function
|
|
77580
|
-
while (1) switch (
|
|
77679
|
+
this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
|
|
77680
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
77681
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
77581
77682
|
case 0:
|
|
77582
|
-
|
|
77583
|
-
return
|
|
77584
|
-
var _node$diagram$bounds, x, y, nodeData
|
|
77585
|
-
return _regeneratorRuntime().wrap(function
|
|
77586
|
-
while (1) switch (
|
|
77683
|
+
_context25.next = 2;
|
|
77684
|
+
return _this35.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
|
|
77685
|
+
var _node$diagram$bounds, x, y, nodeData;
|
|
77686
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
77687
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
77587
77688
|
case 0:
|
|
77588
77689
|
_node$diagram$bounds = node.diagram.bounds, x = _node$diagram$bounds.x, y = _node$diagram$bounds.y;
|
|
77589
77690
|
nodeData = {
|
|
@@ -77594,96 +77695,89 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77594
77695
|
},
|
|
77595
77696
|
nodeThatWillBeReplaced: node
|
|
77596
77697
|
};
|
|
77597
|
-
|
|
77598
|
-
|
|
77599
|
-
|
|
77600
|
-
}
|
|
77601
|
-
// Get all node types
|
|
77602
|
-
nodeTypes = nodeTypesStore.getters.getNodeTypes; // Get the new control
|
|
77603
|
-
newControl = nodeTypes.flatMap(function (nodeType) {
|
|
77604
|
-
var _nodeType$items;
|
|
77605
|
-
return (_nodeType$items = nodeType.items) === null || _nodeType$items === void 0 ? void 0 : _nodeType$items.filter(function (item) {
|
|
77606
|
-
return item.type === typeToReplaceWith;
|
|
77607
|
-
});
|
|
77608
|
-
}).filter(Boolean); // If the new control is found, emit event to server to replace node
|
|
77609
|
-
if (newControl.length === 1) {
|
|
77610
|
-
window.ProcessMaker.EventBus.$emit('multiplayer-replaceNode', {
|
|
77611
|
-
nodeData: nodeData,
|
|
77612
|
-
newControl: newControl[0].type
|
|
77613
|
-
});
|
|
77614
|
-
}
|
|
77615
|
-
_context23.next = 10;
|
|
77616
|
-
break;
|
|
77617
|
-
case 8:
|
|
77618
|
-
_context23.next = 10;
|
|
77619
|
-
return _this34.replaceNodeProcedure(nodeData, true);
|
|
77620
|
-
case 10:
|
|
77698
|
+
_context24.next = 4;
|
|
77699
|
+
return _this35.replaceNodeProcedure(nodeData);
|
|
77700
|
+
case 4:
|
|
77621
77701
|
case "end":
|
|
77622
|
-
return
|
|
77702
|
+
return _context24.stop();
|
|
77623
77703
|
}
|
|
77624
|
-
},
|
|
77704
|
+
}, _callee24);
|
|
77625
77705
|
})));
|
|
77626
77706
|
case 2:
|
|
77627
77707
|
case "end":
|
|
77628
|
-
return
|
|
77708
|
+
return _context25.stop();
|
|
77629
77709
|
}
|
|
77630
|
-
},
|
|
77710
|
+
}, _callee25);
|
|
77631
77711
|
})));
|
|
77632
77712
|
},
|
|
77633
77713
|
replaceNodeProcedure: function replaceNodeProcedure(data) {
|
|
77634
77714
|
var _arguments6 = arguments,
|
|
77635
|
-
|
|
77636
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77637
|
-
var isReplaced,
|
|
77638
|
-
return _regeneratorRuntime().wrap(function
|
|
77639
|
-
while (1) switch (
|
|
77715
|
+
_this36 = this;
|
|
77716
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
|
|
77717
|
+
var isReplaced, _this36$paper$localTo, clientX, clientY, newNode, nodeTypes, newControl;
|
|
77718
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
77719
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
77640
77720
|
case 0:
|
|
77641
77721
|
isReplaced = _arguments6.length > 1 && _arguments6[1] !== undefined ? _arguments6[1] : false;
|
|
77642
|
-
|
|
77643
|
-
|
|
77644
|
-
|
|
77645
|
-
|
|
77646
|
-
|
|
77647
|
-
|
|
77648
|
-
|
|
77649
|
-
|
|
77650
|
-
|
|
77651
|
-
|
|
77652
|
-
_context25.next = 7;
|
|
77653
|
-
return _this35.removeNode(data.nodeThatWillBeReplaced, {
|
|
77722
|
+
// Get the clientX and clientY from the node that will be replaced
|
|
77723
|
+
_this36$paper$localTo = _this36.paper.localToClientPoint(data.nodeThatWillBeReplaced.diagram.bounds), clientX = _this36$paper$localTo.x, clientY = _this36$paper$localTo.y;
|
|
77724
|
+
data.clientX = clientX;
|
|
77725
|
+
data.clientY = clientY;
|
|
77726
|
+
_context26.next = 6;
|
|
77727
|
+
return _this36.handleDrop(data);
|
|
77728
|
+
case 6:
|
|
77729
|
+
newNode = _context26.sent;
|
|
77730
|
+
_context26.next = 9;
|
|
77731
|
+
return _this36.removeNode(data.nodeThatWillBeReplaced, {
|
|
77654
77732
|
removeRelationships: false,
|
|
77655
77733
|
isReplaced: isReplaced
|
|
77656
77734
|
});
|
|
77657
|
-
case 7:
|
|
77658
|
-
_this35.highlightNode(newNode);
|
|
77659
|
-
_this35.selectNewNode(newNode);
|
|
77660
77735
|
case 9:
|
|
77736
|
+
_this36.highlightNode(newNode);
|
|
77737
|
+
_this36.selectNewNode(newNode);
|
|
77738
|
+
if (_this36.isMultiplayer && !isReplaced) {
|
|
77739
|
+
// Get all node types
|
|
77740
|
+
nodeTypes = nodeTypesStore.getters.getNodeTypes; // Get the new control
|
|
77741
|
+
newControl = nodeTypes.flatMap(function (nodeType) {
|
|
77742
|
+
var _nodeType$items;
|
|
77743
|
+
return (_nodeType$items = nodeType.items) === null || _nodeType$items === void 0 ? void 0 : _nodeType$items.filter(function (item) {
|
|
77744
|
+
return item.type === data.typeToReplaceWith;
|
|
77745
|
+
});
|
|
77746
|
+
}).filter(Boolean); // If the new control is found, emit event to server to replace node
|
|
77747
|
+
if (newControl.length === 1) {
|
|
77748
|
+
window.ProcessMaker.EventBus.$emit('multiplayer-replaceNode', {
|
|
77749
|
+
data: data,
|
|
77750
|
+
newControl: newControl[0].type
|
|
77751
|
+
});
|
|
77752
|
+
}
|
|
77753
|
+
}
|
|
77754
|
+
case 12:
|
|
77661
77755
|
case "end":
|
|
77662
|
-
return
|
|
77756
|
+
return _context26.stop();
|
|
77663
77757
|
}
|
|
77664
|
-
},
|
|
77758
|
+
}, _callee26);
|
|
77665
77759
|
}))();
|
|
77666
77760
|
},
|
|
77667
77761
|
replaceAiNode: function replaceAiNode(_ref12) {
|
|
77668
|
-
var
|
|
77762
|
+
var _this37 = this;
|
|
77669
77763
|
var node = _ref12.node,
|
|
77670
77764
|
typeToReplaceWith = _ref12.typeToReplaceWith,
|
|
77671
77765
|
assetId = _ref12.assetId,
|
|
77672
77766
|
assetName = _ref12.assetName,
|
|
77673
77767
|
redirectTo = _ref12.redirectTo;
|
|
77674
|
-
this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77675
|
-
return _regeneratorRuntime().wrap(function
|
|
77676
|
-
while (1) switch (
|
|
77768
|
+
this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
|
|
77769
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
77770
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
77677
77771
|
case 0:
|
|
77678
|
-
|
|
77679
|
-
return
|
|
77680
|
-
var
|
|
77681
|
-
return _regeneratorRuntime().wrap(function
|
|
77682
|
-
while (1) switch (
|
|
77772
|
+
_context28.next = 2;
|
|
77773
|
+
return _this37.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
|
|
77774
|
+
var _this37$paper$localTo, clientX, clientY, newNode;
|
|
77775
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
77776
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
77683
77777
|
case 0:
|
|
77684
|
-
|
|
77685
|
-
|
|
77686
|
-
return
|
|
77778
|
+
_this37$paper$localTo = _this37.paper.localToClientPoint(node.diagram.bounds), clientX = _this37$paper$localTo.x, clientY = _this37$paper$localTo.y;
|
|
77779
|
+
_context27.next = 3;
|
|
77780
|
+
return _this37.handleDrop({
|
|
77687
77781
|
clientX: clientX,
|
|
77688
77782
|
clientY: clientY,
|
|
77689
77783
|
control: {
|
|
@@ -77692,7 +77786,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77692
77786
|
nodeThatWillBeReplaced: node
|
|
77693
77787
|
});
|
|
77694
77788
|
case 3:
|
|
77695
|
-
newNode =
|
|
77789
|
+
newNode = _context27.sent;
|
|
77696
77790
|
if (typeToReplaceWith === 'processmaker-modeler-task') {
|
|
77697
77791
|
newNode.definition.screenRef = assetId;
|
|
77698
77792
|
newNode.definition.name = assetName;
|
|
@@ -77707,98 +77801,98 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77707
77801
|
newNode.definition.config = "{\"calledElement\":\"ProcessId-".concat(assetId, "\",\"processId\":").concat(assetId, ",\"startEvent\":\"node_1\",\"name\":\"").concat(assetName, "\"}");
|
|
77708
77802
|
redirectTo = "".concat(redirectTo, "/").concat(newNode.id);
|
|
77709
77803
|
}
|
|
77710
|
-
|
|
77711
|
-
return
|
|
77804
|
+
_context27.next = 9;
|
|
77805
|
+
return _this37.removeNode(node, {
|
|
77712
77806
|
removeRelationships: false
|
|
77713
77807
|
});
|
|
77714
77808
|
case 9:
|
|
77715
|
-
|
|
77716
|
-
|
|
77717
|
-
|
|
77718
|
-
return
|
|
77809
|
+
_this37.highlightNode(newNode);
|
|
77810
|
+
_this37.selectNewNode(newNode);
|
|
77811
|
+
_context27.next = 13;
|
|
77812
|
+
return _this37.pushToUndoStack();
|
|
77719
77813
|
case 13:
|
|
77720
|
-
|
|
77721
|
-
return
|
|
77814
|
+
_context27.next = 15;
|
|
77815
|
+
return _this37.$nextTick();
|
|
77722
77816
|
case 15:
|
|
77723
|
-
|
|
77817
|
+
_this37.saveBpmn(redirectTo, newNode.id);
|
|
77724
77818
|
case 16:
|
|
77725
77819
|
case "end":
|
|
77726
|
-
return
|
|
77820
|
+
return _context27.stop();
|
|
77727
77821
|
}
|
|
77728
|
-
},
|
|
77822
|
+
}, _callee27);
|
|
77729
77823
|
})));
|
|
77730
77824
|
case 2:
|
|
77731
77825
|
case "end":
|
|
77732
|
-
return
|
|
77826
|
+
return _context28.stop();
|
|
77733
77827
|
}
|
|
77734
|
-
},
|
|
77828
|
+
}, _callee28);
|
|
77735
77829
|
})));
|
|
77736
77830
|
},
|
|
77737
77831
|
replaceGenericFlow: function replaceGenericFlow(_ref15) {
|
|
77738
|
-
var
|
|
77832
|
+
var _this38 = this;
|
|
77739
77833
|
var actualFlow = _ref15.actualFlow,
|
|
77740
77834
|
genericFlow = _ref15.genericFlow,
|
|
77741
77835
|
targetNode = _ref15.targetNode;
|
|
77742
|
-
this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77743
|
-
return _regeneratorRuntime().wrap(function
|
|
77744
|
-
while (1) switch (
|
|
77836
|
+
this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
|
|
77837
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
77838
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
77745
77839
|
case 0:
|
|
77746
|
-
|
|
77747
|
-
return
|
|
77748
|
-
return _regeneratorRuntime().wrap(function
|
|
77749
|
-
while (1) switch (
|
|
77840
|
+
_context30.next = 2;
|
|
77841
|
+
return _this38.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
|
|
77842
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
77843
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
77750
77844
|
case 0:
|
|
77751
|
-
|
|
77752
|
-
return
|
|
77845
|
+
_context29.next = 2;
|
|
77846
|
+
return _this38.highlightNode(null);
|
|
77753
77847
|
case 2:
|
|
77754
|
-
|
|
77755
|
-
return
|
|
77848
|
+
_context29.next = 4;
|
|
77849
|
+
return _this38.$nextTick();
|
|
77756
77850
|
case 4:
|
|
77757
|
-
|
|
77851
|
+
_context29.next = 6;
|
|
77758
77852
|
return store.commit('removeNode', genericFlow);
|
|
77759
77853
|
case 6:
|
|
77760
|
-
|
|
77761
|
-
return
|
|
77854
|
+
_context29.next = 8;
|
|
77855
|
+
return _this38.$nextTick();
|
|
77762
77856
|
case 8:
|
|
77763
|
-
|
|
77764
|
-
return
|
|
77857
|
+
_context29.next = 10;
|
|
77858
|
+
return _this38.addNode(actualFlow, genericFlow.definition.id);
|
|
77765
77859
|
case 10:
|
|
77766
|
-
|
|
77767
|
-
return
|
|
77860
|
+
_context29.next = 12;
|
|
77861
|
+
return _this38.$nextTick();
|
|
77768
77862
|
case 12:
|
|
77769
|
-
|
|
77770
|
-
return
|
|
77863
|
+
_context29.next = 14;
|
|
77864
|
+
return _this38.highlightNode(targetNode);
|
|
77771
77865
|
case 14:
|
|
77772
77866
|
case "end":
|
|
77773
|
-
return
|
|
77867
|
+
return _context29.stop();
|
|
77774
77868
|
}
|
|
77775
|
-
},
|
|
77869
|
+
}, _callee29);
|
|
77776
77870
|
})));
|
|
77777
77871
|
case 2:
|
|
77778
77872
|
case "end":
|
|
77779
|
-
return
|
|
77873
|
+
return _context30.stop();
|
|
77780
77874
|
}
|
|
77781
|
-
},
|
|
77875
|
+
}, _callee30);
|
|
77782
77876
|
})));
|
|
77783
77877
|
},
|
|
77784
77878
|
performSingleUndoRedoTransaction: function performSingleUndoRedoTransaction(cb) {
|
|
77785
|
-
var
|
|
77786
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
77787
|
-
return _regeneratorRuntime().wrap(function
|
|
77788
|
-
while (1) switch (
|
|
77879
|
+
var _this39 = this;
|
|
77880
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
|
|
77881
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
77882
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
77789
77883
|
case 0:
|
|
77790
77884
|
undoRedoStore.commit('disableSavingState');
|
|
77791
|
-
|
|
77885
|
+
_context31.next = 3;
|
|
77792
77886
|
return cb();
|
|
77793
77887
|
case 3:
|
|
77794
77888
|
undoRedoStore.commit('enableSavingState');
|
|
77795
|
-
|
|
77796
|
-
return
|
|
77889
|
+
_context31.next = 6;
|
|
77890
|
+
return _this39.pushToUndoStack();
|
|
77797
77891
|
case 6:
|
|
77798
77892
|
case "end":
|
|
77799
|
-
return
|
|
77893
|
+
return _context31.stop();
|
|
77800
77894
|
}
|
|
77801
|
-
},
|
|
77895
|
+
}, _callee31);
|
|
77802
77896
|
}))();
|
|
77803
77897
|
},
|
|
77804
77898
|
removeNodesFromLane: function removeNodesFromLane(node) {
|
|
@@ -77811,36 +77905,36 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77811
77905
|
pull_default()(containingLane.get('flowNodeRef'), node.definition);
|
|
77812
77906
|
},
|
|
77813
77907
|
removeNodesFromPool: function removeNodesFromPool(node) {
|
|
77814
|
-
var
|
|
77908
|
+
var _this40 = this;
|
|
77815
77909
|
if (node.type === 'processmaker-modeler-pool' && node.definition.processRef) {
|
|
77816
77910
|
if (node.definition.processRef.artifacts) {
|
|
77817
77911
|
node.definition.processRef.artifacts.forEach(function (artifact) {
|
|
77818
|
-
var nodeToRemove =
|
|
77912
|
+
var nodeToRemove = _this40.nodes.find(function (n) {
|
|
77819
77913
|
return n.definition === artifact;
|
|
77820
77914
|
});
|
|
77821
77915
|
if (nodeToRemove) {
|
|
77822
|
-
|
|
77916
|
+
_this40.removeNode(nodeToRemove);
|
|
77823
77917
|
}
|
|
77824
77918
|
});
|
|
77825
77919
|
}
|
|
77826
77920
|
if (node.definition.processRef.flowElements) {
|
|
77827
77921
|
node.definition.processRef.flowElements.forEach(function (flowElement) {
|
|
77828
|
-
var nodeToRemove =
|
|
77922
|
+
var nodeToRemove = _this40.nodes.find(function (n) {
|
|
77829
77923
|
return n.definition === flowElement;
|
|
77830
77924
|
});
|
|
77831
77925
|
if (nodeToRemove) {
|
|
77832
|
-
|
|
77926
|
+
_this40.removeNode(nodeToRemove);
|
|
77833
77927
|
}
|
|
77834
77928
|
});
|
|
77835
77929
|
}
|
|
77836
77930
|
var laneSets = node.definition.processRef.laneSets;
|
|
77837
77931
|
if (!!laneSets && laneSets.length > 0) {
|
|
77838
77932
|
laneSets[0].lanes.forEach(function (lane) {
|
|
77839
|
-
var nodeToRemove =
|
|
77933
|
+
var nodeToRemove = _this40.nodes.find(function (n) {
|
|
77840
77934
|
return n.definition === lane;
|
|
77841
77935
|
});
|
|
77842
77936
|
if (nodeToRemove) {
|
|
77843
|
-
|
|
77937
|
+
_this40.removeNode(nodeToRemove);
|
|
77844
77938
|
}
|
|
77845
77939
|
});
|
|
77846
77940
|
}
|
|
@@ -77868,13 +77962,13 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77868
77962
|
return shape.component != null;
|
|
77869
77963
|
},
|
|
77870
77964
|
setShapeStacking: function setShapeStacking(shape) {
|
|
77871
|
-
var
|
|
77965
|
+
var _this41 = this;
|
|
77872
77966
|
if (this.isRendering || !shape.component.node.isType('processmaker-modeler-pool') && shape === this.previouslyStackedShape) {
|
|
77873
77967
|
return;
|
|
77874
77968
|
}
|
|
77875
77969
|
this.previouslyStackedShape = shape;
|
|
77876
77970
|
this.paperManager.performAtomicAction(function () {
|
|
77877
|
-
return ensureShapeIsNotCovered(shape,
|
|
77971
|
+
return ensureShapeIsNotCovered(shape, _this41.graph);
|
|
77878
77972
|
});
|
|
77879
77973
|
},
|
|
77880
77974
|
showSavedNotification: function showSavedNotification() {
|
|
@@ -77908,49 +78002,49 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77908
78002
|
return false;
|
|
77909
78003
|
},
|
|
77910
78004
|
pointerDowInShape: function pointerDowInShape(event, element) {
|
|
77911
|
-
var
|
|
77912
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
78005
|
+
var _this42 = this;
|
|
78006
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
|
|
77913
78007
|
var x, y, shapeView;
|
|
77914
|
-
return _regeneratorRuntime().wrap(function
|
|
77915
|
-
while (1) switch (
|
|
78008
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
78009
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
77916
78010
|
case 0:
|
|
77917
78011
|
x = event.clientX, y = event.clientY;
|
|
77918
|
-
shapeView =
|
|
77919
|
-
|
|
77920
|
-
|
|
77921
|
-
|
|
77922
|
-
|
|
78012
|
+
shapeView = _this42.paper.findViewByModel(element);
|
|
78013
|
+
_this42.isDragging = false;
|
|
78014
|
+
_this42.isSelecting = false;
|
|
78015
|
+
_this42.isIntoTheSelection = false;
|
|
78016
|
+
_this42.dragStart = {
|
|
77923
78017
|
x: x,
|
|
77924
78018
|
y: y
|
|
77925
78019
|
};
|
|
77926
78020
|
// Verify if is in the selection box
|
|
77927
|
-
if (!
|
|
77928
|
-
|
|
78021
|
+
if (!_this42.isPointInSelection(event)) {
|
|
78022
|
+
_context32.next = 10;
|
|
77929
78023
|
break;
|
|
77930
78024
|
}
|
|
77931
|
-
|
|
77932
|
-
|
|
78025
|
+
_this42.isIntoTheSelection = true;
|
|
78026
|
+
_context32.next = 15;
|
|
77933
78027
|
break;
|
|
77934
78028
|
case 10:
|
|
77935
78029
|
if (event.shiftKey) {
|
|
77936
|
-
|
|
78030
|
+
_context32.next = 15;
|
|
77937
78031
|
break;
|
|
77938
78032
|
}
|
|
77939
|
-
|
|
77940
|
-
return
|
|
78033
|
+
_context32.next = 13;
|
|
78034
|
+
return _this42.$refs.selector.selectElement(shapeView);
|
|
77941
78035
|
case 13:
|
|
77942
|
-
|
|
77943
|
-
return
|
|
78036
|
+
_context32.next = 15;
|
|
78037
|
+
return _this42.$nextTick();
|
|
77944
78038
|
case 15:
|
|
77945
|
-
|
|
78039
|
+
_this42.$refs.selector.startDrag({
|
|
77946
78040
|
clientX: event.clientX,
|
|
77947
78041
|
clientY: event.clientY
|
|
77948
78042
|
});
|
|
77949
78043
|
case 16:
|
|
77950
78044
|
case "end":
|
|
77951
|
-
return
|
|
78045
|
+
return _context32.stop();
|
|
77952
78046
|
}
|
|
77953
|
-
},
|
|
78047
|
+
}, _callee32);
|
|
77954
78048
|
}))();
|
|
77955
78049
|
},
|
|
77956
78050
|
pointerDownHandler: function pointerDownHandler(event) {
|
|
@@ -78071,7 +78165,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
78071
78165
|
this.$emit('set-xml-manager', this.xmlManager);
|
|
78072
78166
|
},
|
|
78073
78167
|
mounted: function mounted() {
|
|
78074
|
-
var
|
|
78168
|
+
var _this43 = this;
|
|
78075
78169
|
store.commit('setReadOnly', this.readOnly);
|
|
78076
78170
|
this.graph = new external_jointjs_.dia.Graph();
|
|
78077
78171
|
store.commit('setGraph', this.graph);
|
|
@@ -78090,47 +78184,47 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
78090
78184
|
store.commit('setPaper', this.paperManager.paper);
|
|
78091
78185
|
this.paperManager.addEventHandler('element:pointerclick', this.blurFocusedScreenBuilderElement, this);
|
|
78092
78186
|
this.paperManager.addEventHandler('blank:pointerdown', function (event, x, y) {
|
|
78093
|
-
if (
|
|
78187
|
+
if (_this43.isGrabbing) return;
|
|
78094
78188
|
if (store.getters.isReadOnly) {
|
|
78095
|
-
|
|
78189
|
+
_this43.isGrabbing = true;
|
|
78096
78190
|
}
|
|
78097
|
-
var scale =
|
|
78098
|
-
|
|
78191
|
+
var scale = _this43.paperManager.scale;
|
|
78192
|
+
_this43.canvasDragPosition = {
|
|
78099
78193
|
x: x * scale.sx,
|
|
78100
78194
|
y: y * scale.sy
|
|
78101
78195
|
};
|
|
78102
|
-
|
|
78103
|
-
|
|
78196
|
+
_this43.isOverShape = false;
|
|
78197
|
+
_this43.pointerDownHandler(event);
|
|
78104
78198
|
}, this);
|
|
78105
78199
|
this.paperManager.addEventHandler('cell:mouseover element:mouseover', function (_ref19) {
|
|
78106
78200
|
var shape = _ref19.model;
|
|
78107
|
-
if (
|
|
78201
|
+
if (_this43.isBpmnNode(shape) && shape.attr('body/cursor') !== 'default' && !_this43.isGrabbing) {
|
|
78108
78202
|
shape.attr('body/cursor', 'move');
|
|
78109
78203
|
}
|
|
78110
78204
|
// If the user is panning the Paper while hovering an element, ignore the default move cursor
|
|
78111
|
-
if (
|
|
78205
|
+
if (_this43.isGrabbing && _this43.isBpmnNode(shape)) {
|
|
78112
78206
|
shape.attr('body/cursor', 'grabbing');
|
|
78113
78207
|
}
|
|
78114
78208
|
});
|
|
78115
78209
|
this.paperManager.addEventHandler('blank:pointerup', function (event) {
|
|
78116
|
-
|
|
78117
|
-
|
|
78118
|
-
|
|
78119
|
-
|
|
78210
|
+
_this43.isGrabbing = false;
|
|
78211
|
+
_this43.canvasDragPosition = null;
|
|
78212
|
+
_this43.activeNode = null;
|
|
78213
|
+
_this43.pointerUpHandler(event);
|
|
78120
78214
|
}, this);
|
|
78121
78215
|
this.paperManager.addEventHandler('cell:pointerup', function (cellView, event) {
|
|
78122
|
-
|
|
78123
|
-
|
|
78124
|
-
|
|
78216
|
+
_this43.canvasDragPosition = null;
|
|
78217
|
+
_this43.activeNode = null;
|
|
78218
|
+
_this43.pointerUpHandler(event, cellView);
|
|
78125
78219
|
}, this);
|
|
78126
78220
|
this.$refs['paper-container'].addEventListener('mouseenter', function () {
|
|
78127
78221
|
store.commit('setClientLeftPaper', false);
|
|
78128
78222
|
});
|
|
78129
78223
|
this.$el.addEventListener('mousemove', function (event) {
|
|
78130
|
-
|
|
78224
|
+
_this43.pointerMoveHandler(event);
|
|
78131
78225
|
});
|
|
78132
78226
|
this.$refs['paper-container'].addEventListener('mouseleave', function () {
|
|
78133
|
-
|
|
78227
|
+
_this43.paperManager.removeEventHandler('blank:pointermove');
|
|
78134
78228
|
store.commit('setClientLeftPaper', true);
|
|
78135
78229
|
});
|
|
78136
78230
|
this.paperManager.addEventHandler('cell:pointerclick', function (cellView, evt, x, y) {
|
|
@@ -78141,44 +78235,44 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
78141
78235
|
});
|
|
78142
78236
|
this.paperManager.addEventHandler('cell:pointerclick', function (_ref20, event) {
|
|
78143
78237
|
var shape = _ref20.model;
|
|
78144
|
-
if (!
|
|
78238
|
+
if (!_this43.isBpmnNode(shape)) {
|
|
78145
78239
|
return;
|
|
78146
78240
|
}
|
|
78147
78241
|
|
|
78148
78242
|
// ignore click event if the user is Grabbing the paper
|
|
78149
|
-
if (
|
|
78243
|
+
if (_this43.isGrabbing) return;
|
|
78150
78244
|
shape.component.$emit('click', event);
|
|
78151
|
-
|
|
78245
|
+
_this43.$emit('click', {
|
|
78152
78246
|
event: event,
|
|
78153
|
-
node:
|
|
78247
|
+
node: _this43.highlightedNode.definition
|
|
78154
78248
|
});
|
|
78155
78249
|
});
|
|
78156
78250
|
this.paperManager.addEventHandler('cell:pointerdown', function (_ref21, event) {
|
|
78157
78251
|
var shape = _ref21.model;
|
|
78158
|
-
if (!
|
|
78252
|
+
if (!_this43.isBpmnNode(shape)) {
|
|
78159
78253
|
return;
|
|
78160
78254
|
}
|
|
78161
78255
|
// If the user is pressing Space (grabbing) and clicking on a Cell, return
|
|
78162
|
-
if (
|
|
78256
|
+
if (_this43.isGrabbing) {
|
|
78163
78257
|
return;
|
|
78164
78258
|
}
|
|
78165
|
-
|
|
78166
|
-
|
|
78167
|
-
|
|
78168
|
-
|
|
78259
|
+
_this43.setShapeStacking(shape);
|
|
78260
|
+
_this43.activeNode = shape.component.node;
|
|
78261
|
+
_this43.isOverShape = true;
|
|
78262
|
+
_this43.pointerDowInShape(event, shape);
|
|
78169
78263
|
});
|
|
78170
78264
|
// If the user is grabbing the paper while he clicked in a cell, move the paper and not the cell
|
|
78171
78265
|
this.paperManager.addEventHandler('cell:pointermove', function (_, event, x, y) {
|
|
78172
|
-
if (
|
|
78173
|
-
if (!
|
|
78174
|
-
var scale =
|
|
78175
|
-
|
|
78266
|
+
if (_this43.isGrabbing) {
|
|
78267
|
+
if (!_this43.canvasDragPosition) {
|
|
78268
|
+
var scale = _this43.paperManager.scale;
|
|
78269
|
+
_this43.canvasDragPosition = {
|
|
78176
78270
|
x: x * scale.sx,
|
|
78177
78271
|
y: y * scale.sy
|
|
78178
78272
|
};
|
|
78179
78273
|
}
|
|
78180
|
-
if (
|
|
78181
|
-
|
|
78274
|
+
if (_this43.canvasDragPosition && !_this43.clientLeftPaper) {
|
|
78275
|
+
_this43.paperManager.translate(event.offsetX - _this43.canvasDragPosition.x, event.offsetY - _this43.canvasDragPosition.y);
|
|
78182
78276
|
}
|
|
78183
78277
|
}
|
|
78184
78278
|
});
|
|
@@ -78189,28 +78283,29 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
78189
78283
|
modeler: this,
|
|
78190
78284
|
registerMenuAction: this.registerMenuAction,
|
|
78191
78285
|
loadXML: function () {
|
|
78192
|
-
var _loadXML = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
78286
|
+
var _loadXML = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(xml) {
|
|
78193
78287
|
var multiplayer;
|
|
78194
|
-
return _regeneratorRuntime().wrap(function
|
|
78195
|
-
while (1) switch (
|
|
78288
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
78289
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
78196
78290
|
case 0:
|
|
78197
|
-
|
|
78198
|
-
return
|
|
78291
|
+
_context33.next = 2;
|
|
78292
|
+
return _this43.loadXML(xml);
|
|
78199
78293
|
case 2:
|
|
78200
|
-
|
|
78294
|
+
_context33.next = 4;
|
|
78201
78295
|
return undoRedoStore.dispatch('pushState', xml);
|
|
78202
78296
|
case 4:
|
|
78203
78297
|
try {
|
|
78204
|
-
multiplayer = new Multiplayer(
|
|
78298
|
+
multiplayer = new Multiplayer(_this43);
|
|
78205
78299
|
multiplayer.init();
|
|
78300
|
+
_this43.multiplayer = multiplayer;
|
|
78206
78301
|
} catch (error) {
|
|
78207
78302
|
console.warn('Could not initialize multiplayer', error);
|
|
78208
78303
|
}
|
|
78209
78304
|
case 5:
|
|
78210
78305
|
case "end":
|
|
78211
|
-
return
|
|
78306
|
+
return _context33.stop();
|
|
78212
78307
|
}
|
|
78213
|
-
},
|
|
78308
|
+
}, _callee33);
|
|
78214
78309
|
}));
|
|
78215
78310
|
function loadXML(_x) {
|
|
78216
78311
|
return _loadXML.apply(this, arguments);
|
|
@@ -78218,18 +78313,18 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
78218
78313
|
return loadXML;
|
|
78219
78314
|
}(),
|
|
78220
78315
|
addWarnings: function addWarnings(warnings) {
|
|
78221
|
-
return
|
|
78316
|
+
return _this43.$emit('warnings', warnings);
|
|
78222
78317
|
},
|
|
78223
78318
|
addBreadcrumbs: function addBreadcrumbs(breadcrumbs) {
|
|
78224
|
-
return
|
|
78319
|
+
return _this43.breadcrumbData.push(breadcrumbs);
|
|
78225
78320
|
}
|
|
78226
78321
|
});
|
|
78227
78322
|
this.$root.$on('replace-ai-node', function (data) {
|
|
78228
|
-
|
|
78323
|
+
_this43.replaceAiNode(data);
|
|
78229
78324
|
});
|
|
78230
78325
|
window.ProcessMaker.EventBus.$on('save-changes', function (redirectUrl) {
|
|
78231
78326
|
if (redirectUrl) {
|
|
78232
|
-
|
|
78327
|
+
_this43.redirect(redirectUrl);
|
|
78233
78328
|
}
|
|
78234
78329
|
});
|
|
78235
78330
|
}
|
|
@@ -78251,8 +78346,8 @@ var modelervue_type_style_index_0_prod_lang_scss_ = __webpack_require__(26695);
|
|
|
78251
78346
|
|
|
78252
78347
|
var Modeler_component = normalizeComponent(
|
|
78253
78348
|
modeler_Modelervue_type_script_lang_js_,
|
|
78254
|
-
|
|
78255
|
-
|
|
78349
|
+
Modelervue_type_template_id_5fd6d55f_render,
|
|
78350
|
+
Modelervue_type_template_id_5fd6d55f_staticRenderFns,
|
|
78256
78351
|
false,
|
|
78257
78352
|
null,
|
|
78258
78353
|
null,
|