@valtimo/process 4.15.2 → 4.16.0-next-main.19

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.
@@ -8,6 +8,40 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
8
8
  import * as BpmnJS from 'bpmn-js/dist/bpmn-navigated-viewer.production.min.js';
9
9
  import { create } from 'heatmap.js-fixed/build/heatmap.js';
10
10
 
11
+ /*
12
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
13
+ *
14
+ * Licensed under EUPL, Version 1.2 (the "License");
15
+ * you may not use this file except in compliance with the License.
16
+ * You may obtain a copy of the License at
17
+ *
18
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
19
+ *
20
+ * Unless required by applicable law or agreed to in writing, software
21
+ * distributed under the License is distributed on an "AS IS" basis,
22
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
+ * See the License for the specific language governing permissions and
24
+ * limitations under the License.
25
+ */
26
+
27
+ /*
28
+ *
29
+ * * Copyright 2015-2020 Ritense BV, the Netherlands.
30
+ * *
31
+ * * Licensed under EUPL, Version 1.2 (the "License");
32
+ * * you may not use this file except in compliance with the License.
33
+ * * You may obtain a copy of the License at
34
+ * *
35
+ * * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
36
+ * *
37
+ * * Unless required by applicable law or agreed to in writing, software
38
+ * * distributed under the License is distributed on an "AS IS" basis,
39
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
40
+ * * See the License for the specific language governing permissions and
41
+ * * limitations under the License.
42
+ *
43
+ */
44
+
11
45
  /*
12
46
  * Copyright 2015-2020 Ritense BV, the Netherlands.
13
47
  *
@@ -51,8 +85,8 @@ class ProcessService {
51
85
  }
52
86
  getProcessCount(id) {
53
87
  return this.http.post(`${this.valtimoEndpointUri}v2/process/definition/${id}/count`, {
54
- 'key': id,
55
- 'processVariables': [{ '@type': 'boolean', 'name': 'active', 'value': true }]
88
+ key: id,
89
+ processVariables: [{ '@type': 'boolean', name: 'active', value: true }],
56
90
  });
57
91
  }
58
92
  getProcessHeatmapCount(processDefinition) {
@@ -66,7 +100,7 @@ class ProcessService {
66
100
  .set('page', page.toString())
67
101
  .set('size', size.toString())
68
102
  .set('sort', sort);
69
- return this.http.post(`${this.valtimoEndpointUri}v2/process/${key}/search`, {}, { 'params': params });
103
+ return this.http.post(`${this.valtimoEndpointUri}v2/process/${key}/search`, {}, { params: params });
70
104
  }
71
105
  getProcessInstance(processInstanceId) {
72
106
  return this.http.get(`${this.valtimoEndpointUri}process/${processInstanceId}`, {});
@@ -101,10 +135,12 @@ class ProcessService {
101
135
  params.set('fromDate', fromDate);
102
136
  params.set('toDate', toDate);
103
137
  params.set('processFilter', processFilter);
104
- return this.http.get(`${this.valtimoEndpointUri}reporting/instancesstatistics`, { 'params': params });
138
+ return this.http.get(`${this.valtimoEndpointUri}reporting/instancesstatistics`, {
139
+ params: params,
140
+ });
105
141
  }
106
142
  deployProcess(processXml) {
107
- const formData = new FormData;
143
+ const formData = new FormData();
108
144
  formData.append('file', new File([processXml], 'process.bpmn'));
109
145
  formData.append('deployment-name', 'valtimoConsoleApp');
110
146
  formData.append('deployment-source', 'process application');
@@ -117,7 +153,7 @@ class ProcessService {
117
153
  ProcessService.ɵprov = ɵɵdefineInjectable({ factory: function ProcessService_Factory() { return new ProcessService(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: ProcessService, providedIn: "root" });
118
154
  ProcessService.decorators = [
119
155
  { type: Injectable, args: [{
120
- providedIn: 'root'
156
+ providedIn: 'root',
121
157
  },] }
122
158
  ];
123
159
  ProcessService.ctorParameters = () => [
@@ -236,15 +272,15 @@ class ProcessDiagramComponent {
236
272
  this.min = 0;
237
273
  this.max = 0;
238
274
  Object.keys(this.inputData).forEach(key => {
239
- const diagramContainer = this.el.nativeElement.querySelector('svg')
240
- .getBoundingClientRect(), diagramElm = this.el.nativeElement.querySelector(`g[data-element-id=${key}]`)
275
+ const diagramContainer = this.el.nativeElement.querySelector('svg').getBoundingClientRect(), diagramElm = this.el.nativeElement
276
+ .querySelector(`g[data-element-id=${key}]`)
241
277
  .getBoundingClientRect();
242
278
  this.setMax(key);
243
279
  this.heatPoints.data.push({
244
280
  x: Math.round(diagramElm.x - diagramContainer.x + diagramElm.width / 2),
245
281
  y: Math.round(diagramElm.y - diagramContainer.y + diagramElm.height / 2),
246
282
  value: this.inputData[key][this.valueKey],
247
- radius: diagramElm.width / 2
283
+ radius: diagramElm.width / 2,
248
284
  });
249
285
  this.addCounterActiveOverlays(key, this.inputData);
250
286
  });
@@ -272,15 +308,15 @@ class ProcessDiagramComponent {
272
308
  this.min = 0;
273
309
  this.max = 0;
274
310
  Object.keys(this.inputData).forEach(key => {
275
- const diagramContainer = this.el.nativeElement.querySelector('svg')
276
- .getBoundingClientRect(), diagramElm = this.el.nativeElement.querySelector(`g[data-element-id=${key}]`)
311
+ const diagramContainer = this.el.nativeElement.querySelector('svg').getBoundingClientRect(), diagramElm = this.el.nativeElement
312
+ .querySelector(`g[data-element-id=${key}]`)
277
313
  .getBoundingClientRect();
278
314
  this.setMax(key);
279
315
  this.heatPoints.data.push({
280
316
  x: Math.round(diagramElm.x - diagramContainer.x + diagramElm.width / 2),
281
317
  y: Math.round(diagramElm.y - diagramContainer.y + diagramElm.height / 2),
282
318
  value: this.inputData[key][this.valueKey],
283
- radius: diagramElm.width / 2
319
+ radius: diagramElm.width / 2,
284
320
  });
285
321
  this.addCounterActiveOverlays(key, this.inputData);
286
322
  });
@@ -310,16 +346,16 @@ class ProcessDiagramComponent {
310
346
  if (!this.heatMapInstance) {
311
347
  this.heatMapInstance = create({
312
348
  radius: 54,
313
- blur: .70,
314
- maxOpacity: .4,
349
+ blur: 0.7,
350
+ maxOpacity: 0.4,
315
351
  minOpacity: 0,
316
- container: this.el.nativeElement
352
+ container: this.el.nativeElement,
317
353
  });
318
354
  }
319
355
  this.heatMapInstance.setData({
320
356
  min: this.min,
321
357
  max: this.max,
322
- data: this.heatPoints.data
358
+ data: this.heatPoints.data,
323
359
  });
324
360
  }
325
361
  clearHeatmap() {
@@ -349,20 +385,20 @@ class ProcessDiagramComponent {
349
385
  overlays.add(key, {
350
386
  position: {
351
387
  bottom: 13,
352
- left: -12
388
+ left: -12,
353
389
  },
354
390
  show: {
355
391
  minZoom: 0,
356
- maxZoom: 5.0
392
+ maxZoom: 5.0,
357
393
  },
358
- html: `<span class="badge badge-pill badge-primary">${inputData[key].count}</span>`
394
+ html: `<span class="badge badge-pill badge-primary">${inputData[key].count}</span>`,
359
395
  });
360
396
  }
361
397
  }
362
398
  ProcessDiagramComponent.decorators = [
363
399
  { type: Component, args: [{
364
400
  selector: 'valtimo-process-diagram',
365
- 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",
401
+ 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",
366
402
  encapsulation: ViewEncapsulation.None,
367
403
  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}"]
368
404
  },] }
@@ -396,9 +432,7 @@ class ProcessModule {
396
432
  }
397
433
  ProcessModule.decorators = [
398
434
  { type: NgModule, args: [{
399
- declarations: [
400
- ProcessDiagramComponent
401
- ],
435
+ declarations: [ProcessDiagramComponent],
402
436
  imports: [
403
437
  CommonModule,
404
438
  ListModule,
@@ -409,12 +443,10 @@ ProcessModule.decorators = [
409
443
  BrowserAnimationsModule,
410
444
  ToastrModule.forRoot({
411
445
  positionClass: 'toast-bottom-full-width',
412
- preventDuplicates: true
413
- })
414
- ],
415
- exports: [
416
- ProcessDiagramComponent
446
+ preventDuplicates: true,
447
+ }),
417
448
  ],
449
+ exports: [ProcessDiagramComponent],
418
450
  },] }
419
451
  ];
420
452
 
@@ -1 +1 @@
1
- {"version":3,"file":"valtimo-process.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":["heatmap.create"],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;;MAyBa,cAAc;IAGzB,YACU,IAAgB,EACxB,aAA4B;QADpB,SAAI,GAAJ,IAAI,CAAY;QAGxB,IAAI,CAAC,kBAAkB,GAAG,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC;KACvE;IAED,qBAAqB;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAsB,GAAG,IAAI,CAAC,kBAAkB,oBAAoB,CAAC,CAAC;KAC3F;IAED,4BAA4B,CAAC,GAAW;QACtC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAsB,GAAG,IAAI,CAAC,kBAAkB,sBAAsB,GAAG,WAAW,CAAC,CAAC;KAC3G;IAED,oBAAoB,CAAC,GAAW;QAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAoB,GAAG,IAAI,CAAC,kBAAkB,sBAAsB,GAAG,EAAE,CAAC,CAAC;KAChG;IAED,iCAAiC,CAAC,oBAA4B;QAC5D,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAA6B,GAAG,IAAI,CAAC,kBAAkB,sBAAsB,oBAAoB,aAAa,CAAC,CAAC;KACrI;IAED,mBAAmB,CAAC,GAAW,EAAE,WAAmB,EAAE,SAA2B;QAC/E,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CACnB,GAAG,IAAI,CAAC,kBAAkB,sBAAsB,GAAG,IAAI,WAAW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EAAE;gBACJ,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,GAAG;aACb;YACD,IAAI,EAAE,gDAAgD,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,SAAS;SACpF,CAAC,CAAC;KACJ;;;YAhRF,SAAS,SAAC;gBACT,QAAQ,EAAE,yBAAyB;gBACnC,u+FAA+C;gBAE/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;;aACtC;;;YAVO,cAAc;;;iBAgBnB,SAAS,SAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;yBACjC,MAAM;mCACN,KAAK;gCACL,KAAK;;;AC/CR;;;;;;;;;;;;;;;MA6Ca,aAAa;;;YAtBzB,QAAQ,SAAC;gBACR,YAAY,EAAE;oBACZ,uBAAuB;iBACxB;gBACD,OAAO,EAAE;oBACP,YAAY;oBACZ,UAAU;oBACV,YAAY;oBACZ,cAAc;oBACd,mBAAmB;oBACnB,iBAAiB;oBACjB,uBAAuB;oBACvB,YAAY,CAAC,OAAO,CAAC;wBACnB,aAAa,EAAE,yBAAyB;wBACxC,iBAAiB,EAAE,IAAI;qBACxB,CAAC;iBACH;gBACD,OAAO,EAAE;oBACP,uBAAuB;iBACxB;aACF;;;AC3CD;;;;;;;;;;;;;;;;ACAA;;;;;;"}
1
+ {"version":3,"file":"valtimo-process.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":["heatmap.create"],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;MA+Ba,cAAc;IAGzB,YAAoB,IAAgB,EAAE,aAA4B;QAA9C,SAAI,GAAJ,IAAI,CAAY;QAClC,IAAI,CAAC,kBAAkB,GAAG,a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,YAAY;oBACZ,UAAU;oBACV,YAAY;oBACZ,cAAc;oBACd,mBAAmB;oBACnB,iBAAiB;oBACjB,uBAAuB;oBACvB,YAAY,CAAC,OAAO,CAAC;wBACnB,aAAa,EAAE,yBAAyB;wBACxC,iBAAiB,EAAE,IAAI;qBACxB,CAAC;iBACH;gBACD,OAAO,EAAE,CAAC,uBAAuB,CAAC;aACnC;;;AC7CD;;;;;;;;;;;;;;;;ACAA;;;;;;"}
@@ -0,0 +1 @@
1
+ export * from './process.model';
@@ -0,0 +1,92 @@
1
+ export interface ProcessStart {
2
+ key: string;
3
+ businessKey: string;
4
+ variables: Array<any>;
5
+ }
6
+ export interface Process {
7
+ id: string;
8
+ businessKey: string;
9
+ startTime: string;
10
+ endTime: string;
11
+ processDefinitionKey: string;
12
+ processDefinitionName: string;
13
+ startUserId: string;
14
+ deleteReason: string;
15
+ startUser: string;
16
+ processStarted: string;
17
+ processEnded: string;
18
+ active: boolean;
19
+ variables: ProcessInstanceVariable[];
20
+ }
21
+ export interface ProcessDefinition {
22
+ visibleInMenu: any;
23
+ category: string;
24
+ deploymentId: string;
25
+ description: string;
26
+ diagram: string;
27
+ historyTimeToLive: string;
28
+ id: string;
29
+ key: string;
30
+ name: string;
31
+ resource: string;
32
+ startableInTasklist: boolean;
33
+ suspended: false;
34
+ tenantId: string;
35
+ version: number;
36
+ versionTag: string;
37
+ }
38
+ export interface ProcessDefinitionStartForm {
39
+ formFields: Array<any>;
40
+ formLocation: string;
41
+ genericForm: boolean;
42
+ }
43
+ export interface ProcessInstance {
44
+ id: string;
45
+ businessKey: string;
46
+ startTime: string;
47
+ endTime: string;
48
+ processDefinitionKey: string;
49
+ processDefinitionName: string;
50
+ startUserId: string;
51
+ deleteReason: string;
52
+ variables: ProcessInstanceVariable[];
53
+ }
54
+ export interface ProcessInstanceVariable {
55
+ id: string;
56
+ type: string;
57
+ name: string;
58
+ textValue?: string;
59
+ longValue?: number;
60
+ local: boolean;
61
+ }
62
+ export interface ProcessInstanceTask {
63
+ id: string;
64
+ name: string;
65
+ assignee: string;
66
+ created: string;
67
+ createdUnix: number;
68
+ due: string;
69
+ followUp: string;
70
+ delegationState: string;
71
+ description: string;
72
+ executionId: string;
73
+ owner: string;
74
+ parentTaskId: string;
75
+ priority: number;
76
+ processDefinitionId: string;
77
+ processInstanceId: string;
78
+ taskDefinitionKey: string;
79
+ caseExecutionId: string;
80
+ caseInstanceId: string;
81
+ caseDefinitionId: string;
82
+ suspended: boolean;
83
+ formKey: string;
84
+ tenantId: string;
85
+ identityLinks: IdentityLink[];
86
+ isLocked(): boolean;
87
+ }
88
+ export interface IdentityLink {
89
+ userId: string;
90
+ groupId: string;
91
+ type: string;
92
+ }
@@ -1,6 +1,6 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
2
  import { Observable } from 'rxjs';
3
- import { ProcessDefinition, ProcessDefinitionStartForm, ProcessInstance, ProcessInstanceTask } from '@valtimo/contract';
3
+ import { ProcessDefinition, ProcessDefinitionStartForm, ProcessInstance, ProcessInstanceTask } from './models';
4
4
  import { ConfigService } from '@valtimo/config';
5
5
  export declare class ProcessService {
6
6
  private http;
package/package.json CHANGED
@@ -1,10 +1,7 @@
1
1
  {
2
2
  "name": "@valtimo/process",
3
3
  "license": "EUPL-1.2",
4
- "version": "4.15.2",
5
- "publishConfig": {
6
- "registry": "http://repo.ritense.com/repository/npm-ritense-private/"
7
- },
4
+ "version": "4.16.0-next-main.19",
8
5
  "peerDependencies": {
9
6
  "@angular/common": "^10.0.11",
10
7
  "@angular/core": "^10.0.11"
package/public_api.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './lib/models';
1
2
  export * from './lib/process.service';
2
3
  export * from './lib/process.module';
3
4
  export * from './lib/process-diagram/process-diagram.component';
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"ProcessService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":22,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":29,"character":18},{"__symbolic":"reference","module":"@valtimo/config","name":"ConfigService","line":30,"character":19}]}],"getProcessDefinitions":[{"__symbolic":"method"}],"getProcessDefinitionVersions":[{"__symbolic":"method"}],"getProcessDefinition":[{"__symbolic":"method"}],"getProcessDefinitionStartFormData":[{"__symbolic":"method"}],"startProcesInstance":[{"__symbolic":"method"}],"getProcessDefinitionXml":[{"__symbolic":"method"}],"getProcessXml":[{"__symbolic":"method"}],"getProcessCount":[{"__symbolic":"method"}],"getProcessHeatmapCount":[{"__symbolic":"method"}],"getProcessHeatmapDuration":[{"__symbolic":"method"}],"getProcessInstances":[{"__symbolic":"method"}],"getProcessInstance":[{"__symbolic":"method"}],"getProcessInstanceTasks":[{"__symbolic":"method"}],"getProcessInstanceVariables":[{"__symbolic":"method"}],"addProcessInstancesDefaultVariablesValues":[{"__symbolic":"method"}],"addDefaultVariablesValues":[{"__symbolic":"method"}],"getInstancesStatistics":[{"__symbolic":"method"}],"deployProcess":[{"__symbolic":"method"}],"migrateProcess":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}},"ProcessModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":23,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"ProcessDiagramComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":28,"character":4},{"__symbolic":"reference","module":"@valtimo/components","name":"ListModule","line":29,"character":4},{"__symbolic":"reference","module":"@valtimo/components","name":"WidgetModule","line":30,"character":4},{"__symbolic":"reference","module":"@valtimo/components","name":"TimelineModule","line":31,"character":4},{"__symbolic":"reference","module":"@valtimo/components","name":"BpmnJsDiagramModule","line":32,"character":4},{"__symbolic":"reference","module":"@valtimo/components","name":"CamundaFormModule","line":33,"character":4},{"__symbolic":"reference","module":"@angular/platform-browser/animations","name":"BrowserAnimationsModule","line":34,"character":4},{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"ngx-toastr","name":"ToastrModule","line":35,"character":4},"member":"forRoot"},"arguments":[{"positionClass":"toast-bottom-full-width","preventDuplicates":true}]}],"exports":[{"__symbolic":"reference","name":"ProcessDiagramComponent"}]}]}],"members":{}},"ProcessDiagramComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":33,"character":1},"arguments":[{"selector":"valtimo-process-diagram","encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":37,"character":17},"member":"None"},"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","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}"]}]}],"members":{"el":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":44,"character":3},"arguments":["ref",{"static":true}]}]}],"importDone":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":45,"character":3}}]}],"processDefinitionKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}}]}],"processInstanceId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":47,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ProcessService"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"loadProcessDefinition":[{"__symbolic":"method"}],"loadProcessDefinitionVersions":[{"__symbolic":"method"}],"loadProcessDefinitionFromKey":[{"__symbolic":"method"}],"loadProcessDefinitionXml":[{"__symbolic":"method"}],"loadProcessInstanceXml":[{"__symbolic":"method"}],"loadProcessDefinitionHeatmapCount":[{"__symbolic":"method"}],"onWindowResize":[{"__symbolic":"method"}],"loadProcessDefinitionHeatmapDuration":[{"__symbolic":"method"}],"setProcessDefinitionKey":[{"__symbolic":"method"}],"setProcessDefinitionVersion":[{"__symbolic":"method"}],"setHeatmapOption":[{"__symbolic":"method"}],"toggleShowHeatmap":[{"__symbolic":"method"}],"loadHeatmap":[{"__symbolic":"method"}],"clearHeatmap":[{"__symbolic":"method"}],"loadHeatmapData":[{"__symbolic":"method"}],"setMax":[{"__symbolic":"method"}],"addCounterActiveOverlays":[{"__symbolic":"method"}]}}},"origins":{"ProcessService":"./lib/process.service","ProcessModule":"./lib/process.module","ProcessDiagramComponent":"./lib/process-diagram/process-diagram.component"},"importAs":"@valtimo/process"}
1
+ {"__symbolic":"module","version":4,"exports":[{"from":"./lib/process.model"}],"metadata":{"ProcessService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":28,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":34,"character":28},{"__symbolic":"reference","module":"@valtimo/config","name":"ConfigService","line":34,"character":55}]}],"getProcessDefinitions":[{"__symbolic":"method"}],"getProcessDefinitionVersions":[{"__symbolic":"method"}],"getProcessDefinition":[{"__symbolic":"method"}],"getProcessDefinitionStartFormData":[{"__symbolic":"method"}],"startProcesInstance":[{"__symbolic":"method"}],"getProcessDefinitionXml":[{"__symbolic":"method"}],"getProcessXml":[{"__symbolic":"method"}],"getProcessCount":[{"__symbolic":"method"}],"getProcessHeatmapCount":[{"__symbolic":"method"}],"getProcessHeatmapDuration":[{"__symbolic":"method"}],"getProcessInstances":[{"__symbolic":"method"}],"getProcessInstance":[{"__symbolic":"method"}],"getProcessInstanceTasks":[{"__symbolic":"method"}],"getProcessInstanceVariables":[{"__symbolic":"method"}],"addProcessInstancesDefaultVariablesValues":[{"__symbolic":"method"}],"addDefaultVariablesValues":[{"__symbolic":"method"}],"getInstancesStatistics":[{"__symbolic":"method"}],"deployProcess":[{"__symbolic":"method"}],"migrateProcess":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}},"ProcessModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":29,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"ProcessDiagramComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":32,"character":4},{"__symbolic":"reference","module":"@valtimo/components","name":"ListModule","line":33,"character":4},{"__symbolic":"reference","module":"@valtimo/components","name":"WidgetModule","line":34,"character":4},{"__symbolic":"reference","module":"@valtimo/components","name":"TimelineModule","line":35,"character":4},{"__symbolic":"reference","module":"@valtimo/components","name":"BpmnJsDiagramModule","line":36,"character":4},{"__symbolic":"reference","module":"@valtimo/components","name":"CamundaFormModule","line":37,"character":4},{"__symbolic":"reference","module":"@angular/platform-browser/animations","name":"BrowserAnimationsModule","line":38,"character":4},{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"ngx-toastr","name":"ToastrModule","line":39,"character":4},"member":"forRoot"},"arguments":[{"positionClass":"toast-bottom-full-width","preventDuplicates":true}]}],"exports":[{"__symbolic":"reference","name":"ProcessDiagramComponent"}]}]}],"members":{}},"ProcessDiagramComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":33,"character":1},"arguments":[{"selector":"valtimo-process-diagram","encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":37,"character":17},"member":"None"},"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","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}"]}]}],"members":{"el":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":43,"character":3},"arguments":["ref",{"static":true}]}]}],"importDone":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":44,"character":3}}]}],"processDefinitionKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":3}}]}],"processInstanceId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ProcessService"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"loadProcessDefinition":[{"__symbolic":"method"}],"loadProcessDefinitionVersions":[{"__symbolic":"method"}],"loadProcessDefinitionFromKey":[{"__symbolic":"method"}],"loadProcessDefinitionXml":[{"__symbolic":"method"}],"loadProcessInstanceXml":[{"__symbolic":"method"}],"loadProcessDefinitionHeatmapCount":[{"__symbolic":"method"}],"onWindowResize":[{"__symbolic":"method"}],"loadProcessDefinitionHeatmapDuration":[{"__symbolic":"method"}],"setProcessDefinitionKey":[{"__symbolic":"method"}],"setProcessDefinitionVersion":[{"__symbolic":"method"}],"setHeatmapOption":[{"__symbolic":"method"}],"toggleShowHeatmap":[{"__symbolic":"method"}],"loadHeatmap":[{"__symbolic":"method"}],"clearHeatmap":[{"__symbolic":"method"}],"loadHeatmapData":[{"__symbolic":"method"}],"setMax":[{"__symbolic":"method"}],"addCounterActiveOverlays":[{"__symbolic":"method"}]}}},"origins":{"ProcessService":"./lib/process.service","ProcessModule":"./lib/process.module","ProcessDiagramComponent":"./lib/process-diagram/process-diagram.component"},"importAs":"@valtimo/process"}