@valtimo/process 4.15.3-next-main.14 → 4.16.0

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.
@@ -4,6 +4,40 @@
4
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
5
  }(this, (function (exports, i0, i1, i2, common, components, ngxToastr, animations, BpmnJS, heatmap) { 'use strict';
6
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
+
23
+ /*
24
+ *
25
+ * * Copyright 2015-2020 Ritense BV, the Netherlands.
26
+ * *
27
+ * * Licensed under EUPL, Version 1.2 (the "License");
28
+ * * you may not use this file except in compliance with the License.
29
+ * * You may obtain a copy of the License at
30
+ * *
31
+ * * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
32
+ * *
33
+ * * Unless required by applicable law or agreed to in writing, software
34
+ * * distributed under the License is distributed on an "AS IS" basis,
35
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36
+ * * See the License for the specific language governing permissions and
37
+ * * limitations under the License.
38
+ *
39
+ */
40
+
7
41
  /*
8
42
  * Copyright 2015-2020 Ritense BV, the Netherlands.
9
43
  *
@@ -47,8 +81,8 @@
47
81
  };
48
82
  ProcessService.prototype.getProcessCount = function (id) {
49
83
  return this.http.post(this.valtimoEndpointUri + "v2/process/definition/" + id + "/count", {
50
- 'key': id,
51
- 'processVariables': [{ '@type': 'boolean', 'name': 'active', 'value': true }]
84
+ key: id,
85
+ processVariables: [{ '@type': 'boolean', name: 'active', value: true }],
52
86
  });
53
87
  };
54
88
  ProcessService.prototype.getProcessHeatmapCount = function (processDefinition) {
@@ -62,7 +96,7 @@
62
96
  .set('page', page.toString())
63
97
  .set('size', size.toString())
64
98
  .set('sort', sort);
65
- return this.http.post(this.valtimoEndpointUri + "v2/process/" + key + "/search", {}, { 'params': params });
99
+ return this.http.post(this.valtimoEndpointUri + "v2/process/" + key + "/search", {}, { params: params });
66
100
  };
67
101
  ProcessService.prototype.getProcessInstance = function (processInstanceId) {
68
102
  return this.http.get(this.valtimoEndpointUri + "process/" + processInstanceId, {});
@@ -98,10 +132,12 @@
98
132
  params.set('fromDate', fromDate);
99
133
  params.set('toDate', toDate);
100
134
  params.set('processFilter', processFilter);
101
- return this.http.get(this.valtimoEndpointUri + "reporting/instancesstatistics", { 'params': params });
135
+ return this.http.get(this.valtimoEndpointUri + "reporting/instancesstatistics", {
136
+ params: params,
137
+ });
102
138
  };
103
139
  ProcessService.prototype.deployProcess = function (processXml) {
104
- var formData = new FormData;
140
+ var formData = new FormData();
105
141
  formData.append('file', new File([processXml], 'process.bpmn'));
106
142
  formData.append('deployment-name', 'valtimoConsoleApp');
107
143
  formData.append('deployment-source', 'process application');
@@ -115,7 +151,7 @@
115
151
  ProcessService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProcessService_Factory() { return new ProcessService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(i2.ConfigService)); }, token: ProcessService, providedIn: "root" });
116
152
  ProcessService.decorators = [
117
153
  { type: i0.Injectable, args: [{
118
- providedIn: 'root'
154
+ providedIn: 'root',
119
155
  },] }
120
156
  ];
121
157
  ProcessService.ctorParameters = function () { return [
@@ -241,15 +277,15 @@
241
277
  _this.min = 0;
242
278
  _this.max = 0;
243
279
  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 + "]")
280
+ var diagramContainer = _this.el.nativeElement.querySelector('svg').getBoundingClientRect(), diagramElm = _this.el.nativeElement
281
+ .querySelector("g[data-element-id=" + key + "]")
246
282
  .getBoundingClientRect();
247
283
  _this.setMax(key);
248
284
  _this.heatPoints.data.push({
249
285
  x: Math.round(diagramElm.x - diagramContainer.x + diagramElm.width / 2),
250
286
  y: Math.round(diagramElm.y - diagramContainer.y + diagramElm.height / 2),
251
287
  value: _this.inputData[key][_this.valueKey],
252
- radius: diagramElm.width / 2
288
+ radius: diagramElm.width / 2,
253
289
  });
254
290
  _this.addCounterActiveOverlays(key, _this.inputData);
255
291
  });
@@ -278,15 +314,15 @@
278
314
  _this.min = 0;
279
315
  _this.max = 0;
280
316
  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 + "]")
317
+ var diagramContainer = _this.el.nativeElement.querySelector('svg').getBoundingClientRect(), diagramElm = _this.el.nativeElement
318
+ .querySelector("g[data-element-id=" + key + "]")
283
319
  .getBoundingClientRect();
284
320
  _this.setMax(key);
285
321
  _this.heatPoints.data.push({
286
322
  x: Math.round(diagramElm.x - diagramContainer.x + diagramElm.width / 2),
287
323
  y: Math.round(diagramElm.y - diagramContainer.y + diagramElm.height / 2),
288
324
  value: _this.inputData[key][_this.valueKey],
289
- radius: diagramElm.width / 2
325
+ radius: diagramElm.width / 2,
290
326
  });
291
327
  _this.addCounterActiveOverlays(key, _this.inputData);
292
328
  });
@@ -316,16 +352,16 @@
316
352
  if (!this.heatMapInstance) {
317
353
  this.heatMapInstance = heatmap.create({
318
354
  radius: 54,
319
- blur: .70,
320
- maxOpacity: .4,
355
+ blur: 0.7,
356
+ maxOpacity: 0.4,
321
357
  minOpacity: 0,
322
- container: this.el.nativeElement
358
+ container: this.el.nativeElement,
323
359
  });
324
360
  }
325
361
  this.heatMapInstance.setData({
326
362
  min: this.min,
327
363
  max: this.max,
328
- data: this.heatPoints.data
364
+ data: this.heatPoints.data,
329
365
  });
330
366
  };
331
367
  ProcessDiagramComponent.prototype.clearHeatmap = function () {
@@ -356,13 +392,13 @@
356
392
  overlays.add(key, {
357
393
  position: {
358
394
  bottom: 13,
359
- left: -12
395
+ left: -12,
360
396
  },
361
397
  show: {
362
398
  minZoom: 0,
363
- maxZoom: 5.0
399
+ maxZoom: 5.0,
364
400
  },
365
- html: "<span class=\"badge badge-pill badge-primary\">" + inputData[key].count + "</span>"
401
+ html: "<span class=\"badge badge-pill badge-primary\">" + inputData[key].count + "</span>",
366
402
  });
367
403
  };
368
404
  return ProcessDiagramComponent;
@@ -370,7 +406,7 @@
370
406
  ProcessDiagramComponent.decorators = [
371
407
  { type: i0.Component, args: [{
372
408
  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>&nbsp;&nbsp;Amount of currently active instances of this task.</span>\n <span>&nbsp;&nbsp;|&nbsp;&nbsp;Red/yellow/green orbs: The amount of times the task is executed in comparison to the other tasks.</span>\n </div>\n</div>\n",
409
+ 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\n ><br />\n <select class=\"form-control\" (change)=\"setProcessDefinitionVersion($event.target.value)\">\n <option\n *ngFor=\"let processDefinitionVersion of processDefinitionVersions\"\n [value]=\"processDefinitionVersion.version\"\n [selected]=\"processDefinitionVersion.version === version\"\n >\n {{ processDefinitionVersion.version }}\n </option>\n </select>\n </div>\n <div class=\"col-4\">\n <label><strong>Heatmap type</strong></label\n ><br />\n <select class=\"form-control\" (change)=\"setHeatmapOption($event.target.value)\">\n <option\n *ngFor=\"let option of enumHeatmapOptions\"\n [value]=\"option\"\n [selected]=\"option === heatmapOption\"\n >\n {{ option }}\n </option>\n </select>\n </div>\n <div class=\"col-4 text-right\">\n <label><strong>Show heatmap</strong></label\n ><br />\n <div class=\"text-left switch-button switch-button-sm switch-button-success\">\n <input\n type=\"checkbox\"\n id=\"toggleHeatmap\"\n [checked]=\"showHeatmap\"\n (click)=\"toggleShowHeatmap()\"\n /><span> <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\n ><div class=\"legenda highlight-overlay-past\"></div>\n Executed tasks</span\n >\n <span class=\"ml-3\"\n ><div class=\"legenda highlight-overlay-current\"></div>\n Current tasks</span\n >\n </div>\n\n <div *ngIf=\"processDefinitionKey\" class=\"p-4 text-center legenda-holder\">\n <span\n ><span class=\"badge badge-pill badge-primary\">N</span>&nbsp;&nbsp;Amount of currently active\n instances of this task.</span\n >\n <span\n >&nbsp;&nbsp;|&nbsp;&nbsp;Red/yellow/green orbs: The amount of times the task is executed in\n comparison to the other tasks.</span\n >\n </div>\n</div>\n",
374
410
  encapsulation: i0.ViewEncapsulation.None,
375
411
  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
412
  },] }
@@ -407,9 +443,7 @@
407
443
  }());
408
444
  ProcessModule.decorators = [
409
445
  { type: i0.NgModule, args: [{
410
- declarations: [
411
- ProcessDiagramComponent
412
- ],
446
+ declarations: [ProcessDiagramComponent],
413
447
  imports: [
414
448
  common.CommonModule,
415
449
  components.ListModule,
@@ -420,12 +454,10 @@
420
454
  animations.BrowserAnimationsModule,
421
455
  ngxToastr.ToastrModule.forRoot({
422
456
  positionClass: 'toast-bottom-full-width',
423
- preventDuplicates: true
424
- })
425
- ],
426
- exports: [
427
- ProcessDiagramComponent
457
+ preventDuplicates: true,
458
+ }),
428
459
  ],
460
+ exports: [ProcessDiagramComponent],
429
461
  },] }
430
462
  ];
431
463
 
@@ -1 +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,IAAI,CAAC,IAAI,CAAC,GAAG,CAAyB,IAAI,CAAC,kBAAkB,uBAAoB,CAAC,CAAC;SAC3F;QAED,qDAA4B,GAA5B,UAA6B,GAAW;YACtC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAyB,IAAI,CAAC,kBAAkB,2BAAsB,GAAG,cAAW,CAAC,CAAC;SAC3G;QAED,6CAAoB,GAApB,UAAqB,GAAW;YAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAuB,IAAI,CAAC,kBAAkB,2BAAsB,GAAK,CAAC,CAAC;SAChG;QAED,0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AAC;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;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"valtimo-process.umd.js","sources":["../../../../projects/valtimo/process/src/lib/models/process.model.ts","../../../../projects/valtimo/process/src/lib/models/index.ts","../../../../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\nexport interface ProcessStart {\n key: string;\n businessKey: string;\n variables: Array<any>;\n}\n\nexport interface Process {\n id: string;\n businessKey: string;\n startTime: string;\n endTime: string;\n processDefinitionKey: string;\n processDefinitionName: string;\n startUserId: string;\n deleteReason: string;\n startUser: string;\n processStarted: string;\n processEnded: string;\n active: boolean;\n variables: ProcessInstanceVariable[];\n}\n\nexport interface ProcessDefinition {\n visibleInMenu: any;\n category: string;\n deploymentId: string;\n description: string;\n diagram: string;\n historyTimeToLive: string;\n id: string;\n key: string;\n name: string;\n resource: string;\n startableInTasklist: boolean;\n suspended: false;\n tenantId: string;\n version: number;\n versionTag: string;\n}\n\nexport interface ProcessDefinitionStartForm {\n formFields: Array<any>;\n formLocation: string;\n genericForm: boolean;\n}\n\nexport interface ProcessInstance {\n id: string;\n businessKey: string;\n startTime: string;\n endTime: string;\n processDefinitionKey: string;\n processDefinitionName: string;\n startUserId: string;\n deleteReason: string;\n variables: ProcessInstanceVariable[];\n}\n\nexport interface ProcessInstanceVariable {\n id: string;\n type: string;\n name: string;\n textValue?: string;\n longValue?: number;\n local: boolean;\n}\n\nexport interface ProcessInstanceTask {\n id: string;\n name: string;\n assignee: string;\n created: string;\n createdUnix: number;\n due: string;\n followUp: string;\n delegationState: string;\n description: string;\n executionId: string;\n owner: string;\n parentTaskId: string;\n priority: number;\n processDefinitionId: string;\n processInstanceId: string;\n taskDefinitionKey: string;\n caseExecutionId: string;\n caseInstanceId: string;\n caseDefinitionId: string;\n suspended: boolean;\n formKey: string;\n tenantId: string;\n identityLinks: IdentityLink[];\n\n isLocked(): boolean;\n}\n\nexport interface IdentityLink {\n userId: string;\n groupId: string;\n type: string;\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\nexport * from './process.model';\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 {Injectable} from '@angular/core';\nimport {HttpClient, HttpParams} from '@angular/common/http';\nimport {Observable} from 'rxjs';\nimport {\n ProcessDefinition,\n ProcessDefinitionStartForm,\n ProcessInstance,\n ProcessInstanceTask,\n ProcessStart,\n} from './models';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ProcessService {\n private valtimoEndpointUri: string;\n\n constructor(private http: HttpClient, configService: ConfigService) {\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[]>(\n `${this.valtimoEndpointUri}process/definition/${key}/versions`\n );\n }\n\n getProcessDefinition(key: string): Observable<ProcessDefinition> {\n return this.http.get<ProcessDefinition>(`${this.valtimoEndpointUri}process/definition/${key}`);\n }\n\n getProcessDefinitionStartFormData(\n processDefinitionKey: string\n ): Observable<ProcessDefinitionStartForm> {\n return this.http.get<ProcessDefinitionStartForm>(\n `${this.valtimoEndpointUri}process/definition/${processDefinitionKey}/start-form`\n );\n }\n\n startProcesInstance(\n key: string,\n businessKey: string,\n variables: Map<string, any>\n ): Observable<any> {\n return this.http.post<ProcessStart>(\n `${this.valtimoEndpointUri}process/definition/${key}/${businessKey}/start`,\n 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>(\n `${this.valtimoEndpointUri}v2/process/${key}/search`,\n {},\n {params: params}\n );\n }\n\n getProcessInstance(processInstanceId: string): Observable<ProcessInstance> {\n return this.http.get<ProcessInstance>(\n `${this.valtimoEndpointUri}process/${processInstanceId}`,\n {}\n );\n }\n\n getProcessInstanceTasks(id: string): Observable<ProcessInstanceTask[]> {\n return this.http.get<ProcessInstanceTask[]>(\n `${this.valtimoEndpointUri}process/${id}/tasks`,\n {}\n );\n }\n\n getProcessInstanceVariables(id: string, variableNames: Array<any>): Observable<any> {\n return this.http.post(\n `${this.valtimoEndpointUri}process-instance/${id}/variables`,\n variableNames\n );\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[]>(`${this.valtimoEndpointUri}reporting/instancesstatistics`, {\n 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(\n `${this.valtimoEndpointUri}camunda-rest/engine/default/deployment/create`,\n formData\n );\n }\n\n migrateProcess(\n processDefinition1Id: string,\n processDefinition2Id: string,\n params: any\n ): Observable<any> {\n return this.http.post(\n `${this.valtimoEndpointUri}process/definition/${processDefinition1Id}/${processDefinition2Id}/migrate`,\n 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 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(private processService: ProcessService) {}\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(\n instance.activityId,\n instance.endTime ? 'highlight-overlay-past' : 'highlight-overlay-current'\n );\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').getBoundingClientRect(),\n diagramElm = this.el.nativeElement\n .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 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').getBoundingClientRect(),\n diagramElm = this.el.nativeElement\n .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: 0.7,\n maxOpacity: 0.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(\n definition => definition.version === this.version\n );\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(\n this.heatmapCount[key].totalCount + this.heatmapCount[key].count,\n this.max\n );\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 * 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 {\n BpmnJsDiagramModule,\n CamundaFormModule,\n ListModule,\n TimelineModule,\n WidgetModule,\n} 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: [ProcessDiagramComponent],\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: [ProcessDiagramComponent],\n})\nexport class ProcessModule {}\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/models';\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;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;QAkCE,wBAAoB,IAAgB,EAAE,aAA4B;YAA9C,SAAI,GAAJ,IAAI,CAAY;YAClC,IAAI,CAAC,kBAAkB,GAAG,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC;SACvE;QAED,8CAAqB,GAArB;YACE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAyB,IAAI,CAAC,kBAAkB,uBAAoB,CAAC,CAAC;SAC3F;QAED,qDAA4B,GAA5B,UAA6B,GAAW;YACtC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CACf,IAAI,CAAC,kBAAkB,2BAAsB,G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,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC;6BAC/BC,SAAM;uCACNC,QAAK;oCACLA,QAAK;;;IC9CR;;;;;;;;;;;;;;;;QA8CA;;;;;gBAjBCC,WAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;oBACvC,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,CAAC,uBAAuB,CAAC;iBACnC;;;IC7CD;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;"}
@@ -1,2 +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>&nbsp;&nbsp;Amount of currently active instances of this task.</span>\n <span>&nbsp;&nbsp;|&nbsp;&nbsp;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})}));
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\n ><br />\n <select class="form-control" (change)="setProcessDefinitionVersion($event.target.value)">\n <option\n *ngFor="let processDefinitionVersion of processDefinitionVersions"\n [value]="processDefinitionVersion.version"\n [selected]="processDefinitionVersion.version === version"\n >\n {{ processDefinitionVersion.version }}\n </option>\n </select>\n </div>\n <div class="col-4">\n <label><strong>Heatmap type</strong></label\n ><br />\n <select class="form-control" (change)="setHeatmapOption($event.target.value)">\n <option\n *ngFor="let option of enumHeatmapOptions"\n [value]="option"\n [selected]="option === heatmapOption"\n >\n {{ option }}\n </option>\n </select>\n </div>\n <div class="col-4 text-right">\n <label><strong>Show heatmap</strong></label\n ><br />\n <div class="text-left switch-button switch-button-sm switch-button-success">\n <input\n type="checkbox"\n id="toggleHeatmap"\n [checked]="showHeatmap"\n (click)="toggleShowHeatmap()"\n /><span> <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\n ><div class="legenda highlight-overlay-past"></div>\n Executed tasks</span\n >\n <span class="ml-3"\n ><div class="legenda highlight-overlay-current"></div>\n Current tasks</span\n >\n </div>\n\n <div *ngIf="processDefinitionKey" class="p-4 text-center legenda-holder">\n <span\n ><span class="badge badge-pill badge-primary">N</span>&nbsp;&nbsp;Amount of currently active\n instances of this task.</span\n >\n <span\n >&nbsp;&nbsp;|&nbsp;&nbsp;Red/yellow/green orbs: The amount of times the task is executed in\n comparison to the other tasks.</span\n >\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
2
  //# sourceMappingURL=valtimo-process.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"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"],"names":["ProcessService","http","configService","this","valtimoEndpointUri","config","valtimoApi","endpointUri","prototype","getProcessDefinitions","get","getProcessDefinitionVersions","key","getProcessDefinition","getProcessDefinitionStartFormData","processDefinitionKey","startProcesInstance","businessKey","variables","post","getProcessDefinitionXml","processDefinitionId","getProcessXml","id","getProcessCount","processVariables","@type","name","value","getProcessHeatmapCount","processDefinition","version","getProcessHeatmapDuration","getProcessInstances","page","size","sort","params","HttpParams","set","toString","getProcessInstance","processInstanceId","getProcessInstanceTasks","getProcessInstanceVariables","variableNames","addProcessInstancesDefaultVariablesValues","processInstances","_this","forEach","processInstance","addDefaultVariablesValues","startUser","startUserId","processStarted","startTime","processEnded","endTime","active","getInstancesStatistics","fromDate","toDate","processFilter","deployProcess","processXml","formData","FormData","append","File","migrateProcess","processDefinition1Id","processDefinition2Id","Injectable","args","providedIn","HttpClient","ConfigService","ProcessDiagramComponent","processService","importDone","EventEmitter","enumHeatmapOptions","ngOnInit","loadProcessDefinitionFromKey","loadProcessInstanceXml","bpmnJS","BpmnJS","on","_a","error","canvas_1","eventBus","processDiagram","historicActivityInstances","instance","activityType","addMarker","activityId","zoom","processDefinitionVersions","showHeatmap","clearHeatmap","loadHeatmapData","ngOnChanges","ngOnDestroy","destroy","loadProcessDefinition","subscribe","response","heatmapOption","loadProcessDefinitionXml","loadProcessDefinitionVersions","importXML","bpmn20Xml","attachTo","el","nativeElement","loadProcessDefinitionHeatmapCount","inputData","valueKey","heatPoints","data","min","max","Object","keys","diagramContainer","querySelector","getBoundingClientRect","diagramElm","setMax","push","x","Math","round","width","y","height","radius","addCounterActiveOverlays","loadHeatmap","onWindowResize","oldCanvas","remove","heatMapInstance","loadProcessDefinitionHeatmapDuration","setProcessDefinitionKey","setProcessDefinitionVersion","setHeatmapOption","toggleShowHeatmap","heatmap.create","blur","maxOpacity","minOpacity","container","setData","find","definition","heatmapDuration","averageDurationInMilliseconds","heatmapCount","totalCount","count","add","position","bottom","left","show","minZoom","maxZoom","html","Component","selector","template","encapsulation","ViewEncapsulation","None","ViewChild","static","Output","Input","NgModule","declarations","imports","CommonModule","ListModule","WidgetModule","TimelineModule","BpmnJsDiagramModule","CamundaFormModule","BrowserAnimationsModule","ToastrModule","forRoot","positionClass","preventDuplicates","exports"],"mappings":"08BA4BE,SAAAA,EACUC,EACRC,GADQC,KAAAF,KAAAA,EAGRE,KAAKC,mBAAqBF,EAAcG,OAAOC,WAAWC,mBAG5DP,EAAAQ,UAAAC,sBAAA,WACE,OAAON,KAAKF,KAAKS,IAA4BP,KAAKC,mBAAkB,uBAGtEJ,EAAAQ,UAAAG,6BAAA,SAA6BC,GAC3B,OAAOT,KAAKF,KAAKS,IAA4BP,KAAKC,mBAAkB,sBAAsBQ,EAAG,cAG/FZ,EAAAQ,UAAAK,qBAAA,SAAqBD,GACnB,OAAOT,KAAKF,KAAKS,IAA0BP,KAAKC,mBAAkB,sBAAsBQ,IAG1FZ,EAAAQ,UAAAM,kCAAA,SAAkCC,GAChC,OAAOZ,KAAKF,KAAKS,IAAmCP,KAAKC,mBAAkB,sBAAsBW,EAAoB,gBAGvHf,EAAAQ,UAAAQ,oBAAA,SAAoBJ,EAAaK,EAAqBC,GACpD,OAAOf,KAAKF,KAAKkB,KACZhB,KAAKC,mBAAkB,sBAAsBQ,EAAG,IAA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,gBAAgBlJ,GAAKmJ,8BAA+B5J,KAAKwH,KACzExH,KAAK6J,eACd7J,KAAKwH,IAAMU,KAAKV,IAAIxH,KAAK6J,aAAapJ,GAAKqJ,WAAa9J,KAAK6J,aAAapJ,GAAKsJ,MAAO/J,KAAKwH,OAIxF9C,EAAArE,UAAAmI,yBAAA,SAAyB/H,EAAU0G,GACvBnH,KAAKkF,OAAO3E,IAAI,YACxByJ,IAAIvJ,EAAK,CAChBwJ,SAAU,CACRC,OAAQ,GACRC,MAAO,IAETC,KAAM,CACJC,QAAS,EACTC,QAAS,GAEXC,KAAM,gDAAgDpD,EAAU1G,GAAKsJ,MAAK,sCA9Q/ES,EAAAA,UAASlG,KAAA,CAAC,CACTmG,SAAU,0BACVC,SAAA,45FAEAC,cAAeC,EAAAA,kBAAkBC,i1BAT3BhL,iCAgBLiL,EAAAA,UAASxG,KAAA,CAAC,MAAO,CAAEyG,QAAQ,wBAC3BC,EAAAA,qCACAC,EAAAA,iCACAA,EAAAA,eCFH,iCAtBCC,EAAAA,SAAQ5G,KAAA,CAAC,CACR6G,aAAc,CACZzG,GAEF0G,QAAS,CACPC,EAAAA,aACAC,EAAAA,WACAC,EAAAA,aACAC,EAAAA,eACAC,EAAAA,oBACAC,EAAAA,kBACAC,EAAAA,wBACAC,EAAAA,aAAaC,QAAQ,CACnBC,cAAe,0BACfC,mBAAmB,KAGvBC,QAAS,CACPtH","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"]}
1
+ {"version":3,"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"],"names":["ProcessService","http","configService","this","valtimoEndpointUri","config","valtimoApi","endpointUri","prototype","getProcessDefinitions","get","getProcessDefinitionVersions","key","getProcessDefinition","getProcessDefinitionStartFormData","processDefinitionKey","startProcesInstance","businessKey","variables","post","getProcessDefinitionXml","processDefinitionId","getProcessXml","id","getProcessCount","processVariables","name","value","getProcessHeatmapCount","processDefinition","version","getProcessHeatmapDuration","getProcessInstances","page","size","sort","params","HttpParams","set","toString","getProcessInstance","processInstanceId","getProcessInstanceTasks","getProcessInstanceVariables","variableNames","addProcessInstancesDefaultVariablesValues","processInstances","_this","forEach","processInstance","addDefaultVariablesValues","startUser","startUserId","processStarted","startTime","processEnded","endTime","active","getInstancesStatistics","fromDate","toDate","processFilter","deployProcess","processXml","formData","FormData","append","File","migrateProcess","processDefinition1Id","processDefinition2Id","Injectable","args","providedIn","HttpClient","ConfigService","ProcessDiagramComponent","processService","importDone","EventEmitter","enumHeatmapOptions","ngOnInit","loadProcessDefinitionFromKey","loadProcessInstanceXml","bpmnJS","BpmnJS","on","_a","error","canvas_1","eventBus","processDiagram","historicActivityInstances","instance","activityType","addMarker","activityId","zoom","processDefinitionVersions","showHeatmap","clearHeatmap","loadHeatmapData","ngOnChanges","ngOnDestroy","destroy","loadProcessDefinition","subscribe","response","heatmapOption","loadProcessDefinitionXml","loadProcessDefinitionVersions","importXML","bpmn20Xml","attachTo","el","nativeElement","loadProcessDefinitionHeatmapCount","inputData","valueKey","heatPoints","data","min","max","Object","keys","diagramContainer","querySelector","getBoundingClientRect","diagramElm","setMax","push","x","Math","round","width","y","height","radius","addCounterActiveOverlays","loadHeatmap","onWindowResize","oldCanvas","remove","heatMapInstance","loadProcessDefinitionHeatmapDuration","setProcessDefinitionKey","setProcessDefinitionVersion","setHeatmapOption","toggleShowHeatmap","heatmap.create","blur","maxOpacity","minOpacity","container","setData","find","definition","heatmapDuration","averageDurationInMilliseconds","heatmapCount","totalCount","count","add","position","bottom","left","show","minZoom","maxZoom","html","Component","selector","template","encapsulation","ViewEncapsulation","None","ViewChild","static","Output","Input","NgModule","declarations","imports","CommonModule","ListModule","WidgetModule","TimelineModule","BpmnJsDiagramModule","CamundaFormModule","BrowserAnimationsModule","ToastrModule","forRoot","positionClass","preventDuplicates","exports"],"mappings":"08BAkCE,SAAAA,EAAoBC,EAAkBC,GAAlBC,KAAAF,KAAAA,EAClBE,KAAKC,mBAAqBF,EAAcG,OAAOC,WAAWC,mBAG5DP,EAAAQ,UAAAC,sBAAA,WACE,OAAON,KAAKF,KAAKS,IAA4BP,KAAKC,mBAAkB,uBAGtEJ,EAAAQ,UAAAG,6BAAA,SAA6BC,GAC3B,OAAOT,KAAKF,KAAKS,IACZP,KAAKC,mBAAkB,sBAAsBQ,EAAG,cAIvDZ,EAAAQ,UAAAK,qBAAA,SAAqBD,GACnB,OAAOT,KAAKF,KAAKS,IAA0BP,KAAKC,mBAAkB,sBAAsBQ,IAG1FZ,EAAAQ,UAAAM,kCAAA,SACEC,GAEA,OAAOZ,KAAKF,KAAKS,IACZP,KAAKC,mBAAkB,sBAAsBW,EAAoB,gBAIxEf,EAAAQ,UAAAQ,oBAAA,SACEJ,EACAK,EACAC,GAEA,OAAOf,KAAKF,KAAKkB,KACZhB,KAAKC,mBAAkB,sBAAsBQ,EAAG,IAAIK,EAAW,SAClEC,IAIJlB,EAAAQ,UAAAY,wBAAA,SAAwBC,GACtB,OAAOlB,KAAKF,KAAKS,IAAOP,KAAKC,mBAAkB,sBAAsBiB,EAAmB,SAG1FrB,EAAAQ,UAAAc,cAAA,SAAcC,GACZ,OAAOpB,KAAKF,KAAKS,IAAOP,KAAKC,mBAAkB,WAAWmB,EAAE,SAG9DvB,EAAAQ,UAAAgB,gBAAA,SAAgBD,GACd,OAAOpB,KAAKF,KAAKkB,KAAQhB,KAAKC,mBAAkB,yBAAyBmB,EAAE,SAAU,CACnFX,IAAKW,EACLE,iBAAkB,CAAC,CAAC,QAAS,UAAWC,KAAM,SAAUC,OAAO,OAInE3B,EAAAQ,UAAAoB,uBAAA,SAAuBC,GACrB,OAAO1B,KAAKF,KAAKS,IAC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CAeLgL,EAAAA,UAASxG,KAAA,CAAC,MAAO,CAACyG,QAAQ,wBAC1BC,EAAAA,qCACAC,EAAAA,iCACAA,EAAAA,eCAH,iCAjBCC,EAAAA,SAAQ5G,KAAA,CAAC,CACR6G,aAAc,CAACzG,GACf0G,QAAS,CACPC,EAAAA,aACAC,EAAAA,WACAC,EAAAA,aACAC,EAAAA,eACAC,EAAAA,oBACAC,EAAAA,kBACAC,EAAAA,wBACAC,EAAAA,aAAaC,QAAQ,CACnBC,cAAe,0BACfC,mBAAmB,KAGvBC,QAAS,CAACtH","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 {\n ProcessDefinition,\n ProcessDefinitionStartForm,\n ProcessInstance,\n ProcessInstanceTask,\n ProcessStart,\n} from './models';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ProcessService {\n private valtimoEndpointUri: string;\n\n constructor(private http: HttpClient, configService: ConfigService) {\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[]>(\n `${this.valtimoEndpointUri}process/definition/${key}/versions`\n );\n }\n\n getProcessDefinition(key: string): Observable<ProcessDefinition> {\n return this.http.get<ProcessDefinition>(`${this.valtimoEndpointUri}process/definition/${key}`);\n }\n\n getProcessDefinitionStartFormData(\n processDefinitionKey: string\n ): Observable<ProcessDefinitionStartForm> {\n return this.http.get<ProcessDefinitionStartForm>(\n `${this.valtimoEndpointUri}process/definition/${processDefinitionKey}/start-form`\n );\n }\n\n startProcesInstance(\n key: string,\n businessKey: string,\n variables: Map<string, any>\n ): Observable<any> {\n return this.http.post<ProcessStart>(\n `${this.valtimoEndpointUri}process/definition/${key}/${businessKey}/start`,\n 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>(\n `${this.valtimoEndpointUri}v2/process/${key}/search`,\n {},\n {params: params}\n );\n }\n\n getProcessInstance(processInstanceId: string): Observable<ProcessInstance> {\n return this.http.get<ProcessInstance>(\n `${this.valtimoEndpointUri}process/${processInstanceId}`,\n {}\n );\n }\n\n getProcessInstanceTasks(id: string): Observable<ProcessInstanceTask[]> {\n return this.http.get<ProcessInstanceTask[]>(\n `${this.valtimoEndpointUri}process/${id}/tasks`,\n {}\n );\n }\n\n getProcessInstanceVariables(id: string, variableNames: Array<any>): Observable<any> {\n return this.http.post(\n `${this.valtimoEndpointUri}process-instance/${id}/variables`,\n variableNames\n );\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[]>(`${this.valtimoEndpointUri}reporting/instancesstatistics`, {\n 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(\n `${this.valtimoEndpointUri}camunda-rest/engine/default/deployment/create`,\n formData\n );\n }\n\n migrateProcess(\n processDefinition1Id: string,\n processDefinition2Id: string,\n params: any\n ): Observable<any> {\n return this.http.post(\n `${this.valtimoEndpointUri}process/definition/${processDefinition1Id}/${processDefinition2Id}/migrate`,\n 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 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(private processService: ProcessService) {}\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(\n instance.activityId,\n instance.endTime ? 'highlight-overlay-past' : 'highlight-overlay-current'\n );\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').getBoundingClientRect(),\n diagramElm = this.el.nativeElement\n .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 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').getBoundingClientRect(),\n diagramElm = this.el.nativeElement\n .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: 0.7,\n maxOpacity: 0.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(\n definition => definition.version === this.version\n );\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(\n this.heatmapCount[key].totalCount + this.heatmapCount[key].count,\n this.max\n );\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 * 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 {\n BpmnJsDiagramModule,\n CamundaFormModule,\n ListModule,\n TimelineModule,\n WidgetModule,\n} 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: [ProcessDiagramComponent],\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: [ProcessDiagramComponent],\n})\nexport class ProcessModule {}\n"]}