@valtimo/process 4.15.2-next-main.8
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/bundles/valtimo-process.umd.js +459 -0
- package/bundles/valtimo-process.umd.js.map +1 -0
- package/bundles/valtimo-process.umd.min.js +2 -0
- package/bundles/valtimo-process.umd.min.js.map +1 -0
- package/esm2015/lib/process-diagram/process-diagram.component.js +256 -0
- package/esm2015/lib/process.module.js +47 -0
- package/esm2015/lib/process.service.js +123 -0
- package/esm2015/public_api.js +22 -0
- package/esm2015/valtimo-process.js +5 -0
- package/fesm2015/valtimo-process.js +442 -0
- package/fesm2015/valtimo-process.js.map +1 -0
- package/lib/process-diagram/process-diagram.component.d.ts +47 -0
- package/lib/process.module.d.ts +2 -0
- package/lib/process.service.d.ts +28 -0
- package/package.json +27 -0
- package/public_api.d.ts +3 -0
- package/valtimo-process.d.ts +4 -0
- package/valtimo-process.metadata.json +1 -0
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('@valtimo/config'), require('@angular/common'), require('@valtimo/components'), require('ngx-toastr'), require('@angular/platform-browser/animations'), require('bpmn-js/dist/bpmn-navigated-viewer.production.min.js'), require('heatmap.js-fixed/build/heatmap.js')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@valtimo/process', ['exports', '@angular/core', '@angular/common/http', '@valtimo/config', '@angular/common', '@valtimo/components', 'ngx-toastr', '@angular/platform-browser/animations', 'bpmn-js/dist/bpmn-navigated-viewer.production.min.js', 'heatmap.js-fixed/build/heatmap.js'], factory) :
|
|
4
|
+
(global = global || self, factory((global.valtimo = global.valtimo || {}, global.valtimo.process = {}), global.ng.core, global.ng.common.http, global.config, global.ng.common, global.components, global.ngxToastr, global.ng.platformBrowser.animations, global.BpmnJS, global.heatmap));
|
|
5
|
+
}(this, (function (exports, i0, i1, i2, common, components, ngxToastr, animations, BpmnJS, heatmap) { 'use strict';
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
9
|
+
*
|
|
10
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
11
|
+
* you may not use this file except in compliance with the License.
|
|
12
|
+
* You may obtain a copy of the License at
|
|
13
|
+
*
|
|
14
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
* See the License for the specific language governing permissions and
|
|
20
|
+
* limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
var ProcessService = /** @class */ (function () {
|
|
23
|
+
function ProcessService(http, configService) {
|
|
24
|
+
this.http = http;
|
|
25
|
+
this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;
|
|
26
|
+
}
|
|
27
|
+
ProcessService.prototype.getProcessDefinitions = function () {
|
|
28
|
+
return this.http.get(this.valtimoEndpointUri + "process/definition");
|
|
29
|
+
};
|
|
30
|
+
ProcessService.prototype.getProcessDefinitionVersions = function (key) {
|
|
31
|
+
return this.http.get(this.valtimoEndpointUri + "process/definition/" + key + "/versions");
|
|
32
|
+
};
|
|
33
|
+
ProcessService.prototype.getProcessDefinition = function (key) {
|
|
34
|
+
return this.http.get(this.valtimoEndpointUri + "process/definition/" + key);
|
|
35
|
+
};
|
|
36
|
+
ProcessService.prototype.getProcessDefinitionStartFormData = function (processDefinitionKey) {
|
|
37
|
+
return this.http.get(this.valtimoEndpointUri + "process/definition/" + processDefinitionKey + "/start-form");
|
|
38
|
+
};
|
|
39
|
+
ProcessService.prototype.startProcesInstance = function (key, businessKey, variables) {
|
|
40
|
+
return this.http.post(this.valtimoEndpointUri + "process/definition/" + key + "/" + businessKey + "/start", variables);
|
|
41
|
+
};
|
|
42
|
+
ProcessService.prototype.getProcessDefinitionXml = function (processDefinitionId) {
|
|
43
|
+
return this.http.get(this.valtimoEndpointUri + "process/definition/" + processDefinitionId + "/xml");
|
|
44
|
+
};
|
|
45
|
+
ProcessService.prototype.getProcessXml = function (id) {
|
|
46
|
+
return this.http.get(this.valtimoEndpointUri + "process/" + id + "/xml");
|
|
47
|
+
};
|
|
48
|
+
ProcessService.prototype.getProcessCount = function (id) {
|
|
49
|
+
return this.http.post(this.valtimoEndpointUri + "v2/process/definition/" + id + "/count", {
|
|
50
|
+
'key': id,
|
|
51
|
+
'processVariables': [{ '@type': 'boolean', 'name': 'active', 'value': true }]
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
ProcessService.prototype.getProcessHeatmapCount = function (processDefinition) {
|
|
55
|
+
return this.http.get(this.valtimoEndpointUri + "process/definition/" + processDefinition.key + "/heatmap/count?version=" + processDefinition.version);
|
|
56
|
+
};
|
|
57
|
+
ProcessService.prototype.getProcessHeatmapDuration = function (processDefinition) {
|
|
58
|
+
return this.http.get(this.valtimoEndpointUri + "process/definition/" + processDefinition.key + "/heatmap/duration?version=" + processDefinition.version);
|
|
59
|
+
};
|
|
60
|
+
ProcessService.prototype.getProcessInstances = function (key, page, size, sort) {
|
|
61
|
+
var params = new i1.HttpParams()
|
|
62
|
+
.set('page', page.toString())
|
|
63
|
+
.set('size', size.toString())
|
|
64
|
+
.set('sort', sort);
|
|
65
|
+
return this.http.post(this.valtimoEndpointUri + "v2/process/" + key + "/search", {}, { 'params': params });
|
|
66
|
+
};
|
|
67
|
+
ProcessService.prototype.getProcessInstance = function (processInstanceId) {
|
|
68
|
+
return this.http.get(this.valtimoEndpointUri + "process/" + processInstanceId, {});
|
|
69
|
+
};
|
|
70
|
+
ProcessService.prototype.getProcessInstanceTasks = function (id) {
|
|
71
|
+
return this.http.get(this.valtimoEndpointUri + "process/" + id + "/tasks", {});
|
|
72
|
+
};
|
|
73
|
+
ProcessService.prototype.getProcessInstanceVariables = function (id, variableNames) {
|
|
74
|
+
return this.http.post(this.valtimoEndpointUri + "process-instance/" + id + "/variables", variableNames);
|
|
75
|
+
};
|
|
76
|
+
ProcessService.prototype.addProcessInstancesDefaultVariablesValues = function (processInstances) {
|
|
77
|
+
var _this = this;
|
|
78
|
+
processInstances.forEach(function (processInstance) { return _this.addDefaultVariablesValues(processInstance); });
|
|
79
|
+
return processInstances;
|
|
80
|
+
};
|
|
81
|
+
ProcessService.prototype.addDefaultVariablesValues = function (processInstance) {
|
|
82
|
+
if (!processInstance['startUser']) {
|
|
83
|
+
processInstance.startUser = processInstance.startUserId;
|
|
84
|
+
}
|
|
85
|
+
if (!processInstance['processStarted']) {
|
|
86
|
+
processInstance.processStarted = processInstance.startTime;
|
|
87
|
+
}
|
|
88
|
+
if (!processInstance['processEnded']) {
|
|
89
|
+
processInstance.processEnded = processInstance.endTime;
|
|
90
|
+
}
|
|
91
|
+
if (!processInstance['active']) {
|
|
92
|
+
processInstance.active = processInstance.endTime == null;
|
|
93
|
+
}
|
|
94
|
+
return processInstance;
|
|
95
|
+
};
|
|
96
|
+
ProcessService.prototype.getInstancesStatistics = function (fromDate, toDate, processFilter) {
|
|
97
|
+
var params = new i1.HttpParams();
|
|
98
|
+
params.set('fromDate', fromDate);
|
|
99
|
+
params.set('toDate', toDate);
|
|
100
|
+
params.set('processFilter', processFilter);
|
|
101
|
+
return this.http.get(this.valtimoEndpointUri + "reporting/instancesstatistics", { 'params': params });
|
|
102
|
+
};
|
|
103
|
+
ProcessService.prototype.deployProcess = function (processXml) {
|
|
104
|
+
var formData = new FormData;
|
|
105
|
+
formData.append('file', new File([processXml], 'process.bpmn'));
|
|
106
|
+
formData.append('deployment-name', 'valtimoConsoleApp');
|
|
107
|
+
formData.append('deployment-source', 'process application');
|
|
108
|
+
return this.http.post(this.valtimoEndpointUri + "camunda-rest/engine/default/deployment/create", formData);
|
|
109
|
+
};
|
|
110
|
+
ProcessService.prototype.migrateProcess = function (processDefinition1Id, processDefinition2Id, params) {
|
|
111
|
+
return this.http.post(this.valtimoEndpointUri + "process/definition/" + processDefinition1Id + "/" + processDefinition2Id + "/migrate", params);
|
|
112
|
+
};
|
|
113
|
+
return ProcessService;
|
|
114
|
+
}());
|
|
115
|
+
ProcessService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProcessService_Factory() { return new ProcessService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(i2.ConfigService)); }, token: ProcessService, providedIn: "root" });
|
|
116
|
+
ProcessService.decorators = [
|
|
117
|
+
{ type: i0.Injectable, args: [{
|
|
118
|
+
providedIn: 'root'
|
|
119
|
+
},] }
|
|
120
|
+
];
|
|
121
|
+
ProcessService.ctorParameters = function () { return [
|
|
122
|
+
{ type: i1.HttpClient },
|
|
123
|
+
{ type: i2.ConfigService }
|
|
124
|
+
]; };
|
|
125
|
+
|
|
126
|
+
/*
|
|
127
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
128
|
+
*
|
|
129
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
130
|
+
* you may not use this file except in compliance with the License.
|
|
131
|
+
* You may obtain a copy of the License at
|
|
132
|
+
*
|
|
133
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
134
|
+
*
|
|
135
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
136
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
137
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
138
|
+
* See the License for the specific language governing permissions and
|
|
139
|
+
* limitations under the License.
|
|
140
|
+
*/
|
|
141
|
+
var ProcessDiagramComponent = /** @class */ (function () {
|
|
142
|
+
function ProcessDiagramComponent(processService) {
|
|
143
|
+
this.processService = processService;
|
|
144
|
+
this.importDone = new i0.EventEmitter();
|
|
145
|
+
this.enumHeatmapOptions = ['count', 'duration'];
|
|
146
|
+
}
|
|
147
|
+
ProcessDiagramComponent.prototype.ngOnInit = function () {
|
|
148
|
+
var _this = this;
|
|
149
|
+
if (this.processDefinitionKey) {
|
|
150
|
+
this.loadProcessDefinitionFromKey(this.processDefinitionKey);
|
|
151
|
+
}
|
|
152
|
+
if (this.processInstanceId) {
|
|
153
|
+
this.loadProcessInstanceXml(this.processInstanceId);
|
|
154
|
+
}
|
|
155
|
+
this.bpmnJS = new BpmnJS();
|
|
156
|
+
this.bpmnJS.on('import.done', function (_a) {
|
|
157
|
+
var error = _a.error;
|
|
158
|
+
if (!error) {
|
|
159
|
+
var canvas_1 = _this.bpmnJS.get('canvas'), eventBus = _this.bpmnJS.get('eventBus');
|
|
160
|
+
if (_this.processDiagram.historicActivityInstances) {
|
|
161
|
+
_this.processDiagram.historicActivityInstances.forEach(function (instance) {
|
|
162
|
+
// exclude multiInstanceBody
|
|
163
|
+
if (instance.activityType !== 'multiInstanceBody') {
|
|
164
|
+
canvas_1.addMarker(instance.activityId, instance.endTime ? 'highlight-overlay-past' : 'highlight-overlay-current');
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
canvas_1.zoom('fit-viewport', 'auto');
|
|
169
|
+
if (_this.processDefinitionVersions) {
|
|
170
|
+
eventBus.on('canvas.init', function () {
|
|
171
|
+
if (_this.showHeatmap) {
|
|
172
|
+
_this.clearHeatmap();
|
|
173
|
+
}
|
|
174
|
+
_this.loadHeatmapData();
|
|
175
|
+
});
|
|
176
|
+
eventBus.on('canvas.viewbox.changing', function () {
|
|
177
|
+
if (_this.showHeatmap) {
|
|
178
|
+
_this.clearHeatmap();
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
eventBus.on('canvas.viewbox.changed', function () {
|
|
182
|
+
_this.loadHeatmapData();
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
ProcessDiagramComponent.prototype.ngOnChanges = function () {
|
|
189
|
+
if (this.processDefinitionKey) {
|
|
190
|
+
this.loadProcessDefinitionFromKey(this.processDefinitionKey);
|
|
191
|
+
}
|
|
192
|
+
else if (this.processInstanceId) {
|
|
193
|
+
this.loadProcessInstanceXml(this.processInstanceId);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
ProcessDiagramComponent.prototype.ngOnDestroy = function () {
|
|
197
|
+
if (this.bpmnJS) {
|
|
198
|
+
this.bpmnJS.destroy();
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
ProcessDiagramComponent.prototype.loadProcessDefinition = function (processDefinitionKey) {
|
|
202
|
+
var _this = this;
|
|
203
|
+
this.processService.getProcessDefinition(processDefinitionKey).subscribe(function (response) {
|
|
204
|
+
_this.heatmapOption = _this.enumHeatmapOptions[0];
|
|
205
|
+
_this.version = response.version;
|
|
206
|
+
_this.loadProcessDefinitionXml(response.id);
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
ProcessDiagramComponent.prototype.loadProcessDefinitionVersions = function (processDefinitionKey) {
|
|
210
|
+
var _this = this;
|
|
211
|
+
this.processService.getProcessDefinitionVersions(processDefinitionKey).subscribe(function (response) {
|
|
212
|
+
_this.processDefinitionVersions = response;
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
ProcessDiagramComponent.prototype.loadProcessDefinitionFromKey = function (processDefinitionKey) {
|
|
216
|
+
this.loadProcessDefinitionVersions(processDefinitionKey);
|
|
217
|
+
this.loadProcessDefinition(processDefinitionKey);
|
|
218
|
+
};
|
|
219
|
+
ProcessDiagramComponent.prototype.loadProcessDefinitionXml = function (processDefinitionId) {
|
|
220
|
+
var _this = this;
|
|
221
|
+
this.processService.getProcessDefinitionXml(processDefinitionId).subscribe(function (response) {
|
|
222
|
+
_this.processDiagram = response;
|
|
223
|
+
_this.bpmnJS.importXML(_this.processDiagram.bpmn20Xml);
|
|
224
|
+
_this.bpmnJS.attachTo(_this.el.nativeElement);
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
ProcessDiagramComponent.prototype.loadProcessInstanceXml = function (processInstanceId) {
|
|
228
|
+
var _this = this;
|
|
229
|
+
this.processService.getProcessXml(processInstanceId).subscribe(function (response) {
|
|
230
|
+
_this.processDiagram = response;
|
|
231
|
+
_this.bpmnJS.importXML(_this.processDiagram.bpmn20Xml);
|
|
232
|
+
_this.bpmnJS.attachTo(_this.el.nativeElement);
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
ProcessDiagramComponent.prototype.loadProcessDefinitionHeatmapCount = function (processDefinition) {
|
|
236
|
+
var _this = this;
|
|
237
|
+
this.processService.getProcessHeatmapCount(processDefinition).subscribe(function (response) {
|
|
238
|
+
_this.inputData = response;
|
|
239
|
+
_this.valueKey = 'totalCount';
|
|
240
|
+
_this.heatPoints = { data: [] };
|
|
241
|
+
_this.min = 0;
|
|
242
|
+
_this.max = 0;
|
|
243
|
+
Object.keys(_this.inputData).forEach(function (key) {
|
|
244
|
+
var diagramContainer = _this.el.nativeElement.querySelector('svg')
|
|
245
|
+
.getBoundingClientRect(), diagramElm = _this.el.nativeElement.querySelector("g[data-element-id=" + key + "]")
|
|
246
|
+
.getBoundingClientRect();
|
|
247
|
+
_this.setMax(key);
|
|
248
|
+
_this.heatPoints.data.push({
|
|
249
|
+
x: Math.round(diagramElm.x - diagramContainer.x + diagramElm.width / 2),
|
|
250
|
+
y: Math.round(diagramElm.y - diagramContainer.y + diagramElm.height / 2),
|
|
251
|
+
value: _this.inputData[key][_this.valueKey],
|
|
252
|
+
radius: diagramElm.width / 2
|
|
253
|
+
});
|
|
254
|
+
_this.addCounterActiveOverlays(key, _this.inputData);
|
|
255
|
+
});
|
|
256
|
+
_this.clearHeatmap();
|
|
257
|
+
if (_this.showHeatmap) {
|
|
258
|
+
_this.loadHeatmap();
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
};
|
|
262
|
+
ProcessDiagramComponent.prototype.onWindowResize = function () {
|
|
263
|
+
var oldCanvas = this.el.nativeElement.querySelector('canvas[class=heatmap-canvas]');
|
|
264
|
+
if (oldCanvas) {
|
|
265
|
+
oldCanvas.remove();
|
|
266
|
+
this.heatMapInstance = null;
|
|
267
|
+
}
|
|
268
|
+
if (this.showHeatmap) {
|
|
269
|
+
this.loadHeatmap();
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
ProcessDiagramComponent.prototype.loadProcessDefinitionHeatmapDuration = function (processDefinition) {
|
|
273
|
+
var _this = this;
|
|
274
|
+
this.processService.getProcessHeatmapDuration(processDefinition).subscribe(function (response) {
|
|
275
|
+
_this.inputData = response;
|
|
276
|
+
_this.valueKey = 'averageDurationInMilliseconds';
|
|
277
|
+
_this.heatPoints = { data: [] };
|
|
278
|
+
_this.min = 0;
|
|
279
|
+
_this.max = 0;
|
|
280
|
+
Object.keys(_this.inputData).forEach(function (key) {
|
|
281
|
+
var diagramContainer = _this.el.nativeElement.querySelector('svg')
|
|
282
|
+
.getBoundingClientRect(), diagramElm = _this.el.nativeElement.querySelector("g[data-element-id=" + key + "]")
|
|
283
|
+
.getBoundingClientRect();
|
|
284
|
+
_this.setMax(key);
|
|
285
|
+
_this.heatPoints.data.push({
|
|
286
|
+
x: Math.round(diagramElm.x - diagramContainer.x + diagramElm.width / 2),
|
|
287
|
+
y: Math.round(diagramElm.y - diagramContainer.y + diagramElm.height / 2),
|
|
288
|
+
value: _this.inputData[key][_this.valueKey],
|
|
289
|
+
radius: diagramElm.width / 2
|
|
290
|
+
});
|
|
291
|
+
_this.addCounterActiveOverlays(key, _this.inputData);
|
|
292
|
+
});
|
|
293
|
+
_this.clearHeatmap();
|
|
294
|
+
if (_this.showHeatmap) {
|
|
295
|
+
_this.loadHeatmap();
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
};
|
|
299
|
+
ProcessDiagramComponent.prototype.setProcessDefinitionKey = function (processDefinitionKey) {
|
|
300
|
+
this.processDefinitionKey = processDefinitionKey;
|
|
301
|
+
this.loadProcessDefinitionFromKey(this.processDefinitionKey);
|
|
302
|
+
};
|
|
303
|
+
ProcessDiagramComponent.prototype.setProcessDefinitionVersion = function (version) {
|
|
304
|
+
this.version = +version;
|
|
305
|
+
this.loadHeatmapData();
|
|
306
|
+
};
|
|
307
|
+
ProcessDiagramComponent.prototype.setHeatmapOption = function (heatmapOption) {
|
|
308
|
+
this.heatmapOption = heatmapOption;
|
|
309
|
+
this.loadHeatmapData();
|
|
310
|
+
};
|
|
311
|
+
ProcessDiagramComponent.prototype.toggleShowHeatmap = function () {
|
|
312
|
+
this.showHeatmap = !this.showHeatmap;
|
|
313
|
+
this.loadHeatmapData();
|
|
314
|
+
};
|
|
315
|
+
ProcessDiagramComponent.prototype.loadHeatmap = function () {
|
|
316
|
+
if (!this.heatMapInstance) {
|
|
317
|
+
this.heatMapInstance = heatmap.create({
|
|
318
|
+
radius: 54,
|
|
319
|
+
blur: .70,
|
|
320
|
+
maxOpacity: .4,
|
|
321
|
+
minOpacity: 0,
|
|
322
|
+
container: this.el.nativeElement
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
this.heatMapInstance.setData({
|
|
326
|
+
min: this.min,
|
|
327
|
+
max: this.max,
|
|
328
|
+
data: this.heatPoints.data
|
|
329
|
+
});
|
|
330
|
+
};
|
|
331
|
+
ProcessDiagramComponent.prototype.clearHeatmap = function () {
|
|
332
|
+
if (this.heatMapInstance) {
|
|
333
|
+
this.heatMapInstance.setData({ data: [] });
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
ProcessDiagramComponent.prototype.loadHeatmapData = function () {
|
|
337
|
+
var _this = this;
|
|
338
|
+
this.processDefinition = this.processDefinitionVersions.find(function (definition) { return definition.version === _this.version; });
|
|
339
|
+
if (this.heatmapOption === 'count') {
|
|
340
|
+
this.loadProcessDefinitionHeatmapCount(this.processDefinition);
|
|
341
|
+
}
|
|
342
|
+
if (this.heatmapOption === 'duration') {
|
|
343
|
+
this.loadProcessDefinitionHeatmapDuration(this.processDefinition);
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
ProcessDiagramComponent.prototype.setMax = function (key) {
|
|
347
|
+
if (this.heatmapDuration) {
|
|
348
|
+
this.max = Math.max(this.heatmapDuration[key].averageDurationInMilliseconds, this.max);
|
|
349
|
+
}
|
|
350
|
+
else if (this.heatmapCount) {
|
|
351
|
+
this.max = Math.max(this.heatmapCount[key].totalCount + this.heatmapCount[key].count, this.max);
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
ProcessDiagramComponent.prototype.addCounterActiveOverlays = function (key, inputData) {
|
|
355
|
+
var overlays = this.bpmnJS.get('overlays');
|
|
356
|
+
overlays.add(key, {
|
|
357
|
+
position: {
|
|
358
|
+
bottom: 13,
|
|
359
|
+
left: -12
|
|
360
|
+
},
|
|
361
|
+
show: {
|
|
362
|
+
minZoom: 0,
|
|
363
|
+
maxZoom: 5.0
|
|
364
|
+
},
|
|
365
|
+
html: "<span class=\"badge badge-pill badge-primary\">" + inputData[key].count + "</span>"
|
|
366
|
+
});
|
|
367
|
+
};
|
|
368
|
+
return ProcessDiagramComponent;
|
|
369
|
+
}());
|
|
370
|
+
ProcessDiagramComponent.decorators = [
|
|
371
|
+
{ type: i0.Component, args: [{
|
|
372
|
+
selector: 'valtimo-process-diagram',
|
|
373
|
+
template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<div class=\"process-diagram-container\">\n <div *ngIf=\"processDefinitionKey\" class=\"diagram-container-switch-holder\" >\n <div class=\"container-fluid\">\n <div class=\"row p-4 bg-light\">\n <div class=\"col-4\">\n <label><strong>Version</strong></label><br />\n <select class=\"form-control\" (change)=\"setProcessDefinitionVersion($event.target.value)\">\n <option *ngFor=\"let processDefinitionVersion of processDefinitionVersions\"\n [value]=\"processDefinitionVersion.version\"\n [selected]=\"processDefinitionVersion.version === version\">\n {{ processDefinitionVersion.version }}\n </option>\n </select>\n </div>\n <div class=\"col-4\">\n <label><strong>Heatmap type</strong></label><br />\n <select class=\"form-control\" (change)=\"setHeatmapOption($event.target.value)\">\n <option *ngFor=\"let option of enumHeatmapOptions\"\n [value]=\"option\"\n [selected]=\"option === heatmapOption\" >\n {{ option }}\n </option>\n </select>\n </div>\n <div class=\"col-4 text-right\">\n <label><strong>Show heatmap</strong></label><br />\n <div class=\"text-left switch-button switch-button-sm switch-button-success\">\n <input type=\"checkbox\" id=\"toggleHeatmap\" [checked]=\"showHeatmap\" (click)=\"toggleShowHeatmap()\"><span>\n <label for=\"toggleHeatmap\"></label></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div #ref (window:resize)=\"onWindowResize()\" class=\"diagram-container\"></div>\n\n <div *ngIf=\"processInstanceId\" class=\"p-4 text-center legenda-holder\">\n <span><div class=\"legenda highlight-overlay-past\"></div> Executed tasks</span>\n <span class=\"ml-3\"><div class=\"legenda highlight-overlay-current\"></div> Current tasks</span>\n </div>\n\n <div *ngIf=\"processDefinitionKey\" class=\"p-4 text-center legenda-holder\">\n <span><span class=\"badge badge-pill badge-primary\">N</span> Amount of currently active instances of this task.</span>\n <span> | Red/yellow/green orbs: The amount of times the task is executed in comparison to the other tasks.</span>\n </div>\n</div>\n",
|
|
374
|
+
encapsulation: i0.ViewEncapsulation.None,
|
|
375
|
+
styles: [".process-diagram-container .diagram-container{height:50vh;width:100%}.process-diagram-container .diagram-container-switch-holder{position:absolute;width:100%;z-index:1000}.process-diagram-container .highlight-overlay-past:not(.djs-connection) .djs-visual>:first-child{fill:#d8d8d8!important}.process-diagram-container .highlight-overlay-current:not(.djs-connection) .djs-visual>:first-child{fill:#b2e0ff!important}.process-diagram-container .legenda-holder{font-size:1em}.process-diagram-container .legenda{border:2px solid #000;border-radius:3px;display:inline-block;margin-bottom:-4px;margin-right:5px;padding:7px}.process-diagram-container .legenda.highlight-overlay-past{background-color:#d8d8d8}.process-diagram-container .legenda.highlight-overlay-current{background-color:#b2e0ff}"]
|
|
376
|
+
},] }
|
|
377
|
+
];
|
|
378
|
+
ProcessDiagramComponent.ctorParameters = function () { return [
|
|
379
|
+
{ type: ProcessService }
|
|
380
|
+
]; };
|
|
381
|
+
ProcessDiagramComponent.propDecorators = {
|
|
382
|
+
el: [{ type: i0.ViewChild, args: ['ref', { static: true },] }],
|
|
383
|
+
importDone: [{ type: i0.Output }],
|
|
384
|
+
processDefinitionKey: [{ type: i0.Input }],
|
|
385
|
+
processInstanceId: [{ type: i0.Input }]
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
/*
|
|
389
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
390
|
+
*
|
|
391
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
392
|
+
* you may not use this file except in compliance with the License.
|
|
393
|
+
* You may obtain a copy of the License at
|
|
394
|
+
*
|
|
395
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
396
|
+
*
|
|
397
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
398
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
399
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
400
|
+
* See the License for the specific language governing permissions and
|
|
401
|
+
* limitations under the License.
|
|
402
|
+
*/
|
|
403
|
+
var ProcessModule = /** @class */ (function () {
|
|
404
|
+
function ProcessModule() {
|
|
405
|
+
}
|
|
406
|
+
return ProcessModule;
|
|
407
|
+
}());
|
|
408
|
+
ProcessModule.decorators = [
|
|
409
|
+
{ type: i0.NgModule, args: [{
|
|
410
|
+
declarations: [
|
|
411
|
+
ProcessDiagramComponent
|
|
412
|
+
],
|
|
413
|
+
imports: [
|
|
414
|
+
common.CommonModule,
|
|
415
|
+
components.ListModule,
|
|
416
|
+
components.WidgetModule,
|
|
417
|
+
components.TimelineModule,
|
|
418
|
+
components.BpmnJsDiagramModule,
|
|
419
|
+
components.CamundaFormModule,
|
|
420
|
+
animations.BrowserAnimationsModule,
|
|
421
|
+
ngxToastr.ToastrModule.forRoot({
|
|
422
|
+
positionClass: 'toast-bottom-full-width',
|
|
423
|
+
preventDuplicates: true
|
|
424
|
+
})
|
|
425
|
+
],
|
|
426
|
+
exports: [
|
|
427
|
+
ProcessDiagramComponent
|
|
428
|
+
],
|
|
429
|
+
},] }
|
|
430
|
+
];
|
|
431
|
+
|
|
432
|
+
/*
|
|
433
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
434
|
+
*
|
|
435
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
436
|
+
* you may not use this file except in compliance with the License.
|
|
437
|
+
* You may obtain a copy of the License at
|
|
438
|
+
*
|
|
439
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
440
|
+
*
|
|
441
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
442
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
443
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
444
|
+
* See the License for the specific language governing permissions and
|
|
445
|
+
* limitations under the License.
|
|
446
|
+
*/
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Generated bundle index. Do not edit.
|
|
450
|
+
*/
|
|
451
|
+
|
|
452
|
+
exports.ProcessDiagramComponent = ProcessDiagramComponent;
|
|
453
|
+
exports.ProcessModule = ProcessModule;
|
|
454
|
+
exports.ProcessService = ProcessService;
|
|
455
|
+
|
|
456
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
457
|
+
|
|
458
|
+
})));
|
|
459
|
+
//# sourceMappingURL=valtimo-process.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valtimo-process.umd.js","sources":["../../../../projects/valtimo/process/src/lib/process.service.ts","../../../../projects/valtimo/process/src/lib/process-diagram/process-diagram.component.ts","../../../../projects/valtimo/process/src/lib/process.module.ts","../../../../projects/valtimo/process/src/public_api.ts","../../../../projects/valtimo/process/src/valtimo-process.ts"],"sourcesContent":["/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\nimport {HttpClient, HttpParams} from '@angular/common/http';\nimport {Observable} from 'rxjs';\nimport {ProcessDefinition, ProcessDefinitionStartForm, ProcessInstance, ProcessInstanceTask, ProcessStart} from '@valtimo/contract';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ProcessService {\n private valtimoEndpointUri: string;\n\n constructor(\n private http: HttpClient,\n configService: ConfigService\n ) {\n this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;\n }\n\n getProcessDefinitions(): Observable<ProcessDefinition[]> {\n return this.http.get<ProcessDefinition[]>(`${this.valtimoEndpointUri}process/definition`);\n }\n\n getProcessDefinitionVersions(key: string): Observable<ProcessDefinition[]> {\n return this.http.get<ProcessDefinition[]>(`${this.valtimoEndpointUri}process/definition/${key}/versions`);\n }\n\n getProcessDefinition(key: string): Observable<ProcessDefinition> {\n return this.http.get<ProcessDefinition>(`${this.valtimoEndpointUri}process/definition/${key}`);\n }\n\n getProcessDefinitionStartFormData(processDefinitionKey: string): Observable<ProcessDefinitionStartForm> {\n return this.http.get<ProcessDefinitionStartForm>(`${this.valtimoEndpointUri}process/definition/${processDefinitionKey}/start-form`);\n }\n\n startProcesInstance(key: string, businessKey: string, variables: Map<string, any>): Observable<any> {\n return this.http.post<ProcessStart>(\n `${this.valtimoEndpointUri}process/definition/${key}/${businessKey}/start`, variables\n );\n }\n\n getProcessDefinitionXml(processDefinitionId: string): Observable<any> {\n return this.http.get(`${this.valtimoEndpointUri}process/definition/${processDefinitionId}/xml`);\n }\n\n getProcessXml(id: string): Observable<any> {\n return this.http.get(`${this.valtimoEndpointUri}process/${id}/xml`);\n }\n\n getProcessCount(id: string): Observable<any> {\n return this.http.post(`${this.valtimoEndpointUri}v2/process/definition/${id}/count`, {\n 'key': id,\n 'processVariables': [{'@type': 'boolean', 'name': 'active', 'value': true}]\n });\n }\n\n getProcessHeatmapCount(processDefinition: ProcessDefinition): Observable<any[]> {\n return this.http.get<any[]>(\n `${this.valtimoEndpointUri}process/definition/${processDefinition.key}/heatmap/count?version=${processDefinition.version}`\n );\n }\n\n getProcessHeatmapDuration(processDefinition: ProcessDefinition): Observable<any[]> {\n return this.http.get<any[]>(\n `${this.valtimoEndpointUri}process/definition/${processDefinition.key}/heatmap/duration?version=${processDefinition.version}`\n );\n }\n\n getProcessInstances(key: string, page: number, size: number, sort: string): Observable<any> {\n const params = new HttpParams()\n .set('page', page.toString())\n .set('size', size.toString())\n .set('sort', sort);\n\n return this.http.post<ProcessInstance>(`${this.valtimoEndpointUri}v2/process/${key}/search`, {}, {'params': params});\n }\n\n getProcessInstance(processInstanceId: string): Observable<ProcessInstance> {\n return this.http.get<ProcessInstance>(`${this.valtimoEndpointUri}process/${processInstanceId}`, {});\n }\n\n getProcessInstanceTasks(id: string): Observable<ProcessInstanceTask[]> {\n return this.http.get<ProcessInstanceTask[]>(`${this.valtimoEndpointUri}process/${id}/tasks`, {});\n }\n\n getProcessInstanceVariables(id: string, variableNames: Array<any>): Observable<any> {\n return this.http.post(`${this.valtimoEndpointUri}process-instance/${id}/variables`, variableNames);\n }\n\n addProcessInstancesDefaultVariablesValues(processInstances: Array<any>) {\n processInstances.forEach(processInstance => this.addDefaultVariablesValues(processInstance));\n return processInstances;\n }\n\n addDefaultVariablesValues(processInstance: any) {\n if (!processInstance['startUser']) {\n processInstance.startUser = processInstance.startUserId;\n }\n if (!processInstance['processStarted']) {\n processInstance.processStarted = processInstance.startTime;\n }\n if (!processInstance['processEnded']) {\n processInstance.processEnded = processInstance.endTime;\n }\n if (!processInstance['active']) {\n processInstance.active = processInstance.endTime == null;\n }\n return processInstance;\n }\n\n getInstancesStatistics(fromDate?: string, toDate?: string, processFilter?: string) {\n const params = new HttpParams();\n params.set('fromDate', fromDate);\n params.set('toDate', toDate);\n params.set('processFilter', processFilter);\n return this.http.get<any[]>(\n `${this.valtimoEndpointUri}reporting/instancesstatistics`, {'params': params}\n );\n }\n\n deployProcess(processXml: string) {\n const formData = new FormData;\n formData.append('file', new File([processXml], 'process.bpmn'));\n formData.append('deployment-name', 'valtimoConsoleApp');\n formData.append('deployment-source', 'process application');\n return this.http.post(`${this.valtimoEndpointUri}camunda-rest/engine/default/deployment/create`, formData);\n }\n\n migrateProcess(processDefinition1Id: string, processDefinition2Id: string, params: any): Observable<any> {\n return this.http.post(`${this.valtimoEndpointUri}process/definition/${processDefinition1Id}/${processDefinition2Id}/migrate`, params);\n }\n\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport {ProcessService} from '../process.service';\n\nimport * as BpmnJS from 'bpmn-js/dist/bpmn-navigated-viewer.production.min.js';\nimport * as heatmap from 'heatmap.js-fixed/build/heatmap.js';\n\n@Component({\n selector: 'valtimo-process-diagram',\n templateUrl: './process-diagram.component.html',\n styleUrls: ['./process-diagram.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class ProcessDiagramComponent implements OnInit, OnDestroy, OnChanges {\n\n private bpmnJS: BpmnJS;\n private heatMapInstance: any;\n\n @ViewChild('ref', { static: true }) public el: ElementRef;\n @Output() public importDone: EventEmitter<any> = new EventEmitter();\n @Input() public processDefinitionKey?: string;\n @Input() public processInstanceId?: string;\n\n public processDiagram: any;\n public processDefinition: any;\n public processDefinitionVersions: any;\n public heatmapCount: any;\n public heatmapDuration: any;\n public tasksCount: any;\n public showHeatmap: boolean;\n public enumHeatmapOptions = ['count', 'duration'];\n public heatmapOption: string;\n public version: any;\n public heatPoints: any;\n public min: number;\n public max: number;\n public inputData: any;\n public valueKey: any;\n\n constructor(\n private processService: ProcessService,\n ) { }\n\n ngOnInit() {\n if (this.processDefinitionKey) {\n this.loadProcessDefinitionFromKey(this.processDefinitionKey);\n }\n if (this.processInstanceId) {\n this.loadProcessInstanceXml(this.processInstanceId);\n }\n this.bpmnJS = new BpmnJS();\n this.bpmnJS.on('import.done', ({error}) => {\n if (!error) {\n const canvas = this.bpmnJS.get('canvas')\n , eventBus = this.bpmnJS.get('eventBus');\n if (this.processDiagram.historicActivityInstances) {\n this.processDiagram.historicActivityInstances.forEach(instance => {\n // exclude multiInstanceBody\n if (instance.activityType !== 'multiInstanceBody') {\n canvas.addMarker(instance.activityId, instance.endTime ? 'highlight-overlay-past' : 'highlight-overlay-current');\n }\n });\n }\n\n canvas.zoom('fit-viewport', 'auto');\n if (this.processDefinitionVersions) {\n eventBus.on('canvas.init', () => {\n if (this.showHeatmap) {\n this.clearHeatmap();\n }\n this.loadHeatmapData();\n });\n eventBus.on('canvas.viewbox.changing', () => {\n if (this.showHeatmap) {\n this.clearHeatmap();\n }\n });\n eventBus.on('canvas.viewbox.changed', () => {\n this.loadHeatmapData();\n });\n }\n }\n });\n }\n\n ngOnChanges(): void {\n if (this.processDefinitionKey) {\n this.loadProcessDefinitionFromKey(this.processDefinitionKey);\n } else if (this.processInstanceId) {\n this.loadProcessInstanceXml(this.processInstanceId);\n }\n }\n\n ngOnDestroy() {\n if (this.bpmnJS) {\n this.bpmnJS.destroy();\n }\n }\n\n public loadProcessDefinition(processDefinitionKey) {\n this.processService.getProcessDefinition(processDefinitionKey).subscribe(response => {\n this.heatmapOption = this.enumHeatmapOptions[0];\n this.version = response.version;\n this.loadProcessDefinitionXml(response.id);\n });\n }\n\n public loadProcessDefinitionVersions(processDefinitionKey) {\n this.processService.getProcessDefinitionVersions(processDefinitionKey).subscribe(response => {\n this.processDefinitionVersions = response;\n });\n }\n\n public loadProcessDefinitionFromKey(processDefinitionKey) {\n this.loadProcessDefinitionVersions(processDefinitionKey);\n this.loadProcessDefinition(processDefinitionKey);\n }\n\n public loadProcessDefinitionXml(processDefinitionId) {\n this.processService.getProcessDefinitionXml(processDefinitionId).subscribe(response => {\n this.processDiagram = response;\n this.bpmnJS.importXML(this.processDiagram.bpmn20Xml);\n this.bpmnJS.attachTo(this.el.nativeElement);\n });\n }\n\n private loadProcessInstanceXml(processInstanceId) {\n this.processService.getProcessXml(processInstanceId).subscribe(response => {\n this.processDiagram = response;\n this.bpmnJS.importXML(this.processDiagram.bpmn20Xml);\n this.bpmnJS.attachTo(this.el.nativeElement);\n });\n }\n\n public loadProcessDefinitionHeatmapCount(processDefinition) {\n this.processService.getProcessHeatmapCount(processDefinition).subscribe(response => {\n this.inputData = response;\n this.valueKey = 'totalCount';\n this.heatPoints = {data: []};\n this.min = 0;\n this.max = 0;\n\n Object.keys(this.inputData).forEach(key => {\n const diagramContainer = this.el.nativeElement.querySelector('svg')\n .getBoundingClientRect(),\n diagramElm = this.el.nativeElement.querySelector(`g[data-element-id=${key}]`)\n .getBoundingClientRect();\n this.setMax(key);\n this.heatPoints.data.push({\n x: Math.round(diagramElm.x - diagramContainer.x + diagramElm.width / 2),\n y: Math.round(diagramElm.y - diagramContainer.y + diagramElm.height / 2),\n value: this.inputData[key][this.valueKey],\n radius: diagramElm.width / 2\n });\n this.addCounterActiveOverlays(key, this.inputData);\n\n });\n this.clearHeatmap();\n if (this.showHeatmap) {\n this.loadHeatmap();\n }\n });\n }\n\n public onWindowResize() {\n const oldCanvas = this.el.nativeElement.querySelector('canvas[class=heatmap-canvas]');\n if (oldCanvas) {\n oldCanvas.remove();\n this.heatMapInstance = null;\n }\n if (this.showHeatmap) {\n this.loadHeatmap();\n }\n }\n\n public loadProcessDefinitionHeatmapDuration(processDefinition) {\n this.processService.getProcessHeatmapDuration(processDefinition).subscribe(response => {\n this.inputData = response;\n this.valueKey = 'averageDurationInMilliseconds';\n this.heatPoints = {data: []};\n this.min = 0;\n this.max = 0;\n\n Object.keys(this.inputData).forEach(key => {\n const diagramContainer = this.el.nativeElement.querySelector('svg')\n .getBoundingClientRect(),\n diagramElm = this.el.nativeElement.querySelector(`g[data-element-id=${key}]`)\n .getBoundingClientRect();\n this.setMax(key);\n this.heatPoints.data.push({\n x: Math.round(diagramElm.x - diagramContainer.x + diagramElm.width / 2),\n y: Math.round(diagramElm.y - diagramContainer.y + diagramElm.height / 2),\n value: this.inputData[key][this.valueKey],\n radius: diagramElm.width / 2\n });\n this.addCounterActiveOverlays(key, this.inputData);\n });\n this.clearHeatmap();\n if (this.showHeatmap) {\n this.loadHeatmap();\n }\n });\n }\n\n public setProcessDefinitionKey(processDefinitionKey) {\n this.processDefinitionKey = processDefinitionKey;\n this.loadProcessDefinitionFromKey(this.processDefinitionKey);\n }\n\n public setProcessDefinitionVersion(version) {\n this.version = +version;\n this.loadHeatmapData();\n }\n\n public setHeatmapOption(heatmapOption) {\n this.heatmapOption = heatmapOption;\n this.loadHeatmapData();\n }\n\n public toggleShowHeatmap() {\n this.showHeatmap = !this.showHeatmap;\n this.loadHeatmapData();\n }\n\n public loadHeatmap() {\n if (!this.heatMapInstance) {\n this.heatMapInstance = heatmap.create({\n radius: 54,\n blur: .70,\n maxOpacity: .4,\n minOpacity: 0,\n container: this.el.nativeElement\n });\n }\n this.heatMapInstance.setData({\n min: this.min,\n max: this.max,\n data: this.heatPoints.data\n });\n }\n\n public clearHeatmap() {\n if (this.heatMapInstance) {\n this.heatMapInstance.setData({data: []});\n }\n }\n\n public loadHeatmapData() {\n this.processDefinition = this.processDefinitionVersions.find(definition => definition.version === this.version);\n\n if (this.heatmapOption === 'count') {\n this.loadProcessDefinitionHeatmapCount(this.processDefinition);\n }\n if (this.heatmapOption === 'duration') {\n this.loadProcessDefinitionHeatmapDuration(this.processDefinition);\n }\n }\n\n public setMax(key: any) {\n if (this.heatmapDuration) {\n this.max = Math.max(this.heatmapDuration[key].averageDurationInMilliseconds, this.max);\n } else if (this.heatmapCount) {\n this.max = Math.max(this.heatmapCount[key].totalCount + this.heatmapCount[key].count, this.max);\n }\n }\n\n public addCounterActiveOverlays(key: any, inputData: any) {\n const overlays = this.bpmnJS.get('overlays');\n overlays.add(key, {\n position: {\n bottom: 13,\n left: -12\n },\n show: {\n minZoom: 0,\n maxZoom: 5.0\n },\n html: `<span class=\"badge badge-pill badge-primary\">${inputData[key].count}</span>`\n });\n }\n\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {BpmnJsDiagramModule, CamundaFormModule, ListModule, TimelineModule, WidgetModule} from '@valtimo/components';\nimport {ToastrModule} from 'ngx-toastr';\nimport {BrowserAnimationsModule} from '@angular/platform-browser/animations';\nimport {ProcessDiagramComponent} from './process-diagram/process-diagram.component';\n\n@NgModule({\n declarations: [\n ProcessDiagramComponent\n ],\n imports: [\n CommonModule,\n ListModule,\n WidgetModule,\n TimelineModule,\n BpmnJsDiagramModule,\n CamundaFormModule,\n BrowserAnimationsModule,\n ToastrModule.forRoot({\n positionClass: 'toast-bottom-full-width',\n preventDuplicates: true\n })\n ],\n exports: [\n ProcessDiagramComponent\n ],\n})\n\nexport class ProcessModule {\n\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of process\n */\n\nexport * from './lib/process.service';\nexport * from './lib/process.module';\nexport * from './lib/process-diagram/process-diagram.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["HttpParams","Injectable","HttpClient","ConfigService","EventEmitter","heatmap.create","Component","ViewEncapsulation","ViewChild","Output","Input","NgModule","CommonModule","ListModule","WidgetModule","TimelineModule","BpmnJsDiagramModule","CamundaFormModule","BrowserAnimationsModule","ToastrModule"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;;;QA4BE,wBACU,IAAgB,EACxB,aAA4B;YADpB,SAAI,GAAJ,IAAI,CAAY;YAGxB,IAAI,CAAC,kBAAkB,GAAG,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC;SACvE;QAED,8CAAqB,GAArB;YACE,OAAO,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D,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,YAAS;aACpF,CAAC,CAAC;SACJ;;;;gBAhRFC,YAAS,SAAC;oBACT,QAAQ,EAAE,yBAAyB;oBACnC,u+FAA+C;oBAE/C,aAAa,EAAEC,oBAAiB,CAAC,IAAI;;iBACtC;;;gBAVO,cAAc;;;qBAgBnBC,YAAS,SAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;6BACjCC,SAAM;uCACNC,QAAK;oCACLA,QAAK;;;IC/CR;;;;;;;;;;;;;;;;QA6CA;;;;;gBAtBCC,WAAQ,SAAC;oBACR,YAAY,EAAE;wBACZ,uBAAuB;qBACxB;oBACD,OAAO,EAAE;wBACPC,mBAAY;wBACZC,qBAAU;wBACVC,uBAAY;wBACZC,yBAAc;wBACdC,8BAAmB;wBACnBC,4BAAiB;wBACjBC,kCAAuB;wBACvBC,sBAAY,CAAC,OAAO,CAAC;4BACnB,aAAa,EAAE,yBAAyB;4BACxC,iBAAiB,EAAE,IAAI;yBACxB,CAAC;qBACH;oBACD,OAAO,EAAE;wBACP,uBAAuB;qBACxB;iBACF;;;IC3CD;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common/http"),require("@valtimo/config"),require("@angular/common"),require("@valtimo/components"),require("ngx-toastr"),require("@angular/platform-browser/animations"),require("bpmn-js/dist/bpmn-navigated-viewer.production.min.js"),require("heatmap.js-fixed/build/heatmap.js")):"function"==typeof define&&define.amd?define("@valtimo/process",["exports","@angular/core","@angular/common/http","@valtimo/config","@angular/common","@valtimo/components","ngx-toastr","@angular/platform-browser/animations","bpmn-js/dist/bpmn-navigated-viewer.production.min.js","heatmap.js-fixed/build/heatmap.js"],e):e(((t=t||self).valtimo=t.valtimo||{},t.valtimo.process={}),t.ng.core,t.ng.common.http,t.config,t.ng.common,t.components,t.ngxToastr,t.ng.platformBrowser.animations,t.BpmnJS,t.heatmap)}(this,(function(t,e,n,i,o,s,a,r,p,c){"use strict";var l=function(){function t(t,e){this.http=t,this.valtimoEndpointUri=e.config.valtimoApi.endpointUri}return t.prototype.getProcessDefinitions=function(){return this.http.get(this.valtimoEndpointUri+"process/definition")},t.prototype.getProcessDefinitionVersions=function(t){return this.http.get(this.valtimoEndpointUri+"process/definition/"+t+"/versions")},t.prototype.getProcessDefinition=function(t){return this.http.get(this.valtimoEndpointUri+"process/definition/"+t)},t.prototype.getProcessDefinitionStartFormData=function(t){return this.http.get(this.valtimoEndpointUri+"process/definition/"+t+"/start-form")},t.prototype.startProcesInstance=function(t,e,n){return this.http.post(this.valtimoEndpointUri+"process/definition/"+t+"/"+e+"/start",n)},t.prototype.getProcessDefinitionXml=function(t){return this.http.get(this.valtimoEndpointUri+"process/definition/"+t+"/xml")},t.prototype.getProcessXml=function(t){return this.http.get(this.valtimoEndpointUri+"process/"+t+"/xml")},t.prototype.getProcessCount=function(t){return this.http.post(this.valtimoEndpointUri+"v2/process/definition/"+t+"/count",{key:t,processVariables:[{"@type":"boolean",name:"active",value:!0}]})},t.prototype.getProcessHeatmapCount=function(t){return this.http.get(this.valtimoEndpointUri+"process/definition/"+t.key+"/heatmap/count?version="+t.version)},t.prototype.getProcessHeatmapDuration=function(t){return this.http.get(this.valtimoEndpointUri+"process/definition/"+t.key+"/heatmap/duration?version="+t.version)},t.prototype.getProcessInstances=function(t,e,i,o){var s=(new n.HttpParams).set("page",e.toString()).set("size",i.toString()).set("sort",o);return this.http.post(this.valtimoEndpointUri+"v2/process/"+t+"/search",{},{params:s})},t.prototype.getProcessInstance=function(t){return this.http.get(this.valtimoEndpointUri+"process/"+t,{})},t.prototype.getProcessInstanceTasks=function(t){return this.http.get(this.valtimoEndpointUri+"process/"+t+"/tasks",{})},t.prototype.getProcessInstanceVariables=function(t,e){return this.http.post(this.valtimoEndpointUri+"process-instance/"+t+"/variables",e)},t.prototype.addProcessInstancesDefaultVariablesValues=function(t){var e=this;return t.forEach((function(t){return e.addDefaultVariablesValues(t)})),t},t.prototype.addDefaultVariablesValues=function(t){return t.startUser||(t.startUser=t.startUserId),t.processStarted||(t.processStarted=t.startTime),t.processEnded||(t.processEnded=t.endTime),t.active||(t.active=null==t.endTime),t},t.prototype.getInstancesStatistics=function(t,e,i){var o=new n.HttpParams;return o.set("fromDate",t),o.set("toDate",e),o.set("processFilter",i),this.http.get(this.valtimoEndpointUri+"reporting/instancesstatistics",{params:o})},t.prototype.deployProcess=function(t){var e=new FormData;return e.append("file",new File([t],"process.bpmn")),e.append("deployment-name","valtimoConsoleApp"),e.append("deployment-source","process application"),this.http.post(this.valtimoEndpointUri+"camunda-rest/engine/default/deployment/create",e)},t.prototype.migrateProcess=function(t,e,n){return this.http.post(this.valtimoEndpointUri+"process/definition/"+t+"/"+e+"/migrate",n)},t}();l.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new l(e.ɵɵinject(n.HttpClient),e.ɵɵinject(i.ConfigService))},token:l,providedIn:"root"}),l.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],l.ctorParameters=function(){return[{type:n.HttpClient},{type:i.ConfigService}]};var d=function(){function t(t){this.processService=t,this.importDone=new e.EventEmitter,this.enumHeatmapOptions=["count","duration"]}return t.prototype.ngOnInit=function(){var t=this;this.processDefinitionKey&&this.loadProcessDefinitionFromKey(this.processDefinitionKey),this.processInstanceId&&this.loadProcessInstanceXml(this.processInstanceId),this.bpmnJS=new p,this.bpmnJS.on("import.done",(function(e){if(!e.error){var n=t.bpmnJS.get("canvas"),i=t.bpmnJS.get("eventBus");t.processDiagram.historicActivityInstances&&t.processDiagram.historicActivityInstances.forEach((function(t){"multiInstanceBody"!==t.activityType&&n.addMarker(t.activityId,t.endTime?"highlight-overlay-past":"highlight-overlay-current")})),n.zoom("fit-viewport","auto"),t.processDefinitionVersions&&(i.on("canvas.init",(function(){t.showHeatmap&&t.clearHeatmap(),t.loadHeatmapData()})),i.on("canvas.viewbox.changing",(function(){t.showHeatmap&&t.clearHeatmap()})),i.on("canvas.viewbox.changed",(function(){t.loadHeatmapData()})))}}))},t.prototype.ngOnChanges=function(){this.processDefinitionKey?this.loadProcessDefinitionFromKey(this.processDefinitionKey):this.processInstanceId&&this.loadProcessInstanceXml(this.processInstanceId)},t.prototype.ngOnDestroy=function(){this.bpmnJS&&this.bpmnJS.destroy()},t.prototype.loadProcessDefinition=function(t){var e=this;this.processService.getProcessDefinition(t).subscribe((function(t){e.heatmapOption=e.enumHeatmapOptions[0],e.version=t.version,e.loadProcessDefinitionXml(t.id)}))},t.prototype.loadProcessDefinitionVersions=function(t){var e=this;this.processService.getProcessDefinitionVersions(t).subscribe((function(t){e.processDefinitionVersions=t}))},t.prototype.loadProcessDefinitionFromKey=function(t){this.loadProcessDefinitionVersions(t),this.loadProcessDefinition(t)},t.prototype.loadProcessDefinitionXml=function(t){var e=this;this.processService.getProcessDefinitionXml(t).subscribe((function(t){e.processDiagram=t,e.bpmnJS.importXML(e.processDiagram.bpmn20Xml),e.bpmnJS.attachTo(e.el.nativeElement)}))},t.prototype.loadProcessInstanceXml=function(t){var e=this;this.processService.getProcessXml(t).subscribe((function(t){e.processDiagram=t,e.bpmnJS.importXML(e.processDiagram.bpmn20Xml),e.bpmnJS.attachTo(e.el.nativeElement)}))},t.prototype.loadProcessDefinitionHeatmapCount=function(t){var e=this;this.processService.getProcessHeatmapCount(t).subscribe((function(t){e.inputData=t,e.valueKey="totalCount",e.heatPoints={data:[]},e.min=0,e.max=0,Object.keys(e.inputData).forEach((function(t){var n=e.el.nativeElement.querySelector("svg").getBoundingClientRect(),i=e.el.nativeElement.querySelector("g[data-element-id="+t+"]").getBoundingClientRect();e.setMax(t),e.heatPoints.data.push({x:Math.round(i.x-n.x+i.width/2),y:Math.round(i.y-n.y+i.height/2),value:e.inputData[t][e.valueKey],radius:i.width/2}),e.addCounterActiveOverlays(t,e.inputData)})),e.clearHeatmap(),e.showHeatmap&&e.loadHeatmap()}))},t.prototype.onWindowResize=function(){var t=this.el.nativeElement.querySelector("canvas[class=heatmap-canvas]");t&&(t.remove(),this.heatMapInstance=null),this.showHeatmap&&this.loadHeatmap()},t.prototype.loadProcessDefinitionHeatmapDuration=function(t){var e=this;this.processService.getProcessHeatmapDuration(t).subscribe((function(t){e.inputData=t,e.valueKey="averageDurationInMilliseconds",e.heatPoints={data:[]},e.min=0,e.max=0,Object.keys(e.inputData).forEach((function(t){var n=e.el.nativeElement.querySelector("svg").getBoundingClientRect(),i=e.el.nativeElement.querySelector("g[data-element-id="+t+"]").getBoundingClientRect();e.setMax(t),e.heatPoints.data.push({x:Math.round(i.x-n.x+i.width/2),y:Math.round(i.y-n.y+i.height/2),value:e.inputData[t][e.valueKey],radius:i.width/2}),e.addCounterActiveOverlays(t,e.inputData)})),e.clearHeatmap(),e.showHeatmap&&e.loadHeatmap()}))},t.prototype.setProcessDefinitionKey=function(t){this.processDefinitionKey=t,this.loadProcessDefinitionFromKey(this.processDefinitionKey)},t.prototype.setProcessDefinitionVersion=function(t){this.version=+t,this.loadHeatmapData()},t.prototype.setHeatmapOption=function(t){this.heatmapOption=t,this.loadHeatmapData()},t.prototype.toggleShowHeatmap=function(){this.showHeatmap=!this.showHeatmap,this.loadHeatmapData()},t.prototype.loadHeatmap=function(){this.heatMapInstance||(this.heatMapInstance=c.create({radius:54,blur:.7,maxOpacity:.4,minOpacity:0,container:this.el.nativeElement})),this.heatMapInstance.setData({min:this.min,max:this.max,data:this.heatPoints.data})},t.prototype.clearHeatmap=function(){this.heatMapInstance&&this.heatMapInstance.setData({data:[]})},t.prototype.loadHeatmapData=function(){var t=this;this.processDefinition=this.processDefinitionVersions.find((function(e){return e.version===t.version})),"count"===this.heatmapOption&&this.loadProcessDefinitionHeatmapCount(this.processDefinition),"duration"===this.heatmapOption&&this.loadProcessDefinitionHeatmapDuration(this.processDefinition)},t.prototype.setMax=function(t){this.heatmapDuration?this.max=Math.max(this.heatmapDuration[t].averageDurationInMilliseconds,this.max):this.heatmapCount&&(this.max=Math.max(this.heatmapCount[t].totalCount+this.heatmapCount[t].count,this.max))},t.prototype.addCounterActiveOverlays=function(t,e){this.bpmnJS.get("overlays").add(t,{position:{bottom:13,left:-12},show:{minZoom:0,maxZoom:5},html:'<span class="badge badge-pill badge-primary">'+e[t].count+"</span>"})},t}();d.decorators=[{type:e.Component,args:[{selector:"valtimo-process-diagram",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n<div class="process-diagram-container">\n <div *ngIf="processDefinitionKey" class="diagram-container-switch-holder" >\n <div class="container-fluid">\n <div class="row p-4 bg-light">\n <div class="col-4">\n <label><strong>Version</strong></label><br />\n <select class="form-control" (change)="setProcessDefinitionVersion($event.target.value)">\n <option *ngFor="let processDefinitionVersion of processDefinitionVersions"\n [value]="processDefinitionVersion.version"\n [selected]="processDefinitionVersion.version === version">\n {{ processDefinitionVersion.version }}\n </option>\n </select>\n </div>\n <div class="col-4">\n <label><strong>Heatmap type</strong></label><br />\n <select class="form-control" (change)="setHeatmapOption($event.target.value)">\n <option *ngFor="let option of enumHeatmapOptions"\n [value]="option"\n [selected]="option === heatmapOption" >\n {{ option }}\n </option>\n </select>\n </div>\n <div class="col-4 text-right">\n <label><strong>Show heatmap</strong></label><br />\n <div class="text-left switch-button switch-button-sm switch-button-success">\n <input type="checkbox" id="toggleHeatmap" [checked]="showHeatmap" (click)="toggleShowHeatmap()"><span>\n <label for="toggleHeatmap"></label></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div #ref (window:resize)="onWindowResize()" class="diagram-container"></div>\n\n <div *ngIf="processInstanceId" class="p-4 text-center legenda-holder">\n <span><div class="legenda highlight-overlay-past"></div> Executed tasks</span>\n <span class="ml-3"><div class="legenda highlight-overlay-current"></div> Current tasks</span>\n </div>\n\n <div *ngIf="processDefinitionKey" class="p-4 text-center legenda-holder">\n <span><span class="badge badge-pill badge-primary">N</span> Amount of currently active instances of this task.</span>\n <span> | Red/yellow/green orbs: The amount of times the task is executed in comparison to the other tasks.</span>\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None,styles:[".process-diagram-container .diagram-container{height:50vh;width:100%}.process-diagram-container .diagram-container-switch-holder{position:absolute;width:100%;z-index:1000}.process-diagram-container .highlight-overlay-past:not(.djs-connection) .djs-visual>:first-child{fill:#d8d8d8!important}.process-diagram-container .highlight-overlay-current:not(.djs-connection) .djs-visual>:first-child{fill:#b2e0ff!important}.process-diagram-container .legenda-holder{font-size:1em}.process-diagram-container .legenda{border:2px solid #000;border-radius:3px;display:inline-block;margin-bottom:-4px;margin-right:5px;padding:7px}.process-diagram-container .legenda.highlight-overlay-past{background-color:#d8d8d8}.process-diagram-container .legenda.highlight-overlay-current{background-color:#b2e0ff}"]}]}],d.ctorParameters=function(){return[{type:l}]},d.propDecorators={el:[{type:e.ViewChild,args:["ref",{static:!0}]}],importDone:[{type:e.Output}],processDefinitionKey:[{type:e.Input}],processInstanceId:[{type:e.Input}]};var h=function(){};h.decorators=[{type:e.NgModule,args:[{declarations:[d],imports:[o.CommonModule,s.ListModule,s.WidgetModule,s.TimelineModule,s.BpmnJsDiagramModule,s.CamundaFormModule,r.BrowserAnimationsModule,a.ToastrModule.forRoot({positionClass:"toast-bottom-full-width",preventDuplicates:!0})],exports:[d]}]}],t.ProcessDiagramComponent=d,t.ProcessModule=h,t.ProcessService=l,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
2
|
+
//# sourceMappingURL=valtimo-process.umd.min.js.map
|