@processmaker/modeler 1.39.31 → 1.39.32
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 +198 -71
- package/dist/modeler.common.js.map +1 -1
- package/dist/modeler.umd.js +198 -71
- package/dist/modeler.umd.js.map +1 -1
- package/dist/modeler.umd.min.js +4 -4
- package/dist/modeler.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/inspectors/PreviewPanel.vue +67 -63
- package/src/components/inspectors/preview_panel.scss +22 -25
- package/src/components/modeler/Modeler.vue +41 -6
- package/src/components/modeler/NodeMigrator.js +10 -2
- package/src/multiplayer/multiplayer.js +67 -2
package/package.json
CHANGED
|
@@ -1,65 +1,71 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<b-
|
|
3
|
-
v-show="visible"
|
|
4
|
-
id="preview_panel"
|
|
5
|
-
class="pl-0 h-100 overflow-hidden preview-column"
|
|
6
|
-
:style="{ maxWidth: width + 'px' }"
|
|
7
|
-
@mousedown="onMouseDown"
|
|
2
|
+
<b-row ref="resizableDiv"
|
|
8
3
|
@mouseup="onMouseUp"
|
|
9
4
|
@mousemove="onMouseMove"
|
|
10
|
-
|
|
5
|
+
v-show="visible"
|
|
11
6
|
>
|
|
12
|
-
<b-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
7
|
+
<b-col class="col-auto p-0 resizer-column" @mousedown="onMouseDown" />
|
|
8
|
+
<b-col
|
|
9
|
+
class="pl-0 h-100 overflow-hidden preview-column"
|
|
10
|
+
:style="{ width: panelWidth + 'px' }"
|
|
11
|
+
data-test="preview-panel"
|
|
12
|
+
>
|
|
13
|
+
<b-row class="control-bar">
|
|
14
|
+
<b-col cols="9">
|
|
15
|
+
<div>
|
|
16
|
+
<i v-show = "selectedPreview === 1" class="fas fa-file-alt"/>
|
|
17
|
+
<b v-show = "selectedPreview === 2"> {} </b>
|
|
18
|
+
<b-dropdown
|
|
19
|
+
variant="ellipsis"
|
|
20
|
+
no-caret
|
|
21
|
+
no-flip
|
|
22
|
+
lazy
|
|
23
|
+
class="preview-type-dropdown"
|
|
24
|
+
v-model="selectedPreview"
|
|
25
|
+
>
|
|
26
|
+
<template #button-content>
|
|
27
|
+
<i class="fas fa-sort-down" />
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<b-dropdown-item key="1" class="ellipsis-dropdown-item mx-auto" @click="onSelectedPreview(1)">
|
|
31
|
+
<div class="ellipsis-dropdown-content">
|
|
32
|
+
<b class="pr-1 fa-fw fas fa-file-alt" />
|
|
33
|
+
<span>{{ $t('Document') }}</span>
|
|
34
|
+
</div>
|
|
35
|
+
</b-dropdown-item>
|
|
36
|
+
|
|
37
|
+
</b-dropdown>
|
|
38
|
+
<span>{{ $t('Preview') }} - {{ taskTitle }}</span>
|
|
39
|
+
</div>
|
|
40
|
+
</b-col>
|
|
41
|
+
<b-col class="actions">
|
|
43
42
|
<i class="fas fa-external-link-alt" v-show="previewUrl" @click="openAsset()"/>
|
|
44
43
|
<i class="fas fa-times" @click="onClose()" />
|
|
45
|
-
</
|
|
46
|
-
</b-
|
|
47
|
-
|
|
44
|
+
</b-col>
|
|
45
|
+
</b-row>
|
|
46
|
+
|
|
47
|
+
<b-row class="divider"/>
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
<b-row>
|
|
50
|
+
<div class="task-title"> {{ taskTitle }} </div>
|
|
51
|
+
</b-row>
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
<div class="task-title"> {{ taskTitle }} </div>
|
|
55
|
-
</b-row>
|
|
53
|
+
<loading-preview v-show="showSpinner"/>
|
|
56
54
|
|
|
57
|
-
|
|
55
|
+
<no-preview-available v-show="!previewUrl"/>
|
|
58
56
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
<iframe
|
|
58
|
+
title="Preview"
|
|
59
|
+
v-show="!!previewUrl && !showSpinner"
|
|
60
|
+
:src="previewUrl"
|
|
61
|
+
class="preview-iframe"
|
|
62
|
+
@load="loading"
|
|
63
|
+
@mousemove="onMouseMove"
|
|
64
|
+
@mouseup="onMouseUp"
|
|
65
|
+
/>
|
|
62
66
|
|
|
67
|
+
</b-col>
|
|
68
|
+
</b-row>
|
|
63
69
|
</template>
|
|
64
70
|
|
|
65
71
|
<script>
|
|
@@ -68,7 +74,7 @@ import NoPreviewAvailable from '@/components/inspectors/NoPreviewAvailable';
|
|
|
68
74
|
import LoadingPreview from '@/components/inspectors/LoadingPreview.vue';
|
|
69
75
|
|
|
70
76
|
export default {
|
|
71
|
-
props: ['nodeRegistry', 'visible', 'previewConfigs'],
|
|
77
|
+
props: ['nodeRegistry', 'visible', 'previewConfigs', 'panelWidth'],
|
|
72
78
|
components: { NoPreviewAvailable, LoadingPreview },
|
|
73
79
|
data() {
|
|
74
80
|
return {
|
|
@@ -79,7 +85,6 @@ export default {
|
|
|
79
85
|
taskTitle: '',
|
|
80
86
|
itemTitle: '',
|
|
81
87
|
width: 600,
|
|
82
|
-
isDragging: false,
|
|
83
88
|
currentPos: 600,
|
|
84
89
|
};
|
|
85
90
|
},
|
|
@@ -148,7 +153,6 @@ export default {
|
|
|
148
153
|
this.$emit('togglePreview', false);
|
|
149
154
|
}
|
|
150
155
|
},
|
|
151
|
-
|
|
152
156
|
onSelectedPreview(item) {
|
|
153
157
|
this.selectedPreview = item;
|
|
154
158
|
},
|
|
@@ -174,26 +178,26 @@ export default {
|
|
|
174
178
|
const nodeHasConfigParams = Object.keys(clone).length > 0;
|
|
175
179
|
this.previewUrl = previewConfig && nodeHasConfigParams ? `${previewConfig.url}?node=${nodeData}` : null;
|
|
176
180
|
this.taskTitle = this.highlightedNode?.definition?.name;
|
|
177
|
-
this.showPanel = true;
|
|
178
181
|
},
|
|
179
182
|
onClose() {
|
|
180
183
|
this.$emit('togglePreview', false);
|
|
181
184
|
},
|
|
182
185
|
onMouseDown(event) {
|
|
183
|
-
this
|
|
184
|
-
this.currentPos = event.x;
|
|
186
|
+
this.$emit('startResize', event);
|
|
185
187
|
},
|
|
186
188
|
onMouseUp() {
|
|
187
|
-
this
|
|
189
|
+
this.$emit('stopResize');
|
|
188
190
|
},
|
|
189
191
|
onMouseMove(event) {
|
|
190
|
-
if (
|
|
191
|
-
|
|
192
|
-
this.currentPos = event.x;
|
|
193
|
-
this.width = parseInt(this.width) + dx;
|
|
194
|
-
this.$emit('previewResize', this.width);
|
|
192
|
+
if (window.ProcessMaker.$modeler.isResizingPreview) {
|
|
193
|
+
this.$emit('previewResize', event);
|
|
195
194
|
}
|
|
196
195
|
},
|
|
196
|
+
setWidth(positionX) {
|
|
197
|
+
const dx = this.currentPos - positionX;
|
|
198
|
+
this.currentPos = positionX;
|
|
199
|
+
this.width = parseInt(this.width) + dx;
|
|
200
|
+
},
|
|
197
201
|
},
|
|
198
202
|
};
|
|
199
203
|
</script>
|
|
@@ -1,28 +1,18 @@
|
|
|
1
|
-
$inspector-column-max-width: 400px;
|
|
2
1
|
$inspector-column-min-width: 200px;
|
|
3
2
|
|
|
4
|
-
#preview_panel::after {
|
|
5
|
-
display: flex;
|
|
6
|
-
content: '';
|
|
7
|
-
left: 0;
|
|
8
|
-
width: 5px;
|
|
9
|
-
height: 100%;
|
|
10
|
-
cursor: ew-resize;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
3
|
.preview-column {
|
|
14
|
-
max-width: $inspector-column-max-width;
|
|
15
4
|
min-width: $inspector-column-min-width;
|
|
16
5
|
resize: both;
|
|
17
6
|
overflow:auto;
|
|
18
7
|
background-color: #fff;
|
|
19
|
-
border-left: 8px solid #EBEEF2;
|
|
20
8
|
z-index: 2;
|
|
21
9
|
}
|
|
22
10
|
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
.preview-iframe {
|
|
12
|
+
width:90%;
|
|
13
|
+
height:100%;
|
|
14
|
+
padding: 0 30px 0 50px;
|
|
15
|
+
border: none;
|
|
26
16
|
}
|
|
27
17
|
|
|
28
18
|
.preview-column .control-bar {
|
|
@@ -31,12 +21,29 @@ $inspector-column-min-width: 200px;
|
|
|
31
21
|
color: #7f7f7f;
|
|
32
22
|
}
|
|
33
23
|
|
|
24
|
+
.preview-type-dropdown {
|
|
25
|
+
margin-top:-10px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.resizer-column {
|
|
29
|
+
cursor:ew-resize;
|
|
30
|
+
width:5px;
|
|
31
|
+
background-color:#EBEEF2;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
34
|
.preview-column .control-bar .actions {
|
|
35
35
|
text-align: right;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
.preview-column .divider {
|
|
39
|
+
background-color: #0074D9;
|
|
40
|
+
height: 20px;
|
|
41
|
+
width: 100%;
|
|
42
|
+
}
|
|
43
|
+
|
|
38
44
|
.preview-column .control-bar .actions div {
|
|
39
45
|
width: 100%;
|
|
46
|
+
padding-right: 15px;
|
|
40
47
|
text-align: right;
|
|
41
48
|
}
|
|
42
49
|
|
|
@@ -45,16 +52,6 @@ $inspector-column-min-width: 200px;
|
|
|
45
52
|
cursor: pointer;
|
|
46
53
|
}
|
|
47
54
|
|
|
48
|
-
.item-title {
|
|
49
|
-
margin-top: 15px;
|
|
50
|
-
width: 100%;
|
|
51
|
-
height: 30px;
|
|
52
|
-
font-size: larger;
|
|
53
|
-
text-align: center;
|
|
54
|
-
align-items: center;
|
|
55
|
-
color: #7f7f7f;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
55
|
.task-title {
|
|
59
56
|
width: 100%;
|
|
60
57
|
height: 60px;
|
|
@@ -45,6 +45,8 @@
|
|
|
45
45
|
ref="paper-container"
|
|
46
46
|
:class="[cursor, { 'grabbing-cursor' : isGrabbing }]"
|
|
47
47
|
:style="{ width: parentWidth, height: parentHeight }"
|
|
48
|
+
@mouseup="onMouseUp"
|
|
49
|
+
@mousemove="[onMouseMove($event), setInspectorButtonPosition($event)]"
|
|
48
50
|
>
|
|
49
51
|
|
|
50
52
|
<div ref="paper" data-test="paper" class="main-paper" />
|
|
@@ -64,10 +66,13 @@
|
|
|
64
66
|
|
|
65
67
|
<PreviewPanel ref="preview-panel"
|
|
66
68
|
@togglePreview="[handleTogglePreview($event), setInspectorButtonPosition($event)]"
|
|
67
|
-
@previewResize="setInspectorButtonPosition"
|
|
69
|
+
@previewResize="[onMouseMove($event), setInspectorButtonPosition($event)]"
|
|
70
|
+
@startResize="onStartPreviewResize"
|
|
71
|
+
@stopResize="onMouseUp"
|
|
68
72
|
:visible="isOpenPreview"
|
|
69
73
|
:nodeRegistry="nodeRegistry"
|
|
70
74
|
:previewConfigs="previewConfigs"
|
|
75
|
+
:panelWidth="previewPanelWidth"
|
|
71
76
|
/>
|
|
72
77
|
|
|
73
78
|
<InspectorPanel
|
|
@@ -164,6 +169,7 @@
|
|
|
164
169
|
</template>
|
|
165
170
|
|
|
166
171
|
<script>
|
|
172
|
+
|
|
167
173
|
import Vue from 'vue';
|
|
168
174
|
import _ from 'lodash';
|
|
169
175
|
import { dia } from 'jointjs';
|
|
@@ -212,7 +218,14 @@ import hotkeys from '@/components/hotkeys/main';
|
|
|
212
218
|
import TimerEventNode from '@/components/nodes/timerEventNode';
|
|
213
219
|
import focusNameInputAndHighlightLabel from '@/components/modeler/focusNameInputAndHighlightLabel';
|
|
214
220
|
import XMLManager from '@/components/modeler/XMLManager';
|
|
215
|
-
import {
|
|
221
|
+
import {
|
|
222
|
+
removeBoundaryEvents,
|
|
223
|
+
removeNodeAssociations,
|
|
224
|
+
removeNodeFlows,
|
|
225
|
+
removeNodeMessageFlows,
|
|
226
|
+
removeOutgoingAndIncomingRefsToFlow,
|
|
227
|
+
removeSourceDefault,
|
|
228
|
+
} from '@/components/crown/utils';
|
|
216
229
|
import { getInvalidNodes } from '@/components/modeler/modelerUtils';
|
|
217
230
|
import { NodeMigrator } from '@/components/modeler/NodeMigrator';
|
|
218
231
|
import addLoopCharacteristics from '@/setup/addLoopCharacteristics';
|
|
@@ -330,6 +343,9 @@ export default {
|
|
|
330
343
|
showInspectorButton: true,
|
|
331
344
|
inspectorButtonRight: 65,
|
|
332
345
|
previewConfigs: [],
|
|
346
|
+
isResizingPreview: false,
|
|
347
|
+
currentCursorPosition: 0,
|
|
348
|
+
previewPanelWidth: 600,
|
|
333
349
|
flowTypes: [
|
|
334
350
|
'processmaker-modeler-sequence-flow',
|
|
335
351
|
'processmaker-modeler-message-flow',
|
|
@@ -404,6 +420,20 @@ export default {
|
|
|
404
420
|
isMultiplayer: () => store.getters.isMultiplayer,
|
|
405
421
|
},
|
|
406
422
|
methods: {
|
|
423
|
+
onStartPreviewResize(event) {
|
|
424
|
+
this.isResizingPreview = true;
|
|
425
|
+
this.currentCursorPosition = event.x;
|
|
426
|
+
},
|
|
427
|
+
onMouseUp() {
|
|
428
|
+
this.isResizingPreview = false;
|
|
429
|
+
},
|
|
430
|
+
onMouseMove(event) {
|
|
431
|
+
if (this.isResizingPreview) {
|
|
432
|
+
const dx = this.currentCursorPosition - event.x;
|
|
433
|
+
this.previewPanelWidth = parseInt(this.previewPanelWidth) + dx;
|
|
434
|
+
this.currentCursorPosition = event.x;
|
|
435
|
+
}
|
|
436
|
+
},
|
|
407
437
|
registerPreview(config) {
|
|
408
438
|
this.previewConfigs.push(config);
|
|
409
439
|
},
|
|
@@ -427,13 +457,12 @@ export default {
|
|
|
427
457
|
this.isOpenPreview = value;
|
|
428
458
|
},
|
|
429
459
|
setInspectorButtonPosition() {
|
|
430
|
-
const previewWidth = this.$refs['preview-panel'].width;
|
|
431
460
|
if (this.isOpenInspector) {
|
|
432
461
|
return;
|
|
433
462
|
}
|
|
434
463
|
|
|
435
464
|
if (this.isOpenPreview && !this.isOpenInspector) {
|
|
436
|
-
this.inspectorButtonRight = 65 +
|
|
465
|
+
this.inspectorButtonRight = 65 + this.previewPanelWidth;
|
|
437
466
|
}
|
|
438
467
|
|
|
439
468
|
if (!this.isOpenPreview && !this.isOpenInspector) {
|
|
@@ -1193,14 +1222,20 @@ export default {
|
|
|
1193
1222
|
sourceRefId = Array.isArray(node.definition.sourceRef) && node.definition.sourceRef[0]?.id;
|
|
1194
1223
|
targetRefId = node.definition.targetRef?.$parent?.$parent?.get('id');
|
|
1195
1224
|
}
|
|
1196
|
-
|
|
1225
|
+
const waypoint = [];
|
|
1226
|
+
node.diagram.waypoint.forEach(point => {
|
|
1227
|
+
waypoint.push({
|
|
1228
|
+
x: point.x,
|
|
1229
|
+
y: point.y,
|
|
1230
|
+
});
|
|
1231
|
+
});
|
|
1197
1232
|
if (sourceRefId && targetRefId) {
|
|
1198
1233
|
const flowData = {
|
|
1199
1234
|
id: node.definition.id,
|
|
1200
1235
|
type: node.type,
|
|
1201
1236
|
sourceRefId,
|
|
1202
1237
|
targetRefId,
|
|
1203
|
-
waypoint
|
|
1238
|
+
waypoint,
|
|
1204
1239
|
name: node.definition.name,
|
|
1205
1240
|
conditionExpression: null,
|
|
1206
1241
|
};
|
|
@@ -14,17 +14,23 @@ export class NodeMigrator {
|
|
|
14
14
|
if (keepOriginalName(this._nodeThatWillBeReplaced)) {
|
|
15
15
|
this._definition.name = this._nodeThatWillBeReplaced.definition.name;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
const flowNodes = [];
|
|
18
18
|
const forceNodeToRemount = definition => {
|
|
19
19
|
const shape = this._graph.getLinks().find(element => {
|
|
20
20
|
return element.component && element.component.node.definition === definition;
|
|
21
21
|
});
|
|
22
22
|
shape.component.node._modelerId += '_replaced';
|
|
23
|
+
flowNodes.push({
|
|
24
|
+
id: shape.component.node.definition.id,
|
|
25
|
+
type: shape.component.node.type,
|
|
26
|
+
name: shape.component.node.definition.name,
|
|
27
|
+
sourceRefId: shape.component.node.definition.sourceRef.id,
|
|
28
|
+
targetRefId: shape.component.node.definition.targetRef.id,
|
|
29
|
+
});
|
|
23
30
|
};
|
|
24
31
|
|
|
25
32
|
const incoming = this._nodeThatWillBeReplaced.definition.get('incoming');
|
|
26
33
|
const outgoing = this._nodeThatWillBeReplaced.definition.get('outgoing');
|
|
27
|
-
|
|
28
34
|
this._definition.get('incoming').push(...incoming);
|
|
29
35
|
this._definition.get('outgoing').push(...outgoing);
|
|
30
36
|
|
|
@@ -62,6 +68,8 @@ export class NodeMigrator {
|
|
|
62
68
|
forceNodeToRemount(flow);
|
|
63
69
|
});
|
|
64
70
|
}
|
|
71
|
+
// multiplayer hook to update the flows
|
|
72
|
+
window.ProcessMaker.EventBus.$emit('multiplayer-updateFlows', flowNodes);
|
|
65
73
|
}
|
|
66
74
|
|
|
67
75
|
_handleSequenceFlowForGateway(ref) {
|
|
@@ -133,7 +133,15 @@ export default class Multiplayer {
|
|
|
133
133
|
// Update the element in the shared array
|
|
134
134
|
Y.applyUpdate(this.yDoc, new Uint8Array(updateDoc));
|
|
135
135
|
});
|
|
136
|
-
|
|
136
|
+
this.clientIO.on('updateFlows', (payload) => {
|
|
137
|
+
const { updateDoc, updatedNodes } = payload;
|
|
138
|
+
// Update the elements in the process
|
|
139
|
+
updatedNodes.forEach((data) => {
|
|
140
|
+
this.updateFlowClient(data);
|
|
141
|
+
});
|
|
142
|
+
// Update the element in the shared array
|
|
143
|
+
Y.applyUpdate(this.yDoc, new Uint8Array(updateDoc));
|
|
144
|
+
});
|
|
137
145
|
|
|
138
146
|
window.ProcessMaker.EventBus.$on('multiplayer-addNode', ( data ) => {
|
|
139
147
|
this.addNode(data);
|
|
@@ -166,6 +174,11 @@ export default class Multiplayer {
|
|
|
166
174
|
this.updateInspectorProperty(data);
|
|
167
175
|
}
|
|
168
176
|
});
|
|
177
|
+
window.ProcessMaker.EventBus.$on('multiplayer-updateFlows', ( data ) => {
|
|
178
|
+
if (this.modeler.isMultiplayer) {
|
|
179
|
+
this.updateFlows(data);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
169
182
|
}
|
|
170
183
|
/**
|
|
171
184
|
* Sync the modeler nodes with the microservice
|
|
@@ -245,7 +258,7 @@ export default class Multiplayer {
|
|
|
245
258
|
return node;
|
|
246
259
|
}
|
|
247
260
|
removeShape(node) {
|
|
248
|
-
this.modeler.removeNodeProcedure(node,
|
|
261
|
+
this.modeler.removeNodeProcedure(node, { removeRelationships: false });
|
|
249
262
|
}
|
|
250
263
|
getRemovedNodes(array1, array2) {
|
|
251
264
|
return array1.filter(object1 => {
|
|
@@ -565,4 +578,56 @@ export default class Multiplayer {
|
|
|
565
578
|
}
|
|
566
579
|
}
|
|
567
580
|
}
|
|
581
|
+
/**
|
|
582
|
+
* Update the shared document and emit socket sign to update the flows
|
|
583
|
+
* @param {Object} data
|
|
584
|
+
*/
|
|
585
|
+
updateFlows(data){
|
|
586
|
+
data.forEach((value) => {
|
|
587
|
+
const index = this.getIndex(value.id);
|
|
588
|
+
const nodeToUpdate = this.yArray.get(index);
|
|
589
|
+
this.yDoc.transact(() => {
|
|
590
|
+
for (const key in value) {
|
|
591
|
+
if (Object.hasOwn(value, key)) {
|
|
592
|
+
nodeToUpdate.set(key, value[key]);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
});
|
|
597
|
+
// Encode the state as an update and send it to the server
|
|
598
|
+
const stateUpdate = Y.encodeStateAsUpdate(this.yDoc);
|
|
599
|
+
this.clientIO.emit('updateFlows', { updateDoc: stateUpdate, isReplaced: false });
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Update the flow client, All node refs will be updated and forced to remount
|
|
603
|
+
* @param {Object} data
|
|
604
|
+
*/
|
|
605
|
+
updateFlowClient(data) {
|
|
606
|
+
let remount = false;
|
|
607
|
+
const flow = this.getNodeById(data.id);
|
|
608
|
+
if (flow && data.sourceRefId) {
|
|
609
|
+
const sourceRef = this.getNodeById(data.sourceRefId);
|
|
610
|
+
flow.definition.set('sourceRef', sourceRef.definition);
|
|
611
|
+
const outgoing = sourceRef.definition.get('outgoing')
|
|
612
|
+
.find((element) => element.id === flow.definition.id);
|
|
613
|
+
if (!outgoing) {
|
|
614
|
+
sourceRef.definition.get('outgoing').push(...[flow.definition]);
|
|
615
|
+
}
|
|
616
|
+
remount = true;
|
|
617
|
+
}
|
|
618
|
+
if (flow && data.targetRefId) {
|
|
619
|
+
const targetRef = this.getNodeById(data.targetRefId);
|
|
620
|
+
flow.definition.set('targetRef', targetRef.definition);
|
|
621
|
+
const incoming = targetRef.definition.get('incoming')
|
|
622
|
+
.find((element) => element.id === flow.definition.id);
|
|
623
|
+
if (!incoming) {
|
|
624
|
+
targetRef.definition.get('incoming').push(...[flow.definition]);
|
|
625
|
+
}
|
|
626
|
+
remount = true;
|
|
627
|
+
}
|
|
628
|
+
if (remount) {
|
|
629
|
+
// Force Remount Flow
|
|
630
|
+
flow._modelerId += '_replaced';
|
|
631
|
+
}
|
|
632
|
+
}
|
|
568
633
|
}
|