@processmaker/modeler 1.18.4 → 1.20.1
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 +356 -88
- package/dist/modeler.common.js.map +1 -1
- package/dist/modeler.umd.js +356 -88
- package/dist/modeler.umd.js.map +1 -1
- package/dist/modeler.umd.min.js +2 -2
- package/dist/modeler.umd.min.js.map +1 -1
- package/package-lock.json +28 -28
- package/package.json +3 -3
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/crown/crownButtons/genericFlowButton.vue +1 -0
- package/src/components/crown/utils.js +122 -0
- package/src/components/modeler/XMLManager.js +35 -0
- package/src/components/nodes/dataInputAssociation/dataInputAssociation.vue +4 -1
- package/src/components/nodes/subProcess/SubProcessFormSelect.vue +56 -6
- package/src/mixins/linkConfig.js +3 -1
- package/src/setup/globals.js +6 -1
- package/src/setup/mockProcesses.json +45 -5
- package/src/store.js +2 -2
package/package-lock.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@processmaker/modeler",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.1",
|
|
4
4
|
"lockfileVersion": 1,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"dependencies": {
|
|
@@ -6077,9 +6077,9 @@
|
|
|
6077
6077
|
}
|
|
6078
6078
|
},
|
|
6079
6079
|
"vue-loader-v16": {
|
|
6080
|
-
"version": "npm:vue-loader@16.8.
|
|
6081
|
-
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.
|
|
6082
|
-
"integrity": "sha512-
|
|
6080
|
+
"version": "npm:vue-loader@16.8.3",
|
|
6081
|
+
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
|
|
6082
|
+
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
|
|
6083
6083
|
"dev": true,
|
|
6084
6084
|
"optional": true,
|
|
6085
6085
|
"requires": {
|
|
@@ -6127,9 +6127,9 @@
|
|
|
6127
6127
|
"optional": true
|
|
6128
6128
|
},
|
|
6129
6129
|
"loader-utils": {
|
|
6130
|
-
"version": "2.0.
|
|
6131
|
-
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.
|
|
6132
|
-
"integrity": "sha512-
|
|
6130
|
+
"version": "2.0.2",
|
|
6131
|
+
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
|
|
6132
|
+
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
|
|
6133
6133
|
"dev": true,
|
|
6134
6134
|
"optional": true,
|
|
6135
6135
|
"requires": {
|
|
@@ -8014,9 +8014,9 @@
|
|
|
8014
8014
|
"dev": true
|
|
8015
8015
|
},
|
|
8016
8016
|
"bpmnlint-plugin-processmaker": {
|
|
8017
|
-
"version": "1.2.
|
|
8018
|
-
"resolved": "https://registry.npmjs.org/bpmnlint-plugin-processmaker/-/bpmnlint-plugin-processmaker-1.2.
|
|
8019
|
-
"integrity": "sha512-
|
|
8017
|
+
"version": "1.2.5",
|
|
8018
|
+
"resolved": "https://registry.npmjs.org/bpmnlint-plugin-processmaker/-/bpmnlint-plugin-processmaker-1.2.5.tgz",
|
|
8019
|
+
"integrity": "sha512-Y2nJ4rC7D4bRqB7TcnjlTqcFgohif/iH7o3i/F5wMZYU2oldHS3AUL7axX2WdvIpSyT87cZOredCMbnmCfvFkw==",
|
|
8020
8020
|
"requires": {
|
|
8021
8021
|
"bpmnlint": "^7.2.1",
|
|
8022
8022
|
"bpmnlint-utils": "^1.0.1",
|
|
@@ -8039,9 +8039,9 @@
|
|
|
8039
8039
|
}
|
|
8040
8040
|
},
|
|
8041
8041
|
"bpmnlint": {
|
|
8042
|
-
"version": "7.
|
|
8043
|
-
"resolved": "https://registry.npmjs.org/bpmnlint/-/bpmnlint-7.
|
|
8044
|
-
"integrity": "sha512-
|
|
8042
|
+
"version": "7.4.0",
|
|
8043
|
+
"resolved": "https://registry.npmjs.org/bpmnlint/-/bpmnlint-7.4.0.tgz",
|
|
8044
|
+
"integrity": "sha512-Kxlen+5NUzVqQullMXewmSJsS9QI8chUSyrDX5jXcOWU8gBbwq8RbQeAnhOmFD3aQFh+bL3q8jCcseX3RHbGtA==",
|
|
8045
8045
|
"requires": {
|
|
8046
8046
|
"ansi-colors": "^4.1.1",
|
|
8047
8047
|
"bpmn-moddle": "^7.0.3",
|
|
@@ -16660,21 +16660,21 @@
|
|
|
16660
16660
|
}
|
|
16661
16661
|
},
|
|
16662
16662
|
"jointjs": {
|
|
16663
|
-
"version": "3.2
|
|
16664
|
-
"resolved": "https://registry.npmjs.org/jointjs/-/jointjs-3.2.
|
|
16665
|
-
"integrity": "sha512-
|
|
16663
|
+
"version": "3.4.2",
|
|
16664
|
+
"resolved": "https://registry.npmjs.org/jointjs/-/jointjs-3.4.2.tgz",
|
|
16665
|
+
"integrity": "sha512-iw/mOu+y2AD3lhCAQ5RloaRJH/oIWD6rtfGJ1BvhnaF6fn2Wfec/so64LTl5rwCP1IL9cQEMIuh3eth43UwwIw==",
|
|
16666
16666
|
"requires": {
|
|
16667
16667
|
"backbone": "~1.4.0",
|
|
16668
|
-
"dagre": "~0.8.
|
|
16669
|
-
"graphlib": "~2.1.
|
|
16670
|
-
"jquery": "~3.
|
|
16671
|
-
"lodash": "~4.17.
|
|
16668
|
+
"dagre": "~0.8.5",
|
|
16669
|
+
"graphlib": "~2.1.8",
|
|
16670
|
+
"jquery": "~3.6.0",
|
|
16671
|
+
"lodash": "~4.17.21"
|
|
16672
16672
|
},
|
|
16673
16673
|
"dependencies": {
|
|
16674
|
-
"
|
|
16675
|
-
"version": "
|
|
16676
|
-
"resolved": "https://registry.npmjs.org/
|
|
16677
|
-
"integrity": "sha512-
|
|
16674
|
+
"lodash": {
|
|
16675
|
+
"version": "4.17.21",
|
|
16676
|
+
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
|
16677
|
+
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
|
16678
16678
|
}
|
|
16679
16679
|
}
|
|
16680
16680
|
},
|
|
@@ -22249,7 +22249,7 @@
|
|
|
22249
22249
|
"dependencies": {
|
|
22250
22250
|
"source-map": {
|
|
22251
22251
|
"version": "0.4.4",
|
|
22252
|
-
"resolved": "
|
|
22252
|
+
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
|
|
22253
22253
|
"integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
|
|
22254
22254
|
"dev": true,
|
|
22255
22255
|
"requires": {
|
|
@@ -24315,9 +24315,9 @@
|
|
|
24315
24315
|
}
|
|
24316
24316
|
},
|
|
24317
24317
|
"underscore": {
|
|
24318
|
-
"version": "1.
|
|
24319
|
-
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.
|
|
24320
|
-
"integrity": "sha512-
|
|
24318
|
+
"version": "1.13.2",
|
|
24319
|
+
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.2.tgz",
|
|
24320
|
+
"integrity": "sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g=="
|
|
24321
24321
|
},
|
|
24322
24322
|
"unherit": {
|
|
24323
24323
|
"version": "1.1.2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@processmaker/modeler",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.1",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"serve": "vue-cli-service serve",
|
|
6
6
|
"open-cypress": "TZ=UTC cypress open",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"bootstrap-vue": "^2.0.4",
|
|
49
49
|
"bpmn-moddle": "^6.0.7",
|
|
50
50
|
"bpmnlint": "^6.4.0",
|
|
51
|
-
"bpmnlint-plugin-processmaker": "1.2.
|
|
51
|
+
"bpmnlint-plugin-processmaker": "1.2.5",
|
|
52
52
|
"core-js": "^3.7.0",
|
|
53
53
|
"file-saver": "^2.0.5",
|
|
54
54
|
"jest-junit": "^12.0.0",
|
|
55
|
-
"jointjs": "^3.2
|
|
55
|
+
"jointjs": "^3.4.2",
|
|
56
56
|
"js-yaml-loader": "^1.2.2",
|
|
57
57
|
"lodash": "^4.17.20",
|
|
58
58
|
"luxon": "^1.25.0",
|
package/src/.DS_Store
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -99,3 +99,125 @@ export function removeSourceDefault(node) {
|
|
|
99
99
|
node.definition.sourceRef.set('default', null);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
+
|
|
103
|
+
export function getOrFindDataInput(moddle, task, sourceNode) {
|
|
104
|
+
if (sourceNode.$type !== 'bpmn:DataObjectReference' && sourceNode.$type !== 'bpmn:DataStoreReference') {
|
|
105
|
+
throw 'Source node must be a DataObjectReference or bpmn:DataStoreReference, got ' + sourceNode.$type;
|
|
106
|
+
}
|
|
107
|
+
const sourceNodeId = sourceNode.id;
|
|
108
|
+
const dataInputId = `data_input_${sourceNodeId}`;
|
|
109
|
+
// Check if ioSpecification exists
|
|
110
|
+
if (!task.definition.ioSpecification) {
|
|
111
|
+
task.definition.set('ioSpecification', moddle.create('bpmn:InputOutputSpecification', {
|
|
112
|
+
dataInputs: [],
|
|
113
|
+
dataOutputs: [],
|
|
114
|
+
inputSets: [],
|
|
115
|
+
outputSets: [],
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
// Check if dataInput exists
|
|
119
|
+
if (!task.definition.ioSpecification.dataInputs) {
|
|
120
|
+
task.definition.ioSpecification.set('dataInputs', []);
|
|
121
|
+
}
|
|
122
|
+
let dataInput = task.definition.ioSpecification.dataInputs.find(input => input.id === dataInputId);
|
|
123
|
+
if (!dataInput) {
|
|
124
|
+
task.definition.ioSpecification.dataInputs.push(moddle.create('bpmn:DataInput', {
|
|
125
|
+
id: dataInputId,
|
|
126
|
+
isCollection: 'false',
|
|
127
|
+
name: sourceNode.name,
|
|
128
|
+
}));
|
|
129
|
+
task.definition.ioSpecification.set('dataInputs', task.definition.ioSpecification.dataInputs);
|
|
130
|
+
}
|
|
131
|
+
dataInput = task.definition.ioSpecification.dataInputs.find(input => input.id === dataInputId);
|
|
132
|
+
// Check if outputSet exists
|
|
133
|
+
if (!task.definition.ioSpecification.outputSets) {
|
|
134
|
+
task.definition.ioSpecification.set('outputSets', [
|
|
135
|
+
moddle.create('bpmn:OutputSet', {
|
|
136
|
+
dataInputRefs: [],
|
|
137
|
+
}),
|
|
138
|
+
]);
|
|
139
|
+
}
|
|
140
|
+
let outputSet = task.definition.ioSpecification.outputSets[0];
|
|
141
|
+
if (!outputSet) {
|
|
142
|
+
task.definition.ioSpecification.set('outputSets', [
|
|
143
|
+
moddle.create('bpmn:OutputSet', {
|
|
144
|
+
dataInputRefs: [],
|
|
145
|
+
}),
|
|
146
|
+
]);
|
|
147
|
+
}
|
|
148
|
+
outputSet = task.definition.ioSpecification.outputSets[0];
|
|
149
|
+
// Check if inputSet exists
|
|
150
|
+
if (!task.definition.ioSpecification.inputSets) {
|
|
151
|
+
task.definition.ioSpecification.set('inputSets', [
|
|
152
|
+
moddle.create('bpmn:InputSet', {
|
|
153
|
+
dataInputRefs: [],
|
|
154
|
+
}),
|
|
155
|
+
]);
|
|
156
|
+
}
|
|
157
|
+
let inputSet = task.definition.ioSpecification.inputSets[0];
|
|
158
|
+
if (!inputSet) {
|
|
159
|
+
task.definition.ioSpecification.set('inputSets', [
|
|
160
|
+
moddle.create('bpmn:InputSet', {
|
|
161
|
+
dataInputRefs: [],
|
|
162
|
+
}),
|
|
163
|
+
]);
|
|
164
|
+
}
|
|
165
|
+
inputSet = task.definition.ioSpecification.inputSets[0];
|
|
166
|
+
// Check if dataInputRef exists
|
|
167
|
+
const dataInputRef = inputSet.dataInputRefs.find(ref => ref.id === dataInputId);
|
|
168
|
+
if (!dataInputRef) {
|
|
169
|
+
inputSet.dataInputRefs.push(dataInput);
|
|
170
|
+
}
|
|
171
|
+
return dataInput;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
export function removeDataInput(task, sourceNode) {
|
|
176
|
+
if (sourceNode.$type !== 'bpmn:DataObjectReference' && sourceNode.$type !== 'bpmn:DataStoreReference') {
|
|
177
|
+
throw 'Source node must be a DataObjectReference or bpmn:DataStoreReference, got ' + sourceNode.$type;
|
|
178
|
+
}
|
|
179
|
+
const sourceNodeId = sourceNode.id;
|
|
180
|
+
const dataInputId = `data_input_${sourceNodeId}`;
|
|
181
|
+
// Check if ioSpecification exists
|
|
182
|
+
if (!task.definition.ioSpecification) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
// Check if dataInput exists
|
|
186
|
+
if (!task.definition.ioSpecification.dataInputs) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
let dataInput = task.definition.ioSpecification.dataInputs.find(input => input.id === dataInputId);
|
|
190
|
+
if (!dataInput) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
// remove dataInput from dataInputs
|
|
194
|
+
pull(task.definition.ioSpecification.dataInputs, dataInput);
|
|
195
|
+
// Check if inputSet exists
|
|
196
|
+
if (!task.definition.ioSpecification.inputSets) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
let inputSet = task.definition.ioSpecification.inputSets[0];
|
|
200
|
+
if (!inputSet) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
// Check if dataInputRef exists
|
|
204
|
+
const dataInputRef = inputSet.dataInputRefs.find(ref => ref.id === dataInputId);
|
|
205
|
+
if (dataInputRef) {
|
|
206
|
+
pull(inputSet.dataInputRefs, dataInputRef);
|
|
207
|
+
}
|
|
208
|
+
// Remove inputSets if it is empty (without any dataInputRefs)
|
|
209
|
+
if (inputSet.dataInputRefs.length === 0) {
|
|
210
|
+
delete task.definition.ioSpecification.inputSets;
|
|
211
|
+
}
|
|
212
|
+
// Remove outputSets if it is empty (without any dataOutputRefs)
|
|
213
|
+
if (task.definition.ioSpecification.outputSets) {
|
|
214
|
+
let outputSet = task.definition.ioSpecification.outputSets[0];
|
|
215
|
+
if (outputSet && (!outputSet.dataOutputRefs || outputSet.dataOutputRefs.length === 0)) {
|
|
216
|
+
delete task.definition.ioSpecification.outputSets;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// Remove ioSpecification if it is empty (without outputSets and inputSets)
|
|
220
|
+
if (!task.definition.ioSpecification.inputSets && !task.definition.ioSpecification.outputSets) {
|
|
221
|
+
delete task.definition.ioSpecification;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
@@ -23,11 +23,46 @@ export default class XMLManager {
|
|
|
23
23
|
definitions.exporter = 'ProcessMaker Modeler';
|
|
24
24
|
definitions.exporterVersion = '1.0';
|
|
25
25
|
|
|
26
|
+
// Clean broken references when loading definitions
|
|
27
|
+
this.cleanBrokenReferences(definitions);
|
|
28
|
+
|
|
26
29
|
resolve(definitions);
|
|
27
30
|
});
|
|
28
31
|
});
|
|
29
32
|
}
|
|
30
33
|
|
|
34
|
+
cleanBrokenReferences(definitions) {
|
|
35
|
+
const { rootElements, diagrams } = definitions;
|
|
36
|
+
const removed = [];
|
|
37
|
+
|
|
38
|
+
// Remove broken bpmn:SequenceFlow from bpmn:Process
|
|
39
|
+
rootElements.forEach(element => {
|
|
40
|
+
if (element.$type === 'bpmn:Process' && element.flowElements) {
|
|
41
|
+
element.flowElements = element.flowElements.filter(child => {
|
|
42
|
+
if (child.$type === 'bpmn:SequenceFlow') {
|
|
43
|
+
if (!(child.sourceRef && child.targetRef)) {
|
|
44
|
+
removed.push(child);
|
|
45
|
+
}
|
|
46
|
+
return child.sourceRef && child.targetRef;
|
|
47
|
+
}
|
|
48
|
+
return true;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Remove BPMNEdge from bpmndi:BPMNDiagram
|
|
54
|
+
diagrams.forEach(element => {
|
|
55
|
+
if (element.$type === 'bpmndi:BPMNDiagram' && element.plane && element.plane.planeElement) {
|
|
56
|
+
element.plane.planeElement = element.plane.planeElement.filter(child => {
|
|
57
|
+
if (child.$type === 'bpmndi:BPMNEdge') {
|
|
58
|
+
return child.bpmnElement && !removed.includes(child.bpmnElement);
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
31
66
|
download() {
|
|
32
67
|
if (!this.#definitions) {
|
|
33
68
|
return;
|
|
@@ -21,6 +21,7 @@ import linkConfig from '@/mixins/linkConfig';
|
|
|
21
21
|
import get from 'lodash/get';
|
|
22
22
|
import associationHead from '!!url-loader!@/assets/association-head.svg';
|
|
23
23
|
import CrownConfig from '@/components/crown/crownConfig/crownConfig';
|
|
24
|
+
import { getOrFindDataInput, removeDataInput } from '@/components/crown/utils';
|
|
24
25
|
import { pull } from 'lodash';
|
|
25
26
|
|
|
26
27
|
export default {
|
|
@@ -99,8 +100,9 @@ export default {
|
|
|
99
100
|
},
|
|
100
101
|
updateDefinitionLinks() {
|
|
101
102
|
const targetShape = this.shape.getTargetElement();
|
|
103
|
+
const dataInput = getOrFindDataInput(this.moddle, targetShape.component.node, this.sourceNode.definition);
|
|
104
|
+
this.node.definition.set('targetRef', dataInput);
|
|
102
105
|
this.node.definition.set('sourceRef', [this.sourceNode.definition]);
|
|
103
|
-
this.node.definition.set('targetRef', null);
|
|
104
106
|
targetShape.component.node.definition.set('dataInputAssociations', [this.node.definition]);
|
|
105
107
|
},
|
|
106
108
|
},
|
|
@@ -127,6 +129,7 @@ export default {
|
|
|
127
129
|
this.shape.component = this;
|
|
128
130
|
},
|
|
129
131
|
destroyed() {
|
|
132
|
+
removeDataInput(this.targetNode, this.sourceNode.definition);
|
|
130
133
|
pull(this.targetNode.definition.get('dataInputAssociations'), this.node.definition);
|
|
131
134
|
},
|
|
132
135
|
};
|
|
@@ -12,7 +12,11 @@
|
|
|
12
12
|
optionContent="name"
|
|
13
13
|
class="p-0 mb-2"
|
|
14
14
|
validation="required"
|
|
15
|
-
@
|
|
15
|
+
@search-change="searchChange"
|
|
16
|
+
:searchable="true"
|
|
17
|
+
:internal-search="false"
|
|
18
|
+
:preserve-search="true"
|
|
19
|
+
:clear-on-select="false"
|
|
16
20
|
/>
|
|
17
21
|
|
|
18
22
|
<form-multi-select
|
|
@@ -41,7 +45,6 @@
|
|
|
41
45
|
</template>
|
|
42
46
|
|
|
43
47
|
<script>
|
|
44
|
-
import store from '@/store';
|
|
45
48
|
import uniqBy from 'lodash/uniqBy';
|
|
46
49
|
|
|
47
50
|
export default {
|
|
@@ -52,18 +55,31 @@ export default {
|
|
|
52
55
|
config: {},
|
|
53
56
|
name: '',
|
|
54
57
|
loading: false ,
|
|
58
|
+
processes: [],
|
|
59
|
+
selectedProcessInfo: null,
|
|
55
60
|
};
|
|
56
61
|
},
|
|
57
62
|
inheritAttrs: false,
|
|
58
63
|
props: ['value'],
|
|
59
64
|
computed: {
|
|
60
65
|
processList() {
|
|
61
|
-
|
|
66
|
+
const list = this.filterValidProcesses(this.processes) || [];
|
|
67
|
+
if (this.selectedProcessInfo && !list.find(p => p.id === this.selectedProcessInfo.id)) {
|
|
68
|
+
list.push(this.selectedProcessInfo);
|
|
69
|
+
}
|
|
70
|
+
return list;
|
|
62
71
|
},
|
|
63
72
|
startEventList() {
|
|
64
73
|
if (!this.selectedProcess) { return []; }
|
|
65
74
|
return this.filterValidStartEvents(this.selectedProcess.events);
|
|
66
75
|
},
|
|
76
|
+
currentProcessId() {
|
|
77
|
+
const match = window.location.href.match(/modeler\/(\d+)/);
|
|
78
|
+
if (match && match[1]) {
|
|
79
|
+
return parseInt(match[1]);
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
},
|
|
67
83
|
},
|
|
68
84
|
watch: {
|
|
69
85
|
selectedProcess() {
|
|
@@ -84,15 +100,19 @@ export default {
|
|
|
84
100
|
value: {
|
|
85
101
|
handler() {
|
|
86
102
|
this.config = JSON.parse(this.value);
|
|
103
|
+
this.loadSelectedProcessInfo();
|
|
87
104
|
},
|
|
88
105
|
immediate: true,
|
|
89
106
|
},
|
|
90
107
|
},
|
|
91
108
|
methods: {
|
|
109
|
+
searchChange(filter) {
|
|
110
|
+
this.loadProcesses(filter);
|
|
111
|
+
},
|
|
92
112
|
filterValidProcesses(processes) {
|
|
93
113
|
return processes.filter(process => {
|
|
94
114
|
return this.filterValidStartEvents(process.events).length > 0;
|
|
95
|
-
});
|
|
115
|
+
}).filter(process => process.id !== this.currentProcessId);
|
|
96
116
|
},
|
|
97
117
|
filterValidStartEvents(events) {
|
|
98
118
|
return events.filter(event => {
|
|
@@ -150,8 +170,38 @@ export default {
|
|
|
150
170
|
containsMultipleProcesses(process) {
|
|
151
171
|
return uniqBy(process.events, 'ownerProcessId').length > 1;
|
|
152
172
|
},
|
|
153
|
-
loadProcesses() {
|
|
154
|
-
|
|
173
|
+
loadProcesses(filter) {
|
|
174
|
+
this.loading = true;
|
|
175
|
+
|
|
176
|
+
const params = {
|
|
177
|
+
order_direction: 'asc',
|
|
178
|
+
per_page: 20,
|
|
179
|
+
status: 'all',
|
|
180
|
+
include: 'events,category',
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
if (filter) {
|
|
184
|
+
params.filter = filter;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
window.ProcessMaker.apiClient.get('processes', {
|
|
188
|
+
params,
|
|
189
|
+
}).then(response => {
|
|
190
|
+
this.loading = false;
|
|
191
|
+
this.processes = response.data.data;
|
|
192
|
+
})
|
|
193
|
+
.catch(() => {
|
|
194
|
+
this.loading = false;
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
loadSelectedProcessInfo() {
|
|
198
|
+
if (this.config.processId) {
|
|
199
|
+
window.ProcessMaker.apiClient.get('processes/' + this.config.processId, { params: {
|
|
200
|
+
include: 'events,category',
|
|
201
|
+
} }).then(response => {
|
|
202
|
+
this.selectedProcessInfo = response.data;
|
|
203
|
+
});
|
|
204
|
+
}
|
|
155
205
|
},
|
|
156
206
|
},
|
|
157
207
|
created() {
|
package/src/mixins/linkConfig.js
CHANGED
package/src/setup/globals.js
CHANGED
|
@@ -19,8 +19,13 @@ mock.onGet(/\/processes\/\d+/).reply((config) => {
|
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
const regex = /processes\/(\d+)/g;
|
|
23
|
+
const matches = regex.exec(config.url);
|
|
24
|
+
const requestedId = matches[1];
|
|
25
|
+
const process = mockProcesses.data.find(p => p.id === parseInt(requestedId));
|
|
26
|
+
|
|
22
27
|
return new Promise((resolve) => {
|
|
23
|
-
setTimeout(() => resolve([200, { svg: mockProcessSvg }]), 1000);
|
|
28
|
+
setTimeout(() => resolve([200, { svg: mockProcessSvg, ...process }]), 1000);
|
|
24
29
|
});
|
|
25
30
|
});
|
|
26
31
|
|
|
@@ -23,7 +23,15 @@
|
|
|
23
23
|
"ownerProcessId": "ProcessId",
|
|
24
24
|
"ownerProcessName": "Process Name"
|
|
25
25
|
}
|
|
26
|
-
]
|
|
26
|
+
],
|
|
27
|
+
"category": {
|
|
28
|
+
"id": 1,
|
|
29
|
+
"name": "Uncategorized",
|
|
30
|
+
"status": "ACTIVE",
|
|
31
|
+
"is_system": 0,
|
|
32
|
+
"created_at": "2021-09-01T06:11:30-07:00",
|
|
33
|
+
"updated_at": "2021-09-01T06:11:30-07:00"
|
|
34
|
+
}
|
|
27
35
|
},
|
|
28
36
|
{
|
|
29
37
|
"id": 3,
|
|
@@ -48,7 +56,15 @@
|
|
|
48
56
|
"ownerProcessId": "ProcessId",
|
|
49
57
|
"ownerProcessName": "Process Name"
|
|
50
58
|
}
|
|
51
|
-
]
|
|
59
|
+
],
|
|
60
|
+
"category": {
|
|
61
|
+
"id": 1,
|
|
62
|
+
"name": "Uncategorized",
|
|
63
|
+
"status": "ACTIVE",
|
|
64
|
+
"is_system": 0,
|
|
65
|
+
"created_at": "2021-09-01T06:11:30-07:00",
|
|
66
|
+
"updated_at": "2021-09-01T06:11:30-07:00"
|
|
67
|
+
}
|
|
52
68
|
},
|
|
53
69
|
{
|
|
54
70
|
"id": 5,
|
|
@@ -93,7 +109,15 @@
|
|
|
93
109
|
"ownerProcessId": "Subprocess2",
|
|
94
110
|
"ownerProcessName": "Subprocess Two"
|
|
95
111
|
}
|
|
96
|
-
]
|
|
112
|
+
],
|
|
113
|
+
"category": {
|
|
114
|
+
"id": 1,
|
|
115
|
+
"name": "Uncategorized",
|
|
116
|
+
"status": "ACTIVE",
|
|
117
|
+
"is_system": 0,
|
|
118
|
+
"created_at": "2021-09-01T06:11:30-07:00",
|
|
119
|
+
"updated_at": "2021-09-01T06:11:30-07:00"
|
|
120
|
+
}
|
|
97
121
|
},
|
|
98
122
|
{
|
|
99
123
|
"id": 1,
|
|
@@ -107,7 +131,15 @@
|
|
|
107
131
|
"deleted_at": null,
|
|
108
132
|
"created_at": "2019-04-01T16:02:14+00:00",
|
|
109
133
|
"updated_at": "2019-04-02T19:11:03+00:00",
|
|
110
|
-
"events": []
|
|
134
|
+
"events": [],
|
|
135
|
+
"category": {
|
|
136
|
+
"id": 1,
|
|
137
|
+
"name": "Uncategorized",
|
|
138
|
+
"status": "ACTIVE",
|
|
139
|
+
"is_system": 0,
|
|
140
|
+
"created_at": "2021-09-01T06:11:30-07:00",
|
|
141
|
+
"updated_at": "2021-09-01T06:11:30-07:00"
|
|
142
|
+
}
|
|
111
143
|
},
|
|
112
144
|
{
|
|
113
145
|
"id": 13,
|
|
@@ -132,7 +164,15 @@
|
|
|
132
164
|
"ownerProcessId": "Subprocess1",
|
|
133
165
|
"ownerProcessName": "Subprocess One"
|
|
134
166
|
}
|
|
135
|
-
]
|
|
167
|
+
],
|
|
168
|
+
"category": {
|
|
169
|
+
"id": 1,
|
|
170
|
+
"name": "Uncategorized",
|
|
171
|
+
"status": "ACTIVE",
|
|
172
|
+
"is_system": 0,
|
|
173
|
+
"created_at": "2021-09-01T06:11:30-07:00",
|
|
174
|
+
"updated_at": "2021-09-01T06:11:30-07:00"
|
|
175
|
+
}
|
|
136
176
|
}
|
|
137
177
|
],
|
|
138
178
|
"meta": {
|
package/src/store.js
CHANGED
|
@@ -130,8 +130,8 @@ export default new Vuex.Store({
|
|
|
130
130
|
params: {
|
|
131
131
|
order_direction: 'asc',
|
|
132
132
|
per_page: 1000,
|
|
133
|
-
status: '
|
|
134
|
-
include: 'events',
|
|
133
|
+
status: 'all',
|
|
134
|
+
include: 'events,category',
|
|
135
135
|
},
|
|
136
136
|
});
|
|
137
137
|
commit('setGlobalProcesses', data.data);
|