@valtimo/process-management 12.14.1 → 13.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/fesm2022/valtimo-process-management.mjs +1524 -246
  2. package/fesm2022/valtimo-process-management.mjs.map +1 -1
  3. package/lib/components/index.d.ts +3 -0
  4. package/lib/components/index.d.ts.map +1 -0
  5. package/lib/components/process-management/process-management.component.d.ts +23 -0
  6. package/lib/components/process-management/process-management.component.d.ts.map +1 -0
  7. package/lib/components/process-management-builder/panel/index.d.ts +2 -0
  8. package/lib/components/process-management-builder/panel/index.d.ts.map +1 -0
  9. package/lib/components/process-management-builder/panel/valtimo-properties-provider.d.ts +18 -0
  10. package/lib/components/process-management-builder/panel/valtimo-properties-provider.d.ts.map +1 -0
  11. package/lib/components/process-management-builder/process-management-builder.component.d.ts +98 -0
  12. package/lib/components/process-management-builder/process-management-builder.component.d.ts.map +1 -0
  13. package/lib/components/process-management-list/process-management-list.component.d.ts +40 -0
  14. package/lib/components/process-management-list/process-management-list.component.d.ts.map +1 -0
  15. package/lib/components/process-management-upload/process-management-upload.component.d.ts +24 -0
  16. package/lib/components/process-management-upload/process-management-upload.component.d.ts.map +1 -0
  17. package/lib/constants/bpmn.constants.d.ts +3 -0
  18. package/lib/constants/bpmn.constants.d.ts.map +1 -0
  19. package/lib/constants/index.d.ts +2 -0
  20. package/lib/constants/index.d.ts.map +1 -0
  21. package/lib/models/bpmn.model.d.ts +12 -0
  22. package/lib/models/bpmn.model.d.ts.map +1 -0
  23. package/lib/models/index.d.ts +5 -0
  24. package/lib/models/index.d.ts.map +1 -0
  25. package/lib/models/process-management.model.d.ts +19 -0
  26. package/lib/models/process-management.model.d.ts.map +1 -0
  27. package/lib/models/process.model.d.ts +11 -0
  28. package/lib/models/process.model.d.ts.map +1 -0
  29. package/lib/models/window.model.d.ts +11 -0
  30. package/lib/models/window.model.d.ts.map +1 -0
  31. package/lib/{process-management-routing.d.ts → process-management-routing.module.d.ts} +1 -1
  32. package/lib/process-management-routing.module.d.ts.map +1 -0
  33. package/lib/process-management.module.d.ts +10 -10
  34. package/lib/process-management.module.d.ts.map +1 -1
  35. package/lib/services/index.d.ts +4 -0
  36. package/lib/services/index.d.ts.map +1 -0
  37. package/lib/services/process-management-editor.service.d.ts +47 -0
  38. package/lib/services/process-management-editor.service.d.ts.map +1 -0
  39. package/lib/services/process-management-state.service.d.ts +14 -0
  40. package/lib/services/process-management-state.service.d.ts.map +1 -0
  41. package/lib/services/process-management.service.d.ts +30 -0
  42. package/lib/services/process-management.service.d.ts.map +1 -0
  43. package/lib/utils/bpmn.utils.d.ts +3 -0
  44. package/lib/utils/bpmn.utils.d.ts.map +1 -0
  45. package/lib/utils/index.d.ts +3 -0
  46. package/lib/utils/index.d.ts.map +1 -0
  47. package/lib/utils/process-management.utils.d.ts +6 -0
  48. package/lib/utils/process-management.utils.d.ts.map +1 -0
  49. package/package.json +9 -8
  50. package/public-api.d.ts +4 -1
  51. package/public-api.d.ts.map +1 -1
  52. package/esm2022/lib/process-management-builder/process-management-builder.component.mjs +0 -175
  53. package/esm2022/lib/process-management-list/process-management-list.component.mjs +0 -51
  54. package/esm2022/lib/process-management-routing.mjs +0 -58
  55. package/esm2022/lib/process-management-upload/process-management-upload.component.mjs +0 -54
  56. package/esm2022/lib/process-management.component.mjs +0 -33
  57. package/esm2022/lib/process-management.module.mjs +0 -65
  58. package/esm2022/lib/process-management.service.mjs +0 -42
  59. package/esm2022/public-api.mjs +0 -21
  60. package/esm2022/valtimo-process-management.mjs +0 -5
  61. package/lib/process-management-builder/process-management-builder.component.d.ts +0 -41
  62. package/lib/process-management-builder/process-management-builder.component.d.ts.map +0 -1
  63. package/lib/process-management-list/process-management-list.component.d.ts +0 -20
  64. package/lib/process-management-list/process-management-list.component.d.ts.map +0 -1
  65. package/lib/process-management-routing.d.ts.map +0 -1
  66. package/lib/process-management-upload/process-management-upload.component.d.ts +0 -17
  67. package/lib/process-management-upload/process-management-upload.component.d.ts.map +0 -1
  68. package/lib/process-management.component.d.ts +0 -8
  69. package/lib/process-management.component.d.ts.map +0 -1
  70. package/lib/process-management.service.d.ts +0 -14
  71. package/lib/process-management.service.d.ts.map +0 -1
@@ -1,31 +1,41 @@
1
- import * as i0 from '@angular/core';
2
- import { Component, Injectable, EventEmitter, ViewChild, Output, ViewEncapsulation, NgModule } from '@angular/core';
3
- import * as i5 from '@angular/router';
4
- import { RouterModule } from '@angular/router';
5
- import * as i1 from '@valtimo/process';
6
- import * as i4 from '@valtimo/components';
7
- import { WidgetModule, ListModule } from '@valtimo/components';
8
- import * as i4$1 from '@ngx-translate/core';
9
- import { TranslateModule } from '@ngx-translate/core';
10
- import * as i1$1 from '@valtimo/config';
11
- import { ROLE_ADMIN } from '@valtimo/config';
12
- import * as i2 from '@angular/common/http';
13
1
  import * as i6 from '@angular/common';
14
2
  import { CommonModule } from '@angular/common';
15
- import { AuthGuardService } from '@valtimo/security';
16
- import { BehaviorSubject, forkJoin } from 'rxjs';
3
+ import * as i0 from '@angular/core';
4
+ import { Injectable, signal, computed, ViewChild, Component, EventEmitter, Output, ChangeDetectionStrategy, NgModule } from '@angular/core';
5
+ import * as i1$2 from '@angular/forms';
6
+ import { ReactiveFormsModule, Validators, FormsModule } from '@angular/forms';
7
+ import * as i4 from '@ngx-translate/core';
8
+ import { TranslateModule, TranslateService } from '@ngx-translate/core';
9
+ import * as i1$1 from '@valtimo/components';
10
+ import { PendingChangesComponent, FitPageDirective, RenderInPageHeaderDirective, ViewType, CarbonListModule, ConfirmationModalModule, CARBON_CONSTANTS, pendingChangesGuard, WidgetModule } from '@valtimo/components';
11
+ import * as i5 from '@valtimo/process-link';
12
+ import { ProcessLinkEditMode, ProcessLinkModule, ProcessLinkStateService, ProcessLinkStepService, ProcessLinkButtonService } from '@valtimo/process-link';
13
+ import * as i2$2 from 'carbon-components-angular';
14
+ import { LoadingModule, DropdownModule, SelectModule, ButtonModule, IconModule, TagModule, DialogModule, ToggleModule, TooltipModule, FileUploaderModule, ModalModule, LayerModule, NotificationModule, RadioModule } from 'carbon-components-angular';
15
+ import * as i2$1 from '@valtimo/shared';
16
+ import { BaseApiService, getCaseManagementRouteParams, getCaseManagementRouteParamsAndContext, ROLE_ADMIN } from '@valtimo/shared';
17
+ import { useService, BpmnPropertiesPanelModule, BpmnPropertiesProviderModule, CamundaPlatformPropertiesProviderModule } from 'bpmn-js-properties-panel';
17
18
  import Modeler from 'bpmn-js/lib/Modeler';
18
- import BpmnJS from 'bpmn-js/dist/bpmn-navigated-viewer.production.min.js';
19
- import PropertiesPanelModule from 'bpmn-js-properties-panel';
20
- import PropertiesProviderModule from 'bpmn-js-properties-panel/lib/provider/camunda';
21
- import CamundaExtensionModule from 'camunda-bpmn-moddle/lib';
22
- import CamundaModdleDescriptor from 'camunda-bpmn-moddle/resources/camunda.json';
23
- import * as i3 from '@valtimo/layout';
24
- import * as i7 from '@angular/forms';
25
- import { FormsModule } from '@angular/forms';
19
+ import camundaPlatformBehaviors from 'camunda-bpmn-js-behaviors/lib/camunda-platform';
20
+ import CamundaBpmnModdle from 'camunda-bpmn-moddle/resources/camunda.json';
21
+ import { isEqual } from 'lodash';
22
+ import { filter, BehaviorSubject, Subscription, Subject, combineLatest, switchMap, of, tap, map as map$1, startWith, from, take } from 'rxjs';
23
+ import { distinctUntilChanged, map, filter as filter$1 } from 'rxjs/operators';
24
+ import * as i2 from '@valtimo/form';
25
+ import { toObservable } from '@angular/core/rxjs-interop';
26
+ import * as i1 from '@angular/common/http';
27
+ import { html } from 'htm/preact';
28
+ import { is } from 'bpmn-js/lib/util/ModelUtil';
29
+ import * as i3 from 'ngx-logger';
30
+ import * as i7 from '@valtimo/process';
31
+ import * as i8 from '@angular/router';
32
+ import { RouterModule } from '@angular/router';
33
+ import * as i10 from '@valtimo/plugin';
34
+ import { Upload16 } from '@carbon/icons';
35
+ import { AuthGuardService } from '@valtimo/security';
26
36
 
27
37
  /*
28
- * Copyright 2015-2024 Ritense BV, the Netherlands.
38
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
29
39
  *
30
40
  * Licensed under EUPL, Version 1.2 (the "License");
31
41
  * you may not use this file except in compliance with the License.
@@ -39,38 +49,189 @@ import { FormsModule } from '@angular/forms';
39
49
  * See the License for the specific language governing permissions and
40
50
  * limitations under the License.
41
51
  */
42
- class ProcessManagementListComponent {
43
- constructor(processService, router) {
44
- this.processService = processService;
45
- this.router = router;
46
- this.processDefinitions = [];
47
- this.fields = [
48
- { key: 'key', label: 'Key' },
49
- { key: 'name', label: 'Name' },
50
- { key: 'readOnly', label: 'Read-only' },
51
- ];
52
+ const EMPTY_BPMN = `
53
+ <?xml version="1.0" encoding="UTF-8"?>
54
+ <bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://bpmn.io/schema/bpmn" id="Definitions_1">
55
+ <bpmn:process id="Process_1" isExecutable="false">
56
+ <bpmn:startEvent id="StartEvent_1"/>
57
+ </bpmn:process>
58
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
59
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
60
+ <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
61
+ <dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/>
62
+ </bpmndi:BPMNShape>
63
+ </bpmndi:BPMNPlane>
64
+ </bpmndi:BPMNDiagram>
65
+ </bpmn:definitions>
66
+ `;
67
+
68
+ /*
69
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
70
+ *
71
+ * Licensed under EUPL, Version 1.2 (the "License");
72
+ * you may not use this file except in compliance with the License.
73
+ * You may obtain a copy of the License at
74
+ *
75
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
76
+ *
77
+ * Unless required by applicable law or agreed to in writing, software
78
+ * distributed under the License is distributed on an "AS IS" basis,
79
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
80
+ * See the License for the specific language governing permissions and
81
+ * limitations under the License.
82
+ */
83
+
84
+ /*
85
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
86
+ *
87
+ * Licensed under EUPL, Version 1.2 (the "License");
88
+ * you may not use this file except in compliance with the License.
89
+ * You may obtain a copy of the License at
90
+ *
91
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
92
+ *
93
+ * Unless required by applicable law or agreed to in writing, software
94
+ * distributed under the License is distributed on an "AS IS" basis,
95
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
96
+ * See the License for the specific language governing permissions and
97
+ * limitations under the License.
98
+ */
99
+ class ProcessManagementEditorService {
100
+ get selectionProcessDefinition$() {
101
+ return this._selectionProcessDefinitionSubject$.pipe(filter(selectedProcessDefinition => !!selectedProcessDefinition?.id), distinctUntilChanged((previous, current) => isEqual(previous, current)));
52
102
  }
53
- ngOnInit() {
54
- this.loadProcessDefinitions();
103
+ get selectionProcessDefinition() {
104
+ return this._selectionProcessDefinitionSubject$.getValue();
105
+ }
106
+ get processLinksForSelectedDefinition$() {
107
+ return this._processLinksForSelectedDefinition$.asObservable();
108
+ }
109
+ get processLinksForSelectedDefinition() {
110
+ return this._processLinksForSelectedDefinition$.getValue();
111
+ }
112
+ get openProcessLinkModalEvents$() {
113
+ return this._openProcessLinkModalEvents$.asObservable();
114
+ }
115
+ setSelectedProcessDefinition(definition) {
116
+ this._selectionProcessDefinitionSubject$.next(definition);
117
+ }
118
+ get formDefinitionOptions() {
119
+ return this._formDefinitionOptions$.getValue();
120
+ }
121
+ constructor(processLinkService, formService) {
122
+ this.processLinkService = processLinkService;
123
+ this.formService = formService;
124
+ this._selectionProcessDefinitionSubject$ = new BehaviorSubject(null);
125
+ this._processLinksForSelectedDefinition$ = new BehaviorSubject([]);
126
+ this._processLinksFetchedForSelectedDefinition$ = new BehaviorSubject(false);
127
+ this._subscriptions = new Subscription();
128
+ this._openProcessLinkModalEvents$ = new Subject();
129
+ this._caseManagementRouteParams$ = new BehaviorSubject(null);
130
+ this._formDefinitionOptions$ = new BehaviorSubject([]);
131
+ this._updatingBpmnView = false;
132
+ this._activityIdBusinessIdMap = {};
133
+ this.openSelectedProcessDefinitionSubscription();
134
+ this.openFormDefinitionOptionsSubscription();
135
+ }
136
+ ngOnDestroy() {
137
+ this._subscriptions.unsubscribe();
138
+ }
139
+ setCaseManagementRouteParams(context, params) {
140
+ this._caseManagementRouteParams$.next([context, params]);
141
+ }
142
+ sendOpenProcessLinkModalEvent(event, updateBpmnViewFunction) {
143
+ this._updateBpmnViewFunction = updateBpmnViewFunction;
144
+ this._openProcessLinkModalEvents$.next(event);
145
+ }
146
+ updateProcessLink(event) {
147
+ this.setProcessLinksForSelectedDefinition(this.processLinksForSelectedDefinition.map(processLink => {
148
+ if (processLink.activityId === event.activityId) {
149
+ return { ...processLink, ...event };
150
+ }
151
+ return processLink;
152
+ }));
153
+ this.updateBpmnView();
154
+ }
155
+ createProcessLink(event) {
156
+ this.setProcessLinksForSelectedDefinition([
157
+ ...this.processLinksForSelectedDefinition,
158
+ event,
159
+ ]);
160
+ this.updateBpmnView();
161
+ }
162
+ deleteProcessLink(event, updateBpmnViewFunction) {
163
+ if (updateBpmnViewFunction) {
164
+ this._updateBpmnViewFunction = updateBpmnViewFunction;
165
+ }
166
+ this.setProcessLinksForSelectedDefinition(this.processLinksForSelectedDefinition.filter(processLink => processLink.activityId !== event.activityId));
167
+ this.updateBpmnView();
168
+ }
169
+ setProcessLinksForSelectedDefinition(processLinks) {
170
+ this._processLinksForSelectedDefinition$.next(processLinks);
55
171
  }
56
- loadProcessDefinitions() {
57
- this.processService.getProcessDefinitions().subscribe((processDefs) => {
58
- this.processDefinitions = processDefs;
172
+ setActivityIdBusinessIdMap(activityIdBusinessIdMap) {
173
+ this._activityIdBusinessIdMap = activityIdBusinessIdMap;
174
+ }
175
+ updateProcessLinksOnIdChange(activityId, newBusinessId) {
176
+ const newBusinessIdWithoutLabelString = newBusinessId.replace('_label', '');
177
+ if (!this._activityIdBusinessIdMap[activityId] ||
178
+ this._activityIdBusinessIdMap[activityId] === newBusinessIdWithoutLabelString) {
179
+ return;
180
+ }
181
+ this.updateProcessLinkId(this._activityIdBusinessIdMap[activityId], newBusinessId);
182
+ this._activityIdBusinessIdMap = { ...this._activityIdBusinessIdMap, [activityId]: newBusinessId };
183
+ }
184
+ openSelectedProcessDefinitionSubscription() {
185
+ this._subscriptions.add(this.selectionProcessDefinition$.subscribe(definition => {
186
+ this.fetchProcessLinksForDefinition(definition.id);
187
+ }));
188
+ }
189
+ fetchProcessLinksForDefinition(processDefinitionId) {
190
+ this.processLinkService.getProcessLink({ processDefinitionId }).subscribe(res => {
191
+ this.setProcessLinksForSelectedDefinition(res);
59
192
  });
60
193
  }
61
- editProcessDefinition(processDefinition) {
62
- this.router.navigate(['/processes/process', processDefinition.key]);
194
+ updateBpmnView() {
195
+ if (!this._updateBpmnViewFunction || this._updatingBpmnView)
196
+ return;
197
+ this._updatingBpmnView = true;
198
+ this._updateBpmnViewFunction();
199
+ this._updatingBpmnView = false;
200
+ }
201
+ updateProcessLinkId(oldBusinessId, newBusinessId) {
202
+ this.setProcessLinksForSelectedDefinition(this.processLinksForSelectedDefinition.map(processLink => {
203
+ if (processLink.activityId === oldBusinessId) {
204
+ return { ...processLink, activityId: newBusinessId };
205
+ }
206
+ return processLink;
207
+ }));
208
+ this.updateBpmnView();
63
209
  }
64
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementListComponent, deps: [{ token: i1.ProcessService }, { token: i5.Router }], target: i0.ɵɵFactoryTarget.Component }); }
65
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ProcessManagementListComponent, selector: "valtimo-process-management-list", ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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<valtimo-widget>\n <valtimo-list\n [items]=\"processDefinitions\"\n [fields]=\"fields\"\n (rowClicked)=\"editProcessDefinition($event)\"\n [header]=\"true\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Processes' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'Overview of all Processes' | translate }}</h5>\n </div>\n </valtimo-list>\n</valtimo-widget>\n", styles: ["/*!\n * Copyright 2015-2024 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"], dependencies: [{ kind: "component", type: i4.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: i4.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState", "lastColumnTemplate"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] }); }
210
+ openFormDefinitionOptionsSubscription() {
211
+ this._subscriptions.add(this._caseManagementRouteParams$
212
+ .pipe(filter((params) => params !== null))
213
+ .subscribe(([context, params]) => {
214
+ if (context === 'independent') {
215
+ this.formService
216
+ .getAllUnlinkedFormDefinitions()
217
+ .subscribe(options => this._formDefinitionOptions$.next(options));
218
+ }
219
+ else {
220
+ this.formService
221
+ .getAllFormDefinitionsForCaseDefinition(params.caseDefinitionKey, params.caseDefinitionVersionTag)
222
+ .subscribe(options => this._formDefinitionOptions$.next(options));
223
+ }
224
+ }));
225
+ }
226
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementEditorService, deps: [{ token: i5.ProcessLinkService }, { token: i2.FormService }], target: i0.ɵɵFactoryTarget.Injectable }); }
227
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementEditorService }); }
66
228
  }
67
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementListComponent, decorators: [{
68
- type: Component,
69
- args: [{ selector: 'valtimo-process-management-list', template: "<!--\n ~ Copyright 2015-2024 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<valtimo-widget>\n <valtimo-list\n [items]=\"processDefinitions\"\n [fields]=\"fields\"\n (rowClicked)=\"editProcessDefinition($event)\"\n [header]=\"true\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Processes' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'Overview of all Processes' | translate }}</h5>\n </div>\n </valtimo-list>\n</valtimo-widget>\n", styles: ["/*!\n * Copyright 2015-2024 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"] }]
70
- }], ctorParameters: () => [{ type: i1.ProcessService }, { type: i5.Router }] });
229
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementEditorService, decorators: [{
230
+ type: Injectable
231
+ }], ctorParameters: () => [{ type: i5.ProcessLinkService }, { type: i2.FormService }] });
71
232
 
72
233
  /*
73
- * Copyright 2015-2024 Ritense BV, the Netherlands.
234
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
74
235
  *
75
236
  * Licensed under EUPL, Version 1.2 (the "License");
76
237
  * you may not use this file except in compliance with the License.
@@ -84,31 +245,208 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
84
245
  * See the License for the specific language governing permissions and
85
246
  * limitations under the License.
86
247
  */
87
- class ProcessManagementService {
88
- constructor(configService, http) {
248
+ class ProcessManagementStateService {
249
+ constructor() {
250
+ this._openModal$ = new Subject();
251
+ this._reloadDefinitions$ = new BehaviorSubject(null);
252
+ }
253
+ get openModal$() {
254
+ return this._openModal$.asObservable();
255
+ }
256
+ get reloadDefinitions$() {
257
+ return this._reloadDefinitions$.asObservable();
258
+ }
259
+ openModal() {
260
+ this._openModal$.next(true);
261
+ }
262
+ closeModal() {
263
+ this._openModal$.next(false);
264
+ }
265
+ reloadDefinitions() {
266
+ this._reloadDefinitions$.next(null);
267
+ }
268
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
269
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementStateService, providedIn: 'root' }); }
270
+ }
271
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementStateService, decorators: [{
272
+ type: Injectable,
273
+ args: [{ providedIn: 'root' }]
274
+ }] });
275
+
276
+ /*
277
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
278
+ *
279
+ * Licensed under EUPL, Version 1.2 (the "License");
280
+ * you may not use this file except in compliance with the License.
281
+ * You may obtain a copy of the License at
282
+ *
283
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
284
+ *
285
+ * Unless required by applicable law or agreed to in writing, software
286
+ * distributed under the License is distributed on an "AS IS" basis,
287
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
288
+ * See the License for the specific language governing permissions and
289
+ * limitations under the License.
290
+ */
291
+
292
+ /*
293
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
294
+ *
295
+ * Licensed under EUPL, Version 1.2 (the "License");
296
+ * you may not use this file except in compliance with the License.
297
+ * You may obtain a copy of the License at
298
+ *
299
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
300
+ *
301
+ * Unless required by applicable law or agreed to in writing, software
302
+ * distributed under the License is distributed on an "AS IS" basis,
303
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
304
+ * See the License for the specific language governing permissions and
305
+ * limitations under the License.
306
+ */
307
+
308
+ /*
309
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
310
+ *
311
+ * Licensed under EUPL, Version 1.2 (the "License");
312
+ * you may not use this file except in compliance with the License.
313
+ * You may obtain a copy of the License at
314
+ *
315
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
316
+ *
317
+ * Unless required by applicable law or agreed to in writing, software
318
+ * distributed under the License is distributed on an "AS IS" basis,
319
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
320
+ * See the License for the specific language governing permissions and
321
+ * limitations under the License.
322
+ */
323
+ const PROCESS_MANAGEMENT_ENDPOINTS = {
324
+ case: '/management/v1/case-definition',
325
+ independent: '/management/v1/process-definition',
326
+ };
327
+
328
+ /*
329
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
330
+ *
331
+ * Licensed under EUPL, Version 1.2 (the "License");
332
+ * you may not use this file except in compliance with the License.
333
+ * You may obtain a copy of the License at
334
+ *
335
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
336
+ *
337
+ * Unless required by applicable law or agreed to in writing, software
338
+ * distributed under the License is distributed on an "AS IS" basis,
339
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
340
+ * See the License for the specific language governing permissions and
341
+ * limitations under the License.
342
+ */
343
+
344
+ /*
345
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
346
+ *
347
+ * Licensed under EUPL, Version 1.2 (the "License");
348
+ * you may not use this file except in compliance with the License.
349
+ * You may obtain a copy of the License at
350
+ *
351
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
352
+ *
353
+ * Unless required by applicable law or agreed to in writing, software
354
+ * distributed under the License is distributed on an "AS IS" basis,
355
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
356
+ * See the License for the specific language governing permissions and
357
+ * limitations under the License.
358
+ */
359
+
360
+ class ProcessManagementService extends BaseApiService {
361
+ set context(value) {
362
+ this._context.set(value);
363
+ }
364
+ get context() {
365
+ return this._context.asReadonly();
366
+ }
367
+ constructor(httpClient, configService) {
368
+ super(httpClient, configService);
369
+ this.httpClient = httpClient;
89
370
  this.configService = configService;
90
- this.http = http;
91
- this.valtimoApiConfig = configService.config.valtimoApi;
371
+ this._definitionKey$ = new BehaviorSubject(null);
372
+ this._caseDefinitionVersionTag$ = new BehaviorSubject(null);
373
+ this._context = signal('independent');
374
+ this.processes$ = combineLatest([
375
+ this._definitionKey$,
376
+ this._caseDefinitionVersionTag$,
377
+ toObservable(this._context),
378
+ ]).pipe(switchMap(([definitionKey, caseDefinitionVersionTag, context]) => {
379
+ if (context === 'independent') {
380
+ return this.getUnlinkedProcesses();
381
+ }
382
+ if (!!definitionKey && !!caseDefinitionVersionTag) {
383
+ return this.getProcesses(definitionKey, caseDefinitionVersionTag);
384
+ }
385
+ return of([]);
386
+ }));
387
+ }
388
+ setParams(caseDefinitionKey, caseDefinitionVersionTag) {
389
+ this._definitionKey$.next(caseDefinitionKey);
390
+ this._caseDefinitionVersionTag$.next(caseDefinitionVersionTag);
391
+ }
392
+ deleteProcess(processDefinitionKey) {
393
+ return this.httpClient.delete(this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._context()]}/${this._definitionKey$.getValue()}/version/${this._caseDefinitionVersionTag$.getValue()}/process-definition/key/${processDefinitionKey}`));
394
+ }
395
+ deleteUnlinkedProcess(processDefinitionKey) {
396
+ return this.httpClient.delete(this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._context()]}/key/${processDefinitionKey}`));
92
397
  }
93
398
  deployBpmn(bpmn) {
94
399
  const formData = new FormData();
95
400
  formData.append('file', bpmn);
96
- formData.append('deployment-name', 'valtimoConsoleApp');
97
- formData.append('deployment-source', 'process application');
98
- return this.http.post(`${this.valtimoApiConfig.endpointUri}v1/process/definition/deployment`, formData);
401
+ formData.append('processLinks', new Blob([JSON.stringify([].map(processLink => this.emptyStringToNull(processLink)))], {
402
+ type: 'application/json',
403
+ }));
404
+ return this.httpClient.post(this._context() === 'case'
405
+ ? this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._context()]}/${this._definitionKey$.getValue()}/version/${this._caseDefinitionVersionTag$.getValue()}/process-definition`)
406
+ : this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._context()]}`), formData);
407
+ }
408
+ getProcessDefinitionForCase(caseDefinitionKey, caseDefinitionVersionTag, processDefinitionKey) {
409
+ return this.httpClient.get(this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._context()]}/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/process-definition/key/${processDefinitionKey}`));
410
+ }
411
+ getUnlinkedProcessDefinitionsByKey(processDefinitionKey) {
412
+ return this.httpClient.get(this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._context()]}/key/${processDefinitionKey}`));
413
+ }
414
+ updateProcessDefinitionCaseDefinitionProperties(caseDefinitionKey, caseDefinitionVersionTag, processDefinitionId, body) {
415
+ return this.httpClient.put(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/process/${processDefinitionId}/properties`), body);
416
+ }
417
+ getProcesses(definitionName, caseDefinitionVersionTag) {
418
+ return this.httpClient.get(this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._context()]}/${definitionName}/version/${caseDefinitionVersionTag}/process-definition`));
419
+ }
420
+ getUnlinkedProcesses() {
421
+ return this.httpClient.get(this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._context()]}`));
422
+ }
423
+ emptyStringToNull(object) {
424
+ if (object && typeof object === 'object') {
425
+ Object.keys(object).forEach(key => {
426
+ const typedKey = key;
427
+ const value = object[typedKey];
428
+ if (typeof value === 'object' && value !== null) {
429
+ this.emptyStringToNull(value);
430
+ }
431
+ else if (value === '') {
432
+ object[typedKey] = null;
433
+ }
434
+ });
435
+ }
436
+ return object;
99
437
  }
100
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementService, deps: [{ token: i1$1.ConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
101
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementService, providedIn: 'root' }); }
438
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementService, deps: [{ token: i1.HttpClient }, { token: i2$1.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
439
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementService, providedIn: 'root' }); }
102
440
  }
103
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementService, decorators: [{
441
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementService, decorators: [{
104
442
  type: Injectable,
105
443
  args: [{
106
444
  providedIn: 'root',
107
445
  }]
108
- }], ctorParameters: () => [{ type: i1$1.ConfigService }, { type: i2.HttpClient }] });
446
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$1.ConfigService }] });
109
447
 
110
448
  /*
111
- * Copyright 2015-2024 Ritense BV, the Netherlands.
449
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
112
450
  *
113
451
  * Licensed under EUPL, Version 1.2 (the "License");
114
452
  * you may not use this file except in compliance with the License.
@@ -122,43 +460,325 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
122
460
  * See the License for the specific language governing permissions and
123
461
  * limitations under the License.
124
462
  */
125
- class ProcessManagementUploadComponent {
126
- constructor(processManagementService, alertService) {
127
- this.processManagementService = processManagementService;
128
- this.alertService = alertService;
129
- this.bpmn = null;
130
- this.reload = new EventEmitter();
463
+
464
+ /*
465
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
466
+ *
467
+ * Licensed under EUPL, Version 1.2 (the "License");
468
+ * you may not use this file except in compliance with the License.
469
+ * You may obtain a copy of the License at
470
+ *
471
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
472
+ *
473
+ * Unless required by applicable law or agreed to in writing, software
474
+ * distributed under the License is distributed on an "AS IS" basis,
475
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
476
+ * See the License for the specific language governing permissions and
477
+ * limitations under the License.
478
+ */
479
+ const mapActivityTypeToActivityListenerType = (activityType) => {
480
+ if (activityType === 'bpmn:UserTask') {
481
+ return activityType + ':create';
482
+ }
483
+ return activityType + ':start';
484
+ };
485
+
486
+ function getContextObservable(route) {
487
+ return route.data.pipe(map(data => (data && data['context']) || null), distinctUntilChanged());
488
+ }
489
+
490
+ /*
491
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
492
+ *
493
+ * Licensed under EUPL, Version 1.2 (the "License");
494
+ * you may not use this file except in compliance with the License.
495
+ * You may obtain a copy of the License at
496
+ *
497
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
498
+ *
499
+ * Unless required by applicable law or agreed to in writing, software
500
+ * distributed under the License is distributed on an "AS IS" basis,
501
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
502
+ * See the License for the specific language governing permissions and
503
+ * limitations under the License.
504
+ */
505
+
506
+ /*
507
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
508
+ *
509
+ * Licensed under EUPL, Version 1.2 (the "License");
510
+ * you may not use this file except in compliance with the License.
511
+ * You may obtain a copy of the License at
512
+ *
513
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
514
+ *
515
+ * Unless required by applicable law or agreed to in writing, software
516
+ * distributed under the License is distributed on an "AS IS" basis,
517
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
518
+ * See the License for the specific language governing permissions and
519
+ * limitations under the License.
520
+ */
521
+ class ValtimoPropertiesProvider {
522
+ static { this.$inject = ['propertiesPanel', 'translate']; }
523
+ get processManagementEditorService() {
524
+ return window.processManagementEditorService;
131
525
  }
132
- onChange(files) {
133
- this.bpmn = files.item(0);
526
+ get translateService() {
527
+ return window.translateService;
134
528
  }
135
- uploadProcessBpmn() {
136
- this.processManagementService.deployBpmn(this.bpmn).subscribe(() => {
137
- this.bpmn = null;
138
- this.bpmnFile.nativeElement.value = '';
139
- this.alertService.success('Deployment successful');
140
- this.reload.emit();
141
- }, error => {
142
- this.bpmn = null;
143
- this.bpmnFile.nativeElement.value = '';
144
- this.alertService.error(`Deployment failed. ${error}`);
145
- });
529
+ get pluginTranslationService() {
530
+ return window.pluginTranslationService;
531
+ }
532
+ constructor(propertiesPanel) {
533
+ propertiesPanel.registerProvider(500, this);
534
+ }
535
+ addAsSecondOrFirst(arr, element) {
536
+ if (arr.length === 0) {
537
+ arr.push(element);
538
+ }
539
+ else {
540
+ arr.splice(1, 0, element);
541
+ }
542
+ return arr;
543
+ }
544
+ getGroups(element) {
545
+ const processLink = this.processManagementEditorService.processLinksForSelectedDefinition.find(processLink => processLink.activityId === element.id) || null;
546
+ return (groups) => {
547
+ if (is(element, 'bpmn:UserTask') ||
548
+ is(element, 'bpmn:StartEvent') ||
549
+ is(element, 'bpmn:ServiceTask') ||
550
+ is(element, 'bpmn:CallActivity')) {
551
+ const customGroup = {
552
+ id: 'customRootGroup',
553
+ label: 'Process link',
554
+ entries: [this.createCustomRootElement(element, processLink)],
555
+ groupType: 'root',
556
+ };
557
+ this.addAsSecondOrFirst(groups, customGroup);
558
+ }
559
+ return groups;
560
+ };
561
+ }
562
+ createCustomRootElement(element, processLink) {
563
+ return {
564
+ translateService: this.translateService,
565
+ processManagementEditorService: this.processManagementEditorService,
566
+ pluginTranslationService: this.pluginTranslationService,
567
+ id: 'customRootElement',
568
+ processLink,
569
+ element,
570
+ component: CustomRootElement,
571
+ isEdited: () => false,
572
+ };
146
573
  }
147
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementUploadComponent, deps: [{ token: ProcessManagementService }, { token: i4.AlertService }], target: i0.ɵɵFactoryTarget.Component }); }
148
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ProcessManagementUploadComponent, selector: "valtimo-process-management-upload", outputs: { reload: "reload" }, viewQueries: [{ propertyName: "bpmnFile", first: true, predicate: ["bpmnFile"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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<div\n class=\"modal fade\"\n id=\"uploadProcess\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-labelledby=\"uploadProcessLabel\"\n aria-hidden=\"true\"\n>\n <div class=\"modal-dialog modal-dialog-centered\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h3 class=\"modal-title\" id=\"uploadProcessLabel\">Upload process</h3>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <h5>BPMN Model</h5>\n <input\n #bpmnFile\n type=\"file\"\n id=\"file\"\n accept=\".bpmn\"\n (change)=\"onChange($event.target.files)\"\n />\n </div>\n <div class=\"modal-footer\">\n <div class=\"btn-group\">\n <button\n type=\"button\"\n class=\"btn btn-primary btn-space\"\n (click)=\"uploadProcessBpmn()\"\n [disabled]=\"!bpmn\"\n data-dismiss=\"modal\"\n >\n Upload\n </button>\n </div>\n </div>\n </div>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2024 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"] }); }
149
574
  }
150
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementUploadComponent, decorators: [{
151
- type: Component,
152
- args: [{ selector: 'valtimo-process-management-upload', template: "<!--\n ~ Copyright 2015-2024 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<div\n class=\"modal fade\"\n id=\"uploadProcess\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-labelledby=\"uploadProcessLabel\"\n aria-hidden=\"true\"\n>\n <div class=\"modal-dialog modal-dialog-centered\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h3 class=\"modal-title\" id=\"uploadProcessLabel\">Upload process</h3>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <h5>BPMN Model</h5>\n <input\n #bpmnFile\n type=\"file\"\n id=\"file\"\n accept=\".bpmn\"\n (change)=\"onChange($event.target.files)\"\n />\n </div>\n <div class=\"modal-footer\">\n <div class=\"btn-group\">\n <button\n type=\"button\"\n class=\"btn btn-primary btn-space\"\n (click)=\"uploadProcessBpmn()\"\n [disabled]=\"!bpmn\"\n data-dismiss=\"modal\"\n >\n Upload\n </button>\n </div>\n </div>\n </div>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2024 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"] }]
153
- }], ctorParameters: () => [{ type: ProcessManagementService }, { type: i4.AlertService }], propDecorators: { reload: [{
154
- type: Output
155
- }], bpmnFile: [{
156
- type: ViewChild,
157
- args: ['bpmnFile']
158
- }] } });
575
+ const CustomRootElement = (props) => {
576
+ const { element, processLink, translateService, processManagementEditorService, pluginTranslationService, } = props;
577
+ const modeling = useService('modeling');
578
+ const editProcessLinkText = translateService.instant('interface.edit');
579
+ const unlinkText = translateService.instant('processLink.unlink');
580
+ const createText = translateService.instant('processLink.create');
581
+ const modalParams = {
582
+ processDefinitionKey: processManagementEditorService.selectionProcessDefinition?.key,
583
+ processDefinitionId: processManagementEditorService.selectionProcessDefinition?.id,
584
+ element: {
585
+ id: element.id,
586
+ type: element.type,
587
+ activityListenerType: mapActivityTypeToActivityListenerType(element.type),
588
+ name: element.di.bpmnElement.name,
589
+ },
590
+ };
591
+ const handleCreateClick = () => {
592
+ const event = {
593
+ modalParams,
594
+ };
595
+ processManagementEditorService.sendOpenProcessLinkModalEvent(event, () => {
596
+ modeling.updateProperties(element, {});
597
+ });
598
+ };
599
+ const handleEditClick = () => {
600
+ const event = {
601
+ processLink,
602
+ modalParams,
603
+ };
604
+ processManagementEditorService.sendOpenProcessLinkModalEvent(event, () => {
605
+ modeling.updateProperties(element, {});
606
+ });
607
+ };
608
+ const handleUnlinkClick = () => {
609
+ processManagementEditorService.deleteProcessLink({ activityId: processLink.activityId }, () => {
610
+ modeling.updateProperties(element, {});
611
+ });
612
+ };
613
+ const processLinkFormDefinitionId = processLink?.formDefinitionId;
614
+ const processLinkFormDefinitionName = processManagementEditorService.formDefinitionOptions.find(option => option.id === processLinkFormDefinitionId)?.name;
615
+ if (processLinkFormDefinitionName) {
616
+ return html `<div class="process-link-properties-panel">
617
+ <div class="process-link-properties-panel__header">
618
+ <span class="process-link-properties-panel__title">${processLinkFormDefinitionName}</span>
619
+
620
+ <cds-tag
621
+ class="cds--tag cds--tag--blue cds--tag--md cds--layout--size-md cds-tag--no-margin"
622
+ ><span class="cds--tag__label">
623
+ ${translateService.instant('processLinkType.form')}
624
+ </span>
625
+ </cds-tag>
626
+ </div>
627
+
628
+ <div class="process-link-properties-panel__buttons">
629
+ <button
630
+ class="cds--btn cds--btn--danger cds--btn--sm cds--layout--side-md"
631
+ onClick=${handleUnlinkClick}
632
+ >
633
+ ${unlinkText}
634
+ </button>
635
+
636
+ <button
637
+ class="cds--btn cds--btn--primary cds--btn--sm cds--layout--size-md"
638
+ onClick=${handleEditClick}
639
+ >
640
+ ${editProcessLinkText}
641
+ </button>
642
+ </div>
643
+ </div>`;
644
+ }
645
+ const processLinkFormFlowDefinitionKey = processLink?.formFlowDefinitionKey;
646
+ if (processLinkFormFlowDefinitionKey) {
647
+ return html `<div class="process-link-properties-panel">
648
+ <div class="process-link-properties-panel__header">
649
+ <span class="process-link-properties-panel__title"
650
+ >${processLinkFormFlowDefinitionKey}</span
651
+ >
652
+
653
+ <cds-tag
654
+ class="cds--tag cds--tag--teal cds--tag--md cds--layout--size-md cds-tag--no-margin"
655
+ ><span class="cds--tag__label">
656
+ ${translateService.instant('processLinkType.form-flow')}
657
+ </span>
658
+ </cds-tag>
659
+ </div>
660
+
661
+ <div class="process-link-properties-panel__buttons">
662
+ <button
663
+ class="cds--btn cds--btn--danger cds--btn--sm cds--layout--side-md"
664
+ onClick=${handleUnlinkClick}
665
+ >
666
+ ${unlinkText}
667
+ </button>
668
+
669
+ <button
670
+ class="cds--btn cds--btn--primary cds--btn--sm cds--layout--size-md"
671
+ onClick=${handleEditClick}
672
+ >
673
+ ${editProcessLinkText}
674
+ </button>
675
+ </div>
676
+ </div>`;
677
+ }
678
+ const pluginActionKey = processLink?.pluginActionDefinitionKey;
679
+ const pluginActionTranslation = pluginTranslationService.instantByPluginActionKey(pluginActionKey);
680
+ const pluginTitleTranslation = pluginTranslationService.instantPluginTitleByPluginActionKey(pluginActionKey);
681
+ if (pluginActionKey) {
682
+ return html `<div class="process-link-properties-panel">
683
+ <div class="process-link-properties-panel__header">
684
+ <span class="process-link-properties-panel__title-container">
685
+ <span class="process-link-properties-panel__title">${pluginTitleTranslation}</span>
686
+
687
+ <span class="process-link-properties-panel__title">${pluginActionTranslation}</span>
688
+ </span>
689
+
690
+ <cds-tag
691
+ class="cds--tag cds--tag--purple cds--tag--md cds--layout--size-md cds-tag--no-margin"
692
+ ><span class="cds--tag__label">
693
+ ${translateService.instant('processLinkType.plugin')}
694
+ </span>
695
+ </cds-tag>
696
+ </div>
697
+
698
+ <div class="process-link-properties-panel__buttons">
699
+ <button
700
+ class="cds--btn cds--btn--danger cds--btn--sm cds--layout--side-md"
701
+ onClick=${handleUnlinkClick}
702
+ >
703
+ ${unlinkText}
704
+ </button>
705
+
706
+ <button
707
+ class="cds--btn cds--btn--primary cds--btn--sm cds--layout--size-md"
708
+ onClick=${handleEditClick}
709
+ >
710
+ ${editProcessLinkText}
711
+ </button>
712
+ </div>
713
+ </div>`;
714
+ }
715
+ const uiComponentKey = processLink?.componentKey;
716
+ if (uiComponentKey) {
717
+ return html `<div class="process-link-properties-panel">
718
+ <div class="process-link-properties-panel__header">
719
+ <span class="process-link-properties-panel__title">${uiComponentKey}</span>
720
+
721
+ <cds-tag
722
+ class="cds--tag cds--tag--magenta cds--tag--md cds--layout--size-md cds-tag--no-margin"
723
+ ><span class="cds--tag__label">
724
+ ${translateService.instant('processLinkType.ui-component')}
725
+ </span>
726
+ </cds-tag>
727
+ </div>
728
+
729
+ <div class="process-link-properties-panel__buttons">
730
+ <button
731
+ class="cds--btn cds--btn--danger cds--btn--sm cds--layout--side-md"
732
+ onClick=${handleUnlinkClick}
733
+ >
734
+ ${unlinkText}
735
+ </button>
736
+
737
+ <button
738
+ class="cds--btn cds--btn--primary cds--btn--sm cds--layout--size-md"
739
+ onClick=${handleEditClick}
740
+ >
741
+ ${editProcessLinkText}
742
+ </button>
743
+ </div>
744
+ </div>`;
745
+ }
746
+ const genericLinkedPanel = html `<div class="process-link-properties-panel">
747
+ <div class="process-link-properties-panel__buttons">
748
+ <button
749
+ class="cds--btn cds--btn--danger cds--btn--sm cds--layout--side-md"
750
+ onClick=${handleUnlinkClick}
751
+ >
752
+ ${unlinkText}
753
+ </button>
754
+
755
+ <button
756
+ class="cds--btn cds--btn--primary cds--btn--sm cds--layout--size-md"
757
+ onClick=${handleEditClick}
758
+ >
759
+ ${editProcessLinkText}
760
+ </button>
761
+ </div>
762
+ </div>`;
763
+ const genericCreatePanel = html `<div class="process-link-properties-panel">
764
+ <div class="process-link-properties-panel__buttons">
765
+ <button
766
+ class="cds--btn cds--btn--primary cds--btn--sm cds--layout--size-md"
767
+ onClick=${handleCreateClick}
768
+ >
769
+ ${createText}
770
+ </button>
771
+ </div>
772
+ </div>`;
773
+ return processLink ? genericLinkedPanel : genericCreatePanel;
774
+ };
775
+ const ValtimoPropertiesProviderModule = {
776
+ __init__: ['customPropertiesProvider'],
777
+ customPropertiesProvider: ['type', ValtimoPropertiesProvider],
778
+ };
159
779
 
160
780
  /*
161
- * Copyright 2015-2024 Ritense BV, the Netherlands.
781
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
162
782
  *
163
783
  * Licensed under EUPL, Version 1.2 (the "License");
164
784
  * you may not use this file except in compliance with the License.
@@ -172,20 +792,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
172
792
  * See the License for the specific language governing permissions and
173
793
  * limitations under the License.
174
794
  */
175
- class ProcessManagementComponent {
176
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
177
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ProcessManagementComponent, selector: "valtimo-process-management", viewQueries: [{ propertyName: "processManagementList", first: true, predicate: ["processManagementList"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button\n class=\"btn btn-secondary btn-space\"\n data-toggle=\"modal\"\n data-target=\"#uploadProcess\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload process' | translate }}\n </button>\n <button class=\"btn btn-primary btn-space mr-0\" [routerLink]=\"'create'\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n {{ 'Create new Process' | translate }}\n </button>\n </div>\n </div>\n <valtimo-process-management-upload\n (reload)=\"processManagementList.loadProcessDefinitions()\"\n ></valtimo-process-management-upload>\n <valtimo-process-management-list #processManagementList></valtimo-process-management-list>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2024 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"], dependencies: [{ kind: "directive", type: i5.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: ProcessManagementListComponent, selector: "valtimo-process-management-list" }, { kind: "component", type: ProcessManagementUploadComponent, selector: "valtimo-process-management-upload", outputs: ["reload"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] }); }
178
- }
179
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementComponent, decorators: [{
180
- type: Component,
181
- args: [{ selector: 'valtimo-process-management', template: "<!--\n ~ Copyright 2015-2024 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<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button\n class=\"btn btn-secondary btn-space\"\n data-toggle=\"modal\"\n data-target=\"#uploadProcess\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload process' | translate }}\n </button>\n <button class=\"btn btn-primary btn-space mr-0\" [routerLink]=\"'create'\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n {{ 'Create new Process' | translate }}\n </button>\n </div>\n </div>\n <valtimo-process-management-upload\n (reload)=\"processManagementList.loadProcessDefinitions()\"\n ></valtimo-process-management-upload>\n <valtimo-process-management-list #processManagementList></valtimo-process-management-list>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2024 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"] }]
182
- }], propDecorators: { processManagementList: [{
183
- type: ViewChild,
184
- args: ['processManagementList']
185
- }] } });
186
795
 
187
796
  /*
188
- * Copyright 2015-2024 Ritense BV, the Netherlands.
797
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
189
798
  *
190
799
  * Licensed under EUPL, Version 1.2 (the "License");
191
800
  * you may not use this file except in compliance with the License.
@@ -199,77 +808,134 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
199
808
  * See the License for the specific language governing permissions and
200
809
  * limitations under the License.
201
810
  */
202
- class ProcessManagementBuilderComponent {
203
- constructor(http, processService, layoutService, alertService, route, router, pageTitleService) {
204
- this.http = http;
811
+ class ProcessManagementBuilderComponent extends PendingChangesComponent {
812
+ constructor(breadcrumbService, iconService, logger, modalService, notificationService, pageHeaderService, pageTitleService, processLinkService, processLinkStateService, processManagementEditorService, processManagementService, processService, route, router, translateService, pluginTranslationService, editPermissionsService) {
813
+ super();
814
+ this.breadcrumbService = breadcrumbService;
815
+ this.iconService = iconService;
816
+ this.logger = logger;
817
+ this.modalService = modalService;
818
+ this.notificationService = notificationService;
819
+ this.pageHeaderService = pageHeaderService;
820
+ this.pageTitleService = pageTitleService;
821
+ this.processLinkService = processLinkService;
822
+ this.processLinkStateService = processLinkStateService;
823
+ this.processManagementEditorService = processManagementEditorService;
824
+ this.processManagementService = processManagementService;
205
825
  this.processService = processService;
206
- this.layoutService = layoutService;
207
- this.alertService = alertService;
208
826
  this.route = route;
209
827
  this.router = router;
210
- this.pageTitleService = pageTitleService;
211
- this.processDefinitionVersions = null;
212
- this.selectedVersion = null;
213
- this.processKey = null;
828
+ this.translateService = translateService;
829
+ this.pluginTranslationService = pluginTranslationService;
830
+ this.editPermissionsService = editPermissionsService;
831
+ this._selectedProcess$ = new BehaviorSubject(null);
832
+ this.loading$ = new BehaviorSubject(true);
214
833
  this.isReadOnlyProcess$ = new BehaviorSubject(false);
215
834
  this.isSystemProcess$ = new BehaviorSubject(false);
216
- this.elementTemplateFiles = ['mailSendTask'];
217
- }
218
- ngOnInit() {
219
- this.init();
220
- }
221
- init() {
222
- this.processKey = this.route.snapshot.paramMap.get('key');
223
- forkJoin(this.getElementTemplates()).subscribe((elementTemplates) => {
224
- this.bpmnModeler = new Modeler({
225
- container: '#canvas',
226
- height: '90vh',
227
- additionalModules: [
228
- PropertiesPanelModule,
229
- PropertiesProviderModule,
230
- CamundaExtensionModule,
231
- ],
232
- propertiesPanel: {
233
- parent: '#properties',
234
- },
235
- moddleExtensions: {
236
- camunda: CamundaModdleDescriptor,
237
- },
238
- elementTemplates,
239
- });
240
- this.bpmnViewer = new BpmnJS();
241
- this.bpmnViewer.attachTo('#readOnlyCanvas');
242
- if (this.processKey) {
243
- this.loadProcessVersions(this.processKey);
244
- this.selectedVersion = null;
245
- }
246
- else {
247
- this.loadEmptyBpmn();
835
+ this.canInitializeDocument$ = new BehaviorSubject(false);
836
+ this.startableByUser$ = new BehaviorSubject(false);
837
+ this.selectedProcessDefinitionXml$ = this.processManagementEditorService.selectionProcessDefinition$.pipe(filter(selectedProcessDefinition => !!selectedProcessDefinition?.id), distinctUntilChanged((previous, current) => isEqual(previous, current)), tap(selectedProcessDefinition => {
838
+ this.loading$.next(true);
839
+ this.pageTitleService.setCustomPageTitle(selectedProcessDefinition.name);
840
+ }), switchMap(selectedProcessDefinition => this.processService.getProcessDefinitionXml(selectedProcessDefinition.id)), tap(result => {
841
+ this.cleanUpListenersOnModeler();
842
+ this._bpmnModeler?.importXML(result.bpmn20Xml);
843
+ this._bpmnViewer?.importXML(result.bpmn20Xml);
844
+ this.isReadOnlyProcess$.next(result.readOnly);
845
+ this.isSystemProcess$.next(result.systemProcess);
846
+ this.loading$.next(false);
847
+ }));
848
+ this.changesPending$ = new BehaviorSubject(false);
849
+ this.editParam$ = this.route.url.pipe(map$1(segments => {
850
+ const lastSegment = segments[segments.length - 1]?.path;
851
+ if (lastSegment === 'create') {
852
+ return 'create';
248
853
  }
249
- });
854
+ const param = this.route.snapshot.paramMap.get('processDefinitionKey');
855
+ return param ? param : null;
856
+ }), filter(editParam => !!editParam));
857
+ this.context$ = getContextObservable(this.route);
858
+ this.managementParams$ = this.context$.pipe(filter(context => context === 'case'), switchMap(() => getCaseManagementRouteParams(this.route)));
859
+ this.params$ = getCaseManagementRouteParams(this.route);
860
+ this.hasEditPermissions$ = combineLatest([
861
+ this.params$,
862
+ this.context$,
863
+ ]).pipe(switchMap(([params, context]) => this.editPermissionsService.hasPermissionsToEditBasedOnContext(params?.caseDefinitionKey, params?.caseDefinitionVersionTag, context)));
864
+ this._reload$ = new Subject();
865
+ this.processDefinitionVersions$ = combineLatest([
866
+ this.editParam$,
867
+ this.context$,
868
+ this._reload$.pipe(startWith(null)),
869
+ ]).pipe(switchMap(([editParam, context]) => context === 'independent'
870
+ ? this.processManagementService.getUnlinkedProcessDefinitionsByKey(editParam)
871
+ : of([])), map$1(result => result.map(resultItem => resultItem.processDefinition)), tap(processDefinitions => {
872
+ this.changesPending$.next(false);
873
+ this.pendingChanges = false;
874
+ this.setSelectedProcessDefinitionToLatest(processDefinitions);
875
+ }));
876
+ this.processDefinitionVersionsListItems$ = combineLatest([
877
+ this.processDefinitionVersions$,
878
+ this.processManagementEditorService.selectionProcessDefinition$,
879
+ this.translateService.stream('key'),
880
+ ]).pipe(map$1(([processDefinitionVersions, selectionProcessDefinition]) => processDefinitionVersions
881
+ .map(processDefinitionVersion => ({
882
+ id: processDefinitionVersion.version,
883
+ content: `${this.translateService.instant('processManagement.version')}${processDefinitionVersion.version}`,
884
+ selected: selectionProcessDefinition.version === processDefinitionVersion.version,
885
+ processDefinitionVersion,
886
+ }))
887
+ .sort((a, b) => b.id - a.id)));
888
+ this.compactMode$ = this.pageHeaderService.compactMode$;
889
+ this.creatingNewProcess$ = new BehaviorSubject(false);
890
+ this.extraSpace = computed(() => this.processManagementService.context() === 'case' ? 0 : 0);
891
+ this.updatingProcessDefinitionCaseDefinition$ = new BehaviorSubject(false);
892
+ this._subscriptions = new Subscription();
893
+ this.shapeAddedHandler = (event) => {
894
+ this.logger.debug('Shape added:', event);
895
+ };
896
+ this.shapeRemovedHandler = (event) => {
897
+ this.logger.debug('Shape removed:', event);
898
+ const activityId = event?.element?.id;
899
+ if (!activityId)
900
+ return;
901
+ this.processManagementEditorService.deleteProcessLink({ activityId });
902
+ };
903
+ this.elementChangedHandler = (event) => {
904
+ this.logger.debug('Element changed:', event);
905
+ const activityId = event?.element?.di?.id;
906
+ const businessId = event?.element?.id;
907
+ if (!activityId || !businessId)
908
+ return;
909
+ this.processManagementEditorService.updateProcessLinksOnIdChange(activityId, businessId);
910
+ };
911
+ this.setProcessManagementWindow();
250
912
  }
251
- deploy() {
252
- this.bpmnModeler.saveXML((err, xml) => {
253
- this.processService.deployProcess(xml).subscribe(asd => {
254
- if (this.processKey) {
255
- this.loadProcessVersions(this.processKey);
256
- }
257
- else {
258
- this.router.navigate(['/processes']);
259
- }
260
- this.alertService.success('Deployment successful');
261
- this.selectedVersion = null;
262
- });
263
- });
913
+ ngAfterViewInit() {
914
+ this.pageTitleService.disableReset();
915
+ this.openParamsAndContextSubscription();
916
+ this.initModeler();
917
+ this.initViewer();
918
+ this.subscribeToOpenProcessLinkModalEvents();
919
+ this.subscribeToProcessLinkUpdateEvents();
920
+ this.subscribeToProcessLinkCreateEvents();
921
+ this.subscribeToProcessLinkDeleteEvents();
922
+ this.processLinkStateService.setEditMode(ProcessLinkEditMode.EMIT_EVENTS);
923
+ this.initEditing();
264
924
  }
265
- reset() {
266
- this.bpmnModeler.destroy();
267
- this.bpmnViewer.destroy();
268
- this.init();
925
+ ngOnDestroy() {
926
+ this._bpmnModeler?.destroy();
927
+ this._bpmnViewer?.destroy();
928
+ this._subscriptions.unsubscribe();
929
+ this.pageTitleService.enableReset();
930
+ this.pageTitleService.clearPageActionsViewContainerRef();
931
+ this.breadcrumbService.clearThirdBreadcrumb();
932
+ this.breadcrumbService.clearFourthBreadcrumb();
269
933
  }
270
- download() {
271
- this.bpmnModeler.saveXML((err, xml) => {
272
- const file = new Blob([xml], { type: 'text/xml' });
934
+ export(isReadOnlyProcess) {
935
+ (isReadOnlyProcess ? from(this._bpmnViewer.saveXML()) : from(this._bpmnModeler.saveXML()))
936
+ .pipe(take(1))
937
+ .subscribe(result => {
938
+ const file = new Blob([result.xml ?? ''], { type: 'text/xml' });
273
939
  const link = document.createElement('a');
274
940
  link.download = 'diagram.bpmn';
275
941
  link.href = window.URL.createObjectURL(file);
@@ -278,72 +944,640 @@ class ProcessManagementBuilderComponent {
278
944
  link.remove();
279
945
  });
280
946
  }
281
- loadEmptyBpmn() {
282
- const url = '/assets/bpmn/initial.bpmn';
283
- this.http
284
- .get(url, {
285
- headers: { observe: 'response' },
286
- responseType: 'text',
287
- })
288
- .subscribe((xml) => {
289
- this.bpmnModeler.importXML(xml);
290
- this.bpmnViewer.importXML(xml);
947
+ deployChanges(isReadOnlyProcess) {
948
+ combineLatest([
949
+ from(isReadOnlyProcess ? this._bpmnViewer.saveXML() : this._bpmnModeler.saveXML()),
950
+ this.processManagementEditorService.processLinksForSelectedDefinition$,
951
+ this.processManagementEditorService.selectionProcessDefinition$,
952
+ this.context$,
953
+ this.managementParams$.pipe(startWith(null)),
954
+ ])
955
+ .pipe(take(1), switchMap(([result, processLinks, selectedProcessDefinition, context, params]) => {
956
+ if (context === 'case') {
957
+ return this.processLinkService.deployProcessWithProcessLinksForCase(processLinks, selectedProcessDefinition.id, !isReadOnlyProcess ? (result?.xml ?? '') : null, params?.caseDefinitionKey ?? '', params?.caseDefinitionVersionTag ?? '', this.canInitializeDocument$.getValue(), this.startableByUser$.getValue());
958
+ }
959
+ return this.processLinkService.deployProcessWithProcessLinks(processLinks, selectedProcessDefinition.id, !isReadOnlyProcess ? (result?.xml ?? '') : null);
960
+ }), switchMap(() => this.context$))
961
+ .subscribe({
962
+ next: context => {
963
+ if (context === 'independent') {
964
+ this.pendingChanges = false;
965
+ this.reload();
966
+ this.showNotification('success');
967
+ }
968
+ else {
969
+ this.pendingChanges = false;
970
+ this.navigateBack('success');
971
+ }
972
+ },
973
+ error: () => {
974
+ this.showNotification('error');
975
+ },
291
976
  });
292
977
  }
293
- getElementTemplates() {
294
- const templateObs = [];
295
- for (const file of this.elementTemplateFiles) {
296
- templateObs.push(this.http.get(`/assets/bpmn/element-templates/${file}.json`, {
297
- headers: { observe: 'response' },
298
- responseType: 'json',
978
+ deployNewProcessDefinition() {
979
+ combineLatest([
980
+ from(this._bpmnModeler.saveXML()),
981
+ this.processManagementEditorService.processLinksForSelectedDefinition$,
982
+ this.context$,
983
+ this.managementParams$.pipe(startWith(null)),
984
+ ])
985
+ .pipe(take(1), switchMap(([result, processLinks, context, params]) => {
986
+ const mappedProcessLinks = processLinks.map(link => ({
987
+ ...link,
988
+ processDefinitionId: '-',
299
989
  }));
300
- }
301
- return templateObs;
302
- }
303
- setLatestVersion() {
304
- this.selectedVersion = this.processDefinitionVersions.reduce((acc, version) => version.version > acc.version ? version : acc);
305
- this.loadProcessBpmn();
306
- }
307
- loadProcessVersions(processDefinitionKey) {
308
- this.processService
309
- .getProcessDefinitionVersions(processDefinitionKey)
310
- .subscribe((processDefinitionVersions) => {
311
- this.processDefinitionVersions = processDefinitionVersions;
312
- this.pageTitleService.setCustomPageTitle(processDefinitionVersions[processDefinitionVersions.length - 1].name);
313
- this.setLatestVersion();
990
+ return context === 'independent'
991
+ ? this.processLinkService.deployProcessWithProcessLinks(mappedProcessLinks, null, result.xml ?? '')
992
+ : this.processLinkService.deployProcessWithProcessLinksForCase(mappedProcessLinks, null, result.xml ?? '', params.caseDefinitionKey, params.caseDefinitionVersionTag, this.canInitializeDocument$.getValue(), this.startableByUser$.getValue());
993
+ }))
994
+ .subscribe({
995
+ next: () => {
996
+ this.pendingChanges = false;
997
+ this.navigateBack('success');
998
+ },
999
+ error: () => {
1000
+ this.showNotification('error');
1001
+ },
314
1002
  });
315
1003
  }
316
- compareProcessDefinitions(pd1, pd2) {
317
- if (pd1 === null && pd2 === null) {
318
- return true;
319
- }
320
- if (pd1 === null || pd2 === null) {
321
- return false;
322
- }
323
- return pd1.id === pd2.id;
1004
+ selectedVersionChange(event) {
1005
+ this.processManagementEditorService.selectionProcessDefinition$
1006
+ .pipe(take(1))
1007
+ .subscribe(selectedVersion => {
1008
+ if (selectedVersion.id !== event.item.processDefinitionVersion.id) {
1009
+ this.processManagementEditorService.setSelectedProcessDefinition(event?.item?.processDefinitionVersion);
1010
+ this.changesPending$.next(false);
1011
+ }
1012
+ });
324
1013
  }
325
- loadProcessBpmn() {
326
- this.processService.getProcessDefinitionXml(this.selectedVersion.id).subscribe(result => {
327
- this.bpmnModeler.importXML(result['bpmn20Xml']);
328
- this.bpmnViewer.importXML(result['bpmn20Xml']);
329
- this.isReadOnlyProcess$.next(result.readOnly);
330
- this.isSystemProcess$.next(result.systemProcess);
1014
+ navigateBack(notification) {
1015
+ this.router.navigate(['../'], { relativeTo: this.route });
1016
+ if (!notification)
1017
+ return;
1018
+ this.showNotification(notification);
1019
+ }
1020
+ onProcessToggleChange(field, value) {
1021
+ if (field === 'canInitializeDocument')
1022
+ this.canInitializeDocument$.next(value);
1023
+ if (field === 'startableByUser')
1024
+ this.startableByUser$.next(value);
1025
+ this.changesPending$.next(true);
1026
+ }
1027
+ setProcessManagementWindow() {
1028
+ const processManagementWindow = window;
1029
+ if (!processManagementWindow)
1030
+ return;
1031
+ processManagementWindow.processManagementEditorService = this.processManagementEditorService;
1032
+ processManagementWindow.translateService = this.translateService;
1033
+ processManagementWindow.pluginTranslationService = this.pluginTranslationService;
1034
+ }
1035
+ showNotification(notification) {
1036
+ this.notificationService.showToast({
1037
+ caption: this.translateService.instant(`processManagement.${notification}Notification`),
1038
+ type: notification,
1039
+ title: this.translateService.instant(`interface.${notification}`),
1040
+ });
1041
+ }
1042
+ setSelectedProcessDefinitionToLatest(processDefinitions) {
1043
+ if ((processDefinitions || []).length === 0)
1044
+ return;
1045
+ const latest = processDefinitions.reduce((acc, version) => version.version > acc.version ? version : acc);
1046
+ this.processManagementEditorService.setSelectedProcessDefinition(latest);
1047
+ }
1048
+ initModeler() {
1049
+ this._bpmnModeler = new Modeler({
1050
+ additionalModules: [
1051
+ BpmnPropertiesPanelModule,
1052
+ BpmnPropertiesProviderModule,
1053
+ CamundaPlatformPropertiesProviderModule,
1054
+ camundaPlatformBehaviors,
1055
+ ValtimoPropertiesProviderModule,
1056
+ ],
1057
+ moddleExtensions: { camunda: CamundaBpmnModdle },
1058
+ propertiesPanel: { parent: this.modelerPanelElementRef.nativeElement },
1059
+ });
1060
+ this._bpmnModeler?.attachTo(this.modelerElementRef.nativeElement);
1061
+ this._bpmnModeler.on('commandStack.changed', () => {
1062
+ this.changesPending$.next(true);
1063
+ this.pendingChanges = true;
1064
+ });
1065
+ this._bpmnModeler.on('import.done', () => {
1066
+ const idMap = {};
1067
+ const elementRegistry = this._bpmnModeler.get('elementRegistry');
1068
+ elementRegistry.forEach(element => {
1069
+ const activityId = element?.di?.id;
1070
+ const businessId = element?.id;
1071
+ if (!activityId || !businessId)
1072
+ return;
1073
+ idMap[activityId] = businessId;
1074
+ });
1075
+ this.processManagementEditorService.setActivityIdBusinessIdMap(idMap);
1076
+ this.listenToActivityChangesOnModeler();
331
1077
  });
332
1078
  }
1079
+ initViewer() {
1080
+ const disableCommands = () => {
1081
+ const commandStack = this._bpmnViewer.get('commandStack');
1082
+ const originalExecute = commandStack?.execute?.bind(commandStack);
1083
+ if (commandStack?.execute) {
1084
+ commandStack.execute = (command, context) => {
1085
+ if (command === 'elements.delete' ||
1086
+ command === 'elements.copy' ||
1087
+ command === 'elements.paste' ||
1088
+ command === 'elements.create') {
1089
+ return;
1090
+ }
1091
+ originalExecute(command, context);
1092
+ };
1093
+ }
1094
+ };
1095
+ const DisableBpmnWriteModule = {
1096
+ paletteProvider: ['value', {}],
1097
+ contextPadProvider: ['value', {}],
1098
+ directEditing: [
1099
+ 'value',
1100
+ {
1101
+ registerProvider: () => { },
1102
+ activate: () => { },
1103
+ deactivate: () => { },
1104
+ isActive: () => false,
1105
+ },
1106
+ ],
1107
+ move: ['value', null],
1108
+ resizeHandles: ['value', { addResizer: () => { }, removeResizers: () => { } }],
1109
+ };
1110
+ this._bpmnViewer = new Modeler({
1111
+ additionalModules: [
1112
+ DisableBpmnWriteModule,
1113
+ BpmnPropertiesPanelModule,
1114
+ ValtimoPropertiesProviderModule,
1115
+ ],
1116
+ moddleExtensions: { camunda: CamundaBpmnModdle },
1117
+ propertiesPanel: { parent: this.viewerPanelElementRef.nativeElement },
1118
+ });
1119
+ this._bpmnViewer?.attachTo(this.viewerElementRef.nativeElement);
1120
+ this._bpmnViewer.on('commandStack.changed', () => {
1121
+ this.changesPending$.next(true);
1122
+ this.pendingChanges = true;
1123
+ });
1124
+ this._bpmnViewer.on('import.done', () => {
1125
+ disableCommands();
1126
+ });
1127
+ }
1128
+ reload() {
1129
+ this._reload$.next(null);
1130
+ }
1131
+ handleUpdateEvent(event) {
1132
+ this.modalService.setModalData(event?.modalParams);
1133
+ this.processLinkStateService.setModalParams(event?.modalParams);
1134
+ this.processLinkStateService.setElementName(event?.modalParams?.element?.name ?? '');
1135
+ this.processLinkStateService.selectProcessLink(event.processLink);
1136
+ this.processLinkStateService.showModal();
1137
+ }
1138
+ handleCreateEvent(event) {
1139
+ this.processLinkService
1140
+ .getProcessLinkCandidates(event.modalParams.element.activityListenerType ?? '')
1141
+ .subscribe(candidates => {
1142
+ this.modalService.setModalData(event?.modalParams);
1143
+ this.processLinkStateService.setModalParams(event?.modalParams);
1144
+ this.processLinkStateService.setElementName(event?.modalParams?.element?.name ?? '');
1145
+ this.processLinkStateService.setAvailableProcessLinkTypes(candidates);
1146
+ this.processLinkStateService.showModal();
1147
+ });
1148
+ }
1149
+ subscribeToOpenProcessLinkModalEvents() {
1150
+ this._subscriptions.add(this.processManagementEditorService.openProcessLinkModalEvents$.subscribe(event => {
1151
+ if (event.processLink) {
1152
+ this.handleUpdateEvent(event);
1153
+ }
1154
+ else {
1155
+ this.handleCreateEvent(event);
1156
+ }
1157
+ }));
1158
+ }
1159
+ subscribeToProcessLinkUpdateEvents() {
1160
+ this._subscriptions.add(this.processLinkStateService.processLinkUpdateEvents$.subscribe(event => {
1161
+ this.processManagementEditorService.updateProcessLink(event);
1162
+ this.processLinkStateService.stopSaving();
1163
+ this.processLinkStateService.closeModal();
1164
+ }));
1165
+ }
1166
+ subscribeToProcessLinkCreateEvents() {
1167
+ this._subscriptions.add(this.processLinkStateService.processLinkCreateEvents$.subscribe(event => {
1168
+ this.processManagementEditorService.createProcessLink(event);
1169
+ this.processLinkStateService.stopSaving();
1170
+ this.processLinkStateService.closeModal();
1171
+ }));
1172
+ }
1173
+ subscribeToProcessLinkDeleteEvents() {
1174
+ this._subscriptions.add(this.processLinkStateService.processLinkDeleteEvents$.subscribe(event => {
1175
+ this.processManagementEditorService.deleteProcessLink(event);
1176
+ this.processLinkStateService.stopSaving();
1177
+ this.processLinkStateService.closeModal();
1178
+ }));
1179
+ }
1180
+ initIfCreate() {
1181
+ if (this._selectedProcess$.getValue() !== 'create')
1182
+ return;
1183
+ this.creatingNewProcess$.next(true);
1184
+ this._bpmnModeler?.importXML(EMPTY_BPMN);
1185
+ this.isReadOnlyProcess$.next(false);
1186
+ this.isSystemProcess$.next(false);
1187
+ this.loading$.next(false);
1188
+ }
1189
+ listenToActivityChangesOnModeler() {
1190
+ const eventBus = this._bpmnModeler.get('eventBus');
1191
+ if (!eventBus)
1192
+ return;
1193
+ eventBus.on('shape.added', this.shapeAddedHandler);
1194
+ eventBus.on('shape.removed', this.shapeRemovedHandler);
1195
+ eventBus.on('element.changed', this.elementChangedHandler);
1196
+ }
1197
+ cleanUpListenersOnModeler() {
1198
+ const eventBus = this._bpmnModeler.get('eventBus');
1199
+ if (!eventBus)
1200
+ return;
1201
+ eventBus.off('shape.added', this.shapeAddedHandler);
1202
+ eventBus.off('shape.removed', this.shapeRemovedHandler);
1203
+ eventBus.off('element.changed', this.elementChangedHandler);
1204
+ }
1205
+ initProcessDefinition() {
1206
+ this._subscriptions.add(this._selectedProcess$
1207
+ .pipe(filter(selectedProcess => selectedProcess !== null && selectedProcess !== 'create'), distinctUntilChanged((previous, current) => isEqual(previous, current)), tap(() => this.loading$.next(true)))
1208
+ .subscribe(result => {
1209
+ const processDefinitionResult = result;
1210
+ this.cleanUpListenersOnModeler();
1211
+ this._bpmnModeler?.importXML(processDefinitionResult.bpmn20Xml);
1212
+ this._bpmnViewer?.importXML(processDefinitionResult.bpmn20Xml);
1213
+ this.canInitializeDocument$.next(!!processDefinitionResult?.processCaseLink?.canInitializeDocument);
1214
+ this.startableByUser$.next(!!processDefinitionResult?.processCaseLink?.startableByUser);
1215
+ this.loading$.next(false);
1216
+ }));
1217
+ }
1218
+ openParamsAndContextSubscription() {
1219
+ this._subscriptions.add(getCaseManagementRouteParamsAndContext(this.route).subscribe(([context, params]) => {
1220
+ if (context)
1221
+ this.processManagementService.context = context;
1222
+ if (params) {
1223
+ this.processManagementService.setParams(params.caseDefinitionKey, params.caseDefinitionVersionTag);
1224
+ }
1225
+ this.initBreadcrumbs(params, context);
1226
+ this.processManagementEditorService.setCaseManagementRouteParams(context, params);
1227
+ }));
1228
+ }
1229
+ initBreadcrumbs(params, context) {
1230
+ if (context === 'independent')
1231
+ return;
1232
+ const route = `/case-management/case/${params.caseDefinitionKey}/version/${params.caseDefinitionVersionTag}`;
1233
+ this.breadcrumbService.setThirdBreadcrumb({
1234
+ route: [route],
1235
+ content: `${params.caseDefinitionKey} (${params.caseDefinitionVersionTag})`,
1236
+ href: route,
1237
+ });
1238
+ const routeWithForms = `${route}/processes`;
1239
+ this.breadcrumbService.setFourthBreadcrumb({
1240
+ route: [routeWithForms],
1241
+ content: this.translateService.instant('caseManagement.tabs.processes'),
1242
+ href: routeWithForms,
1243
+ });
1244
+ }
1245
+ initEditing() {
1246
+ combineLatest([this.editParam$, this.managementParams$.pipe(startWith(null)), this.context$])
1247
+ .pipe(take(1), switchMap(([editParam, params, context]) => {
1248
+ if (editParam === 'create') {
1249
+ this._selectedProcess$.next('create');
1250
+ this.initIfCreate();
1251
+ return of(null);
1252
+ }
1253
+ return context === 'case'
1254
+ ? this.processManagementService.getProcessDefinitionForCase(params.caseDefinitionKey, params.caseDefinitionVersionTag, editParam)
1255
+ : this.processManagementService
1256
+ .getUnlinkedProcessDefinitionsByKey(editParam)
1257
+ .pipe(map$1(processDefinitionResults => processDefinitionResults[0]));
1258
+ }), tap(res => {
1259
+ if (res) {
1260
+ this._selectedProcess$.next(res);
1261
+ this.processManagementEditorService.setSelectedProcessDefinition(res.processDefinition);
1262
+ this.processManagementEditorService.setProcessLinksForSelectedDefinition(res.processLinks);
1263
+ this.pageTitleService.setCustomPageTitle(res.processDefinition.name || '-');
1264
+ }
1265
+ this.initProcessDefinition();
1266
+ }))
1267
+ .subscribe();
1268
+ }
1269
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementBuilderComponent, deps: [{ token: i1$1.BreadcrumbService }, { token: i2$2.IconService }, { token: i3.NGXLogger }, { token: i1$1.ModalService }, { token: i2$1.GlobalNotificationService }, { token: i1$1.PageHeaderService }, { token: i1$1.PageTitleService }, { token: i5.ProcessLinkService }, { token: i5.ProcessLinkStateService }, { token: ProcessManagementEditorService }, { token: ProcessManagementService }, { token: i7.ProcessService }, { token: i8.ActivatedRoute }, { token: i8.Router }, { token: i4.TranslateService }, { token: i10.PluginTranslationService }, { token: i2$1.EditPermissionsService }], target: i0.ɵɵFactoryTarget.Component }); }
1270
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ProcessManagementBuilderComponent, isStandalone: true, selector: "valtimo-process-management-builder", providers: [
1271
+ ProcessManagementEditorService,
1272
+ ProcessLinkStateService,
1273
+ ProcessLinkStepService,
1274
+ ProcessLinkButtonService,
1275
+ ], viewQueries: [{ propertyName: "modelerElementRef", first: true, predicate: ["modeler"], descendants: true }, { propertyName: "modelerPanelElementRef", first: true, predicate: ["modelerPanel"], descendants: true }, { propertyName: "viewerElementRef", first: true, predicate: ["viewer"], descendants: true }, { propertyName: "viewerPanelElementRef", first: true, predicate: ["viewerPanel"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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<div\n fitPage\n [extraSpace]=\"extraSpace()\"\n [disableOverflow]=\"true\"\n *ngIf=\"{\n processDefinitionVersions: processDefinitionVersions$ | async,\n selectedProcessDefinitionXml: selectedProcessDefinitionXml$ | async,\n loading: loading$ | async,\n isReadOnlyProcess: isReadOnlyProcess$ | async,\n hasEditPermissions: hasEditPermissions$ | async,\n } as obs\"\n data-carbon-theme=\"g10\"\n class=\"bpmn__container\"\n>\n <div\n class=\"bpmn__modeler\"\n [style.display]=\"obs.isReadOnlyProcess || !obs.hasEditPermissions ? 'none' : 'flex'\"\n >\n <div class=\"bpmn__modeler-canvas\" #modeler></div>\n\n <div class=\"bpmn__modeler-panel\" #modelerPanel></div>\n </div>\n\n <div\n class=\"bpmn__modeler\"\n [style.display]=\"obs.isReadOnlyProcess || !obs.hasEditPermissions ? 'flex' : 'none'\"\n >\n <div class=\"bpmn__modeler-canvas\" #viewer></div>\n\n <div class=\"bpmn__modeler-panel\" #viewerPanel></div>\n </div>\n</div>\n\n<valtimo-process-link-modal></valtimo-process-link-modal>\n\n<ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <div\n class=\"page-header-actions\"\n *ngIf=\"{\n processDefinitionVersionsListItems: processDefinitionVersionsListItems$ | async,\n loading: loading$ | async,\n changesPending: changesPending$ | async,\n isReadOnlyProcess: isReadOnlyProcess$ | async,\n isSystemProcess: isSystemProcess$ | async,\n compactMode: compactMode$ | async,\n creatingNewProcess: creatingNewProcess$ | async,\n context: context$ | async,\n hasEditPermissions: hasEditPermissions$ | async,\n canInitializeDocument: canInitializeDocument$ | async,\n startableByUser: startableByUser$ | async,\n updatingProcessDefinitionCaseDefinition: updatingProcessDefinitionCaseDefinition$ | async,\n } as actionsObs\"\n >\n <div class=\"page-header-actions__left-container\">\n <cds-dropdown\n *ngIf=\"!actionsObs.creatingNewProcess && actionsObs?.context === 'independent'\"\n class=\"page-header-actions__version-dropdown\"\n (selected)=\"selectedVersionChange($event)\"\n [disabled]=\"\n actionsObs.loading ||\n (actionsObs.processDefinitionVersionsListItems || []).length === 0 ||\n (actionsObs.processDefinitionVersionsListItems || []).length === 1\n \"\n [size]=\"actionsObs.compactMode ? 'sm' : 'md'\"\n >\n <cds-dropdown-list\n [items]=\"actionsObs.processDefinitionVersionsListItems || []\"\n ></cds-dropdown-list>\n </cds-dropdown>\n\n <div class=\"page-header-actions__tags\">\n <cds-tag\n *ngIf=\"actionsObs.isReadOnlyProcess || !actionsObs.hasEditPermissions\"\n type=\"blue\"\n >{{ 'processManagement.readOnly' | translate }}</cds-tag\n >\n\n <cds-tag *ngIf=\"actionsObs.isSystemProcess\" type=\"red\">{{\n 'processManagement.systemProcess' | translate\n }}</cds-tag>\n </div>\n </div>\n\n <div class=\"page-header-actions__buttons\">\n @if (actionsObs.context === 'case') {\n <cds-tooltip\n [description]=\"'processCaseConnection.processCreatesCaseTooltip' | translate\"\n >\n <cds-toggle\n [onText]=\"'processManagement.canInitializeDocument' | translate\"\n [offText]=\"'processManagement.canInitializeDocument' | translate\"\n [checked]=\"actionsObs.canInitializeDocument\"\n [disabled]=\"\n actionsObs.loading ||\n actionsObs.updatingProcessDefinitionCaseDefinition ||\n !actionsObs.hasEditPermissions\n \"\n (checkedChange)=\"onProcessToggleChange('canInitializeDocument', $event)\"\n ></cds-toggle>\n </cds-tooltip>\n\n <cds-tooltip\n [description]=\"'processCaseConnection.startableWithinCaseTooltip' | translate\"\n >\n <cds-toggle\n [onText]=\"'processManagement.startableByUser' | translate\"\n [offText]=\"'processManagement.startableByUser' | translate\"\n [checked]=\"actionsObs.startableByUser\"\n [disabled]=\"\n actionsObs.loading ||\n actionsObs.updatingProcessDefinitionCaseDefinition ||\n !actionsObs.hasEditPermissions\n \"\n (checkedChange)=\"onProcessToggleChange('startableByUser', $event)\"\n ></cds-toggle\n ></cds-tooltip>\n }\n\n <button\n *ngIf=\"actionsObs.context === 'case'\"\n cdsButton=\"secondary\"\n [size]=\"actionsObs.compactMode ? 'sm' : 'md'\"\n (click)=\"navigateBack(null)\"\n >\n <svg class=\"cds--btn__icon\" cdsIcon=\"arrow--left\" size=\"16\"></svg>\n\n <span>{{ 'interface.back' | translate }}</span>\n </button>\n\n <button\n [disabled]=\"!actionsObs.changesPending\"\n cdsButton=\"primary\"\n (click)=\"\n !actionsObs.creatingNewProcess\n ? deployChanges(actionsObs.isReadOnlyProcess)\n : deployNewProcessDefinition()\n \"\n [size]=\"actionsObs.compactMode ? 'sm' : 'md'\"\n >\n {{ 'processManagement.deploy' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"deploy\" size=\"16\"></svg>\n </button>\n\n <cds-overflow-menu class=\"overflow-button\">\n <cds-overflow-menu-option\n [disabled]=\"actionsObs.loading\"\n (selected)=\"export(actionsObs.isReadOnlyProcess)\"\n >{{ 'interface.export' | translate }}\n </cds-overflow-menu-option>\n </cds-overflow-menu>\n </div>\n </div>\n </ng-template>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;gap:24px}.bpmn__container{position:relative;background-color:var(--cds-layer);width:100%}.bpmn__modeler{width:100%;height:100%;flex-direction:row;padding:1px;box-sizing:border-box;outline:1px solid var(--cds-border-subtle);outline-offset:-1px}.bpmn__modeler ::ng-deep .djs-container>svg{outline:none!important}.bpmn__modeler-canvas{width:100%}.bpmn__modeler-panel{width:481px;padding-left:1px;box-shadow:inset 1px 0 0 0 var(--cds-border-subtle);box-sizing:border-box}.bpmn__loading{width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:var(--cds-background-selected)}.page-header-actions{display:flex;width:100%;justify-content:space-between}.page-header-actions__left-container{display:flex;gap:24px;align-items:flex-end}.page-header-actions__tags{display:flex;gap:8px;align-items:flex-end}.page-header-actions__version-dropdown{width:150px}.page-header-actions__buttons{display:flex;gap:16px;align-items:center}.page-header-actions__buttons cds-toggle{height:24px}.page-header-actions__buttons ::ng-deep .cds--toggle__label-text{display:none}.valtimo-process-builder__header{display:flex;justify-content:space-between}.valtimo-process-builder__actions>*:not(:last-child){margin-right:8px}::ng-deep .process-link-properties-panel{padding:8px 12px 16px;width:100%;display:flex;flex-direction:column;gap:16px}::ng-deep .process-link-properties-panel__buttons,::ng-deep .process-link-properties-panel__header{width:100%;display:flex;gap:16px}::ng-deep .process-link-properties-panel__header{align-items:flex-start;justify-content:space-between;border-bottom:1px solid var(--cds-border-subtle-00);padding-bottom:8px;padding-left:8px;padding-right:8px}::ng-deep .process-link-properties-panel__title{color:var(--cds-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:200px;margin:auto 0}::ng-deep .process-link-properties-panel__title-container{display:flex;flex-direction:column;gap:4px}::ng-deep .process-link-properties-panel__title-container :last-child{color:var(--cds-text-helper);font-style:italic}::ng-deep .process-link-properties-panel .cds--tag{margin:0}::ng-deep .process-link-properties-panel .cds--btn{flex-shrink:1;width:100%;display:flex;align-items:center}\n/*!\n * Copyright 2015-2025 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"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "directive", type: FitPageDirective, selector: "[fitPage]", inputs: ["extraSpace", "disabled", "disableOverflow"] }, { kind: "ngmodule", type: LoadingModule }, { kind: "directive", type: RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i2$2.Dropdown, selector: "cds-dropdown, ibm-dropdown", inputs: ["id", "label", "hideLabel", "helperText", "placeholder", "displayValue", "clearText", "size", "type", "theme", "disabled", "readonly", "skeleton", "inline", "disableArrowKeys", "invalid", "invalidText", "warn", "warnText", "appendInline", "scrollableContainer", "itemValueKey", "selectionFeedback", "menuButtonLabel", "selectedLabel", "dropUp", "fluid"], outputs: ["selected", "onClose", "close"] }, { kind: "component", type: i2$2.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: SelectModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$2.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i2$2.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i2$2.Tag, selector: "cds-tag, ibm-tag", inputs: ["type", "size", "class", "skeleton"] }, { kind: "ngmodule", type: ProcessLinkModule }, { kind: "component", type: i5.ProcessLinkModalComponent, selector: "valtimo-process-link-modal" }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i2$2.OverflowMenu, selector: "cds-overflow-menu, ibm-overflow-menu", inputs: ["buttonLabel", "description", "flip", "placement", "open", "customTrigger", "offset", "wrapperClass", "triggerClass"], outputs: ["openChange"] }, { kind: "component", type: i2$2.OverflowMenuOption, selector: "cds-overflow-menu-option, ibm-overflow-menu-option", inputs: ["divider", "type", "disabled", "href", "target", "innerClass"], outputs: ["selected"] }, { kind: "ngmodule", type: ToggleModule }, { kind: "component", type: i2$2.Toggle, selector: "cds-toggle, ibm-toggle", inputs: ["offText", "onText", "label", "size", "hideLabel", "ariaLabel", "skeleton"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "component", type: i2$2.Tooltip, selector: "cds-tooltip, ibm-tooltip", inputs: ["id", "enterDelayMs", "leaveDelayMs", "disabled", "description", "templateContext"] }] }); }
1276
+ }
1277
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementBuilderComponent, decorators: [{
1278
+ type: Component,
1279
+ args: [{ selector: 'valtimo-process-management-builder', standalone: true, imports: [
1280
+ CommonModule,
1281
+ FitPageDirective,
1282
+ LoadingModule,
1283
+ RenderInPageHeaderDirective,
1284
+ DropdownModule,
1285
+ ReactiveFormsModule,
1286
+ SelectModule,
1287
+ ButtonModule,
1288
+ IconModule,
1289
+ TranslateModule,
1290
+ TagModule,
1291
+ ProcessLinkModule,
1292
+ ProcessLinkModule,
1293
+ DialogModule,
1294
+ ToggleModule,
1295
+ TooltipModule,
1296
+ ], providers: [
1297
+ ProcessManagementEditorService,
1298
+ ProcessLinkStateService,
1299
+ ProcessLinkStepService,
1300
+ ProcessLinkButtonService,
1301
+ ], template: "<!--\n ~ Copyright 2015-2025 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<div\n fitPage\n [extraSpace]=\"extraSpace()\"\n [disableOverflow]=\"true\"\n *ngIf=\"{\n processDefinitionVersions: processDefinitionVersions$ | async,\n selectedProcessDefinitionXml: selectedProcessDefinitionXml$ | async,\n loading: loading$ | async,\n isReadOnlyProcess: isReadOnlyProcess$ | async,\n hasEditPermissions: hasEditPermissions$ | async,\n } as obs\"\n data-carbon-theme=\"g10\"\n class=\"bpmn__container\"\n>\n <div\n class=\"bpmn__modeler\"\n [style.display]=\"obs.isReadOnlyProcess || !obs.hasEditPermissions ? 'none' : 'flex'\"\n >\n <div class=\"bpmn__modeler-canvas\" #modeler></div>\n\n <div class=\"bpmn__modeler-panel\" #modelerPanel></div>\n </div>\n\n <div\n class=\"bpmn__modeler\"\n [style.display]=\"obs.isReadOnlyProcess || !obs.hasEditPermissions ? 'flex' : 'none'\"\n >\n <div class=\"bpmn__modeler-canvas\" #viewer></div>\n\n <div class=\"bpmn__modeler-panel\" #viewerPanel></div>\n </div>\n</div>\n\n<valtimo-process-link-modal></valtimo-process-link-modal>\n\n<ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <div\n class=\"page-header-actions\"\n *ngIf=\"{\n processDefinitionVersionsListItems: processDefinitionVersionsListItems$ | async,\n loading: loading$ | async,\n changesPending: changesPending$ | async,\n isReadOnlyProcess: isReadOnlyProcess$ | async,\n isSystemProcess: isSystemProcess$ | async,\n compactMode: compactMode$ | async,\n creatingNewProcess: creatingNewProcess$ | async,\n context: context$ | async,\n hasEditPermissions: hasEditPermissions$ | async,\n canInitializeDocument: canInitializeDocument$ | async,\n startableByUser: startableByUser$ | async,\n updatingProcessDefinitionCaseDefinition: updatingProcessDefinitionCaseDefinition$ | async,\n } as actionsObs\"\n >\n <div class=\"page-header-actions__left-container\">\n <cds-dropdown\n *ngIf=\"!actionsObs.creatingNewProcess && actionsObs?.context === 'independent'\"\n class=\"page-header-actions__version-dropdown\"\n (selected)=\"selectedVersionChange($event)\"\n [disabled]=\"\n actionsObs.loading ||\n (actionsObs.processDefinitionVersionsListItems || []).length === 0 ||\n (actionsObs.processDefinitionVersionsListItems || []).length === 1\n \"\n [size]=\"actionsObs.compactMode ? 'sm' : 'md'\"\n >\n <cds-dropdown-list\n [items]=\"actionsObs.processDefinitionVersionsListItems || []\"\n ></cds-dropdown-list>\n </cds-dropdown>\n\n <div class=\"page-header-actions__tags\">\n <cds-tag\n *ngIf=\"actionsObs.isReadOnlyProcess || !actionsObs.hasEditPermissions\"\n type=\"blue\"\n >{{ 'processManagement.readOnly' | translate }}</cds-tag\n >\n\n <cds-tag *ngIf=\"actionsObs.isSystemProcess\" type=\"red\">{{\n 'processManagement.systemProcess' | translate\n }}</cds-tag>\n </div>\n </div>\n\n <div class=\"page-header-actions__buttons\">\n @if (actionsObs.context === 'case') {\n <cds-tooltip\n [description]=\"'processCaseConnection.processCreatesCaseTooltip' | translate\"\n >\n <cds-toggle\n [onText]=\"'processManagement.canInitializeDocument' | translate\"\n [offText]=\"'processManagement.canInitializeDocument' | translate\"\n [checked]=\"actionsObs.canInitializeDocument\"\n [disabled]=\"\n actionsObs.loading ||\n actionsObs.updatingProcessDefinitionCaseDefinition ||\n !actionsObs.hasEditPermissions\n \"\n (checkedChange)=\"onProcessToggleChange('canInitializeDocument', $event)\"\n ></cds-toggle>\n </cds-tooltip>\n\n <cds-tooltip\n [description]=\"'processCaseConnection.startableWithinCaseTooltip' | translate\"\n >\n <cds-toggle\n [onText]=\"'processManagement.startableByUser' | translate\"\n [offText]=\"'processManagement.startableByUser' | translate\"\n [checked]=\"actionsObs.startableByUser\"\n [disabled]=\"\n actionsObs.loading ||\n actionsObs.updatingProcessDefinitionCaseDefinition ||\n !actionsObs.hasEditPermissions\n \"\n (checkedChange)=\"onProcessToggleChange('startableByUser', $event)\"\n ></cds-toggle\n ></cds-tooltip>\n }\n\n <button\n *ngIf=\"actionsObs.context === 'case'\"\n cdsButton=\"secondary\"\n [size]=\"actionsObs.compactMode ? 'sm' : 'md'\"\n (click)=\"navigateBack(null)\"\n >\n <svg class=\"cds--btn__icon\" cdsIcon=\"arrow--left\" size=\"16\"></svg>\n\n <span>{{ 'interface.back' | translate }}</span>\n </button>\n\n <button\n [disabled]=\"!actionsObs.changesPending\"\n cdsButton=\"primary\"\n (click)=\"\n !actionsObs.creatingNewProcess\n ? deployChanges(actionsObs.isReadOnlyProcess)\n : deployNewProcessDefinition()\n \"\n [size]=\"actionsObs.compactMode ? 'sm' : 'md'\"\n >\n {{ 'processManagement.deploy' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"deploy\" size=\"16\"></svg>\n </button>\n\n <cds-overflow-menu class=\"overflow-button\">\n <cds-overflow-menu-option\n [disabled]=\"actionsObs.loading\"\n (selected)=\"export(actionsObs.isReadOnlyProcess)\"\n >{{ 'interface.export' | translate }}\n </cds-overflow-menu-option>\n </cds-overflow-menu>\n </div>\n </div>\n </ng-template>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;gap:24px}.bpmn__container{position:relative;background-color:var(--cds-layer);width:100%}.bpmn__modeler{width:100%;height:100%;flex-direction:row;padding:1px;box-sizing:border-box;outline:1px solid var(--cds-border-subtle);outline-offset:-1px}.bpmn__modeler ::ng-deep .djs-container>svg{outline:none!important}.bpmn__modeler-canvas{width:100%}.bpmn__modeler-panel{width:481px;padding-left:1px;box-shadow:inset 1px 0 0 0 var(--cds-border-subtle);box-sizing:border-box}.bpmn__loading{width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:var(--cds-background-selected)}.page-header-actions{display:flex;width:100%;justify-content:space-between}.page-header-actions__left-container{display:flex;gap:24px;align-items:flex-end}.page-header-actions__tags{display:flex;gap:8px;align-items:flex-end}.page-header-actions__version-dropdown{width:150px}.page-header-actions__buttons{display:flex;gap:16px;align-items:center}.page-header-actions__buttons cds-toggle{height:24px}.page-header-actions__buttons ::ng-deep .cds--toggle__label-text{display:none}.valtimo-process-builder__header{display:flex;justify-content:space-between}.valtimo-process-builder__actions>*:not(:last-child){margin-right:8px}::ng-deep .process-link-properties-panel{padding:8px 12px 16px;width:100%;display:flex;flex-direction:column;gap:16px}::ng-deep .process-link-properties-panel__buttons,::ng-deep .process-link-properties-panel__header{width:100%;display:flex;gap:16px}::ng-deep .process-link-properties-panel__header{align-items:flex-start;justify-content:space-between;border-bottom:1px solid var(--cds-border-subtle-00);padding-bottom:8px;padding-left:8px;padding-right:8px}::ng-deep .process-link-properties-panel__title{color:var(--cds-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:200px;margin:auto 0}::ng-deep .process-link-properties-panel__title-container{display:flex;flex-direction:column;gap:4px}::ng-deep .process-link-properties-panel__title-container :last-child{color:var(--cds-text-helper);font-style:italic}::ng-deep .process-link-properties-panel .cds--tag{margin:0}::ng-deep .process-link-properties-panel .cds--btn{flex-shrink:1;width:100%;display:flex;align-items:center}\n/*!\n * Copyright 2015-2025 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"] }]
1302
+ }], ctorParameters: () => [{ type: i1$1.BreadcrumbService }, { type: i2$2.IconService }, { type: i3.NGXLogger }, { type: i1$1.ModalService }, { type: i2$1.GlobalNotificationService }, { type: i1$1.PageHeaderService }, { type: i1$1.PageTitleService }, { type: i5.ProcessLinkService }, { type: i5.ProcessLinkStateService }, { type: ProcessManagementEditorService }, { type: ProcessManagementService }, { type: i7.ProcessService }, { type: i8.ActivatedRoute }, { type: i8.Router }, { type: i4.TranslateService }, { type: i10.PluginTranslationService }, { type: i2$1.EditPermissionsService }], propDecorators: { modelerElementRef: [{
1303
+ type: ViewChild,
1304
+ args: ['modeler', { static: false }]
1305
+ }], modelerPanelElementRef: [{
1306
+ type: ViewChild,
1307
+ args: ['modelerPanel', { static: false }]
1308
+ }], viewerElementRef: [{
1309
+ type: ViewChild,
1310
+ args: ['viewer', { static: false }]
1311
+ }], viewerPanelElementRef: [{
1312
+ type: ViewChild,
1313
+ args: ['viewerPanel', { static: false }]
1314
+ }] } });
1315
+
1316
+ /*
1317
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1318
+ *
1319
+ * Licensed under EUPL, Version 1.2 (the "License");
1320
+ * you may not use this file except in compliance with the License.
1321
+ * You may obtain a copy of the License at
1322
+ *
1323
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1324
+ *
1325
+ * Unless required by applicable law or agreed to in writing, software
1326
+ * distributed under the License is distributed on an "AS IS" basis,
1327
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1328
+ * See the License for the specific language governing permissions and
1329
+ * limitations under the License.
1330
+ */
1331
+ class ProcessManagementListComponent {
1332
+ constructor(iconService, notificationService, processManagementService, processManagementStateService, translateService, environmentService, route, editPermissionsService) {
1333
+ this.iconService = iconService;
1334
+ this.notificationService = notificationService;
1335
+ this.processManagementService = processManagementService;
1336
+ this.processManagementStateService = processManagementStateService;
1337
+ this.translateService = translateService;
1338
+ this.environmentService = environmentService;
1339
+ this.route = route;
1340
+ this.editPermissionsService = editPermissionsService;
1341
+ this.processSelected = new EventEmitter();
1342
+ this.context = this.processManagementService.context;
1343
+ this.processToDelete$ = new BehaviorSubject(null);
1344
+ this.showDeleteModal$ = new BehaviorSubject(false);
1345
+ this.loading$ = new BehaviorSubject(true);
1346
+ this.ACTION_ITEMS = [
1347
+ { label: 'Delete', callback: this.onDeleteProcess.bind(this), type: 'danger' },
1348
+ ];
1349
+ this.context$ = getContextObservable(this.route);
1350
+ this.processDefinitions$ = this.processManagementStateService.reloadDefinitions$.pipe(tap(() => this.loading$.next(true)), switchMap(() => this.processManagementService.processes$), tap(() => this.loading$.next(false)));
1351
+ this.hasEditPermissions$ = combineLatest([
1352
+ getCaseManagementRouteParams(this.route),
1353
+ this.context$,
1354
+ ]).pipe(switchMap(([params, context]) => {
1355
+ return this.editPermissionsService.hasPermissionsToEditBasedOnContext(params?.caseDefinitionKey, params?.caseDefinitionVersionTag, context);
1356
+ }));
1357
+ this.FIELDS = [
1358
+ { key: 'processDefinition.name', label: 'processManagement.name' },
1359
+ { key: 'processDefinition.key', label: 'processManagement.key' },
1360
+ {
1361
+ key: 'processDefinition.readOnly',
1362
+ label: 'processManagement.readOnly',
1363
+ viewType: ViewType.BOOLEAN,
1364
+ },
1365
+ ...(this.processManagementService.context() === 'case'
1366
+ ? [
1367
+ {
1368
+ key: 'processCaseLink.canInitializeDocument',
1369
+ label: 'processManagement.canInitializeDocument',
1370
+ viewType: ViewType.BOOLEAN,
1371
+ },
1372
+ ]
1373
+ : []),
1374
+ ...(this.processManagementService.context() === 'case'
1375
+ ? [
1376
+ {
1377
+ key: 'processCaseLink.startableByUser',
1378
+ label: 'processManagement.startableByUser',
1379
+ viewType: ViewType.BOOLEAN,
1380
+ },
1381
+ ]
1382
+ : []),
1383
+ ];
1384
+ this.iconService.registerAll([Upload16]);
1385
+ }
1386
+ editProcessDefinition(processDefinition) {
1387
+ this.processSelected.emit(processDefinition);
1388
+ }
1389
+ openModal() {
1390
+ this.processManagementStateService.openModal();
1391
+ }
1392
+ onCreateProcess() {
1393
+ this.processSelected.emit('create');
1394
+ }
1395
+ onDeleteConfirm(processDefinition) {
1396
+ (this.context() === 'case'
1397
+ ? this.processManagementService.deleteProcess(processDefinition.key)
1398
+ : this.processManagementService.deleteUnlinkedProcess(processDefinition.key)).subscribe(() => {
1399
+ this.processManagementStateService.reloadDefinitions();
1400
+ this.notificationService.showToast({
1401
+ title: this.translateService.instant(`interface.delete`),
1402
+ caption: this.translateService.instant(`processManagement.deleteNotification`),
1403
+ type: 'success',
1404
+ });
1405
+ });
1406
+ }
1407
+ onDeleteProcess(process) {
1408
+ this.processToDelete$.next(process.processDefinition);
1409
+ this.showDeleteModal$.next(true);
1410
+ }
1411
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementListComponent, deps: [{ token: i2$2.IconService }, { token: i2$1.GlobalNotificationService }, { token: ProcessManagementService }, { token: ProcessManagementStateService }, { token: i4.TranslateService }, { token: i2$1.EnvironmentService }, { token: i8.ActivatedRoute }, { token: i2$1.EditPermissionsService }], target: i0.ɵɵFactoryTarget.Component }); }
1412
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ProcessManagementListComponent, isStandalone: true, selector: "valtimo-process-management-list", outputs: { processSelected: "processSelected" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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<valtimo-carbon-list\n [actionItems]=\"ACTION_ITEMS\"\n [showActionItems]=\"hasEditPermissions$ | async\"\n [fields]=\"FIELDS\"\n [header]=\"false\"\n [items]=\"processDefinitions$ | async\"\n [loading]=\"loading$ | async\"\n (rowClicked)=\"editProcessDefinition($event)\"\n>\n <ng-container carbonToolbarContent>\n <button\n *ngIf=\"hasEditPermissions$ | async\"\n cdsButton=\"ghost\"\n iconOnly=\"true\"\n (click)=\"openModal()\"\n >\n <svg cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n\n <ng-container [ngTemplateOutlet]=\"createProcess\"></ng-container>\n </ng-container>\n\n <valtimo-no-results\n [action]=\"createProcess\"\n [title]=\"'processManagement.noResults.title' | translate\"\n [description]=\"'processManagement.noResults.' + context() + 'Description' | translate\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"processManagement.deleteModal.content\"\n [outputOnConfirm]=\"processToDelete$ | async\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"processManagement.deleteModal.title\"\n (confirmEvent)=\"onDeleteConfirm($event)\"\n></valtimo-confirmation-modal>\n\n<ng-template #createProcess>\n <button *ngIf=\"hasEditPermissions$ | async\" cdsButton=\"primary\" (click)=\"onCreateProcess()\">\n {{ 'processManagement.createProcess' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2025 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"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$2.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1$1.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i1$1.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i2$2.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i1$1.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1413
+ }
1414
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementListComponent, decorators: [{
1415
+ type: Component,
1416
+ args: [{ selector: 'valtimo-process-management-list', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1417
+ CommonModule,
1418
+ ButtonModule,
1419
+ CarbonListModule,
1420
+ IconModule,
1421
+ IconModule,
1422
+ TranslateModule,
1423
+ ConfirmationModalModule,
1424
+ ], template: "<!--\n ~ Copyright 2015-2025 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<valtimo-carbon-list\n [actionItems]=\"ACTION_ITEMS\"\n [showActionItems]=\"hasEditPermissions$ | async\"\n [fields]=\"FIELDS\"\n [header]=\"false\"\n [items]=\"processDefinitions$ | async\"\n [loading]=\"loading$ | async\"\n (rowClicked)=\"editProcessDefinition($event)\"\n>\n <ng-container carbonToolbarContent>\n <button\n *ngIf=\"hasEditPermissions$ | async\"\n cdsButton=\"ghost\"\n iconOnly=\"true\"\n (click)=\"openModal()\"\n >\n <svg cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n\n <ng-container [ngTemplateOutlet]=\"createProcess\"></ng-container>\n </ng-container>\n\n <valtimo-no-results\n [action]=\"createProcess\"\n [title]=\"'processManagement.noResults.title' | translate\"\n [description]=\"'processManagement.noResults.' + context() + 'Description' | translate\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"processManagement.deleteModal.content\"\n [outputOnConfirm]=\"processToDelete$ | async\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"processManagement.deleteModal.title\"\n (confirmEvent)=\"onDeleteConfirm($event)\"\n></valtimo-confirmation-modal>\n\n<ng-template #createProcess>\n <button *ngIf=\"hasEditPermissions$ | async\" cdsButton=\"primary\" (click)=\"onCreateProcess()\">\n {{ 'processManagement.createProcess' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2025 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"] }]
1425
+ }], ctorParameters: () => [{ type: i2$2.IconService }, { type: i2$1.GlobalNotificationService }, { type: ProcessManagementService }, { type: ProcessManagementStateService }, { type: i4.TranslateService }, { type: i2$1.EnvironmentService }, { type: i8.ActivatedRoute }, { type: i2$1.EditPermissionsService }], propDecorators: { processSelected: [{
1426
+ type: Output
1427
+ }] } });
1428
+
1429
+ /*
1430
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1431
+ *
1432
+ * Licensed under EUPL, Version 1.2 (the "License");
1433
+ * you may not use this file except in compliance with the License.
1434
+ * You may obtain a copy of the License at
1435
+ *
1436
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1437
+ *
1438
+ * Unless required by applicable law or agreed to in writing, software
1439
+ * distributed under the License is distributed on an "AS IS" basis,
1440
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1441
+ * See the License for the specific language governing permissions and
1442
+ * limitations under the License.
1443
+ */
1444
+ class ProcessManagementUploadComponent {
1445
+ constructor(formBuilder, notificationService, processManagementService, processManagementStateService, translateService) {
1446
+ this.formBuilder = formBuilder;
1447
+ this.notificationService = notificationService;
1448
+ this.processManagementService = processManagementService;
1449
+ this.processManagementStateService = processManagementStateService;
1450
+ this.translateService = translateService;
1451
+ this.modalOpen$ = this.processManagementStateService.openModal$;
1452
+ this.ACCEPTED_FILES = ['bpmn'];
1453
+ this.form = this.formBuilder.group({
1454
+ file: this.formBuilder.control(new Set(), [Validators.required]),
1455
+ });
1456
+ this.fileSelected$ = this.form.get('file')?.valueChanges.pipe(startWith(null), map$1(value => !!(value instanceof Set && value.size > 0)));
1457
+ }
1458
+ closeModal() {
1459
+ this.processManagementStateService.closeModal();
1460
+ setTimeout(() => {
1461
+ this.form.reset();
1462
+ }, CARBON_CONSTANTS.modalAnimationMs);
1463
+ }
1464
+ uploadProcessBpmn() {
1465
+ const bpmnFile = this.form.value?.file?.values()?.next()?.value?.file;
1466
+ if (!bpmnFile)
1467
+ return;
1468
+ this.processManagementService.deployBpmn(bpmnFile).subscribe({
1469
+ next: () => {
1470
+ this.notificationService.showNotification({
1471
+ type: 'success',
1472
+ title: this.translateService.instant('processManagement.upload.success'),
1473
+ });
1474
+ this.closeModal();
1475
+ this.processManagementStateService.reloadDefinitions();
1476
+ },
1477
+ error: () => {
1478
+ this.notificationService.showNotification({
1479
+ type: 'error',
1480
+ title: this.translateService.instant('processManagement.upload.failure'),
1481
+ });
1482
+ },
1483
+ });
1484
+ }
1485
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementUploadComponent, deps: [{ token: i1$2.FormBuilder }, { token: i2$1.GlobalNotificationService }, { token: ProcessManagementService }, { token: ProcessManagementStateService }, { token: i4.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
1486
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ProcessManagementUploadComponent, isStandalone: true, selector: "valtimo-process-management-upload", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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<cds-modal valtimoCdsModal [open]=\"modalOpen$ | async\" size=\"sm\" (close)=\"closeModal()\">\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'processManagement.upload.modalTitle' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"ACCEPTED_FILES\"\n [buttonText]=\"'processManagement.upload.buttonText' | translate\"\n [description]=\"'processManagement.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'processManagement.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n >\n </cds-file-uploader>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"(fileSelected$ | async) === false\"\n (click)=\"uploadProcessBpmn()\"\n >\n {{ 'interface.upload' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["/*!\n * Copyright 2015-2025 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"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: FileUploaderModule }, { kind: "component", type: i2$2.FileUploader, selector: "cds-file-uploader, ibm-file-uploader", inputs: ["buttonText", "buttonType", "title", "description", "accept", "multiple", "skeleton", "size", "fileItemSize", "drop", "dropText", "fileUploaderId", "files", "disabled"], outputs: ["filesChange"] }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i2$2.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i2$2.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i2$2.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i2$2.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i2$2.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i2$2.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$2.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1487
+ }
1488
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementUploadComponent, decorators: [{
1489
+ type: Component,
1490
+ args: [{ selector: 'valtimo-process-management-upload', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1491
+ CommonModule,
1492
+ TranslateModule,
1493
+ FileUploaderModule,
1494
+ ModalModule,
1495
+ LayerModule,
1496
+ ReactiveFormsModule,
1497
+ ButtonModule,
1498
+ ], template: "<!--\n ~ Copyright 2015-2025 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<cds-modal valtimoCdsModal [open]=\"modalOpen$ | async\" size=\"sm\" (close)=\"closeModal()\">\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'processManagement.upload.modalTitle' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"ACCEPTED_FILES\"\n [buttonText]=\"'processManagement.upload.buttonText' | translate\"\n [description]=\"'processManagement.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'processManagement.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n >\n </cds-file-uploader>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"(fileSelected$ | async) === false\"\n (click)=\"uploadProcessBpmn()\"\n >\n {{ 'interface.upload' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["/*!\n * Copyright 2015-2025 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"] }]
1499
+ }], ctorParameters: () => [{ type: i1$2.FormBuilder }, { type: i2$1.GlobalNotificationService }, { type: ProcessManagementService }, { type: ProcessManagementStateService }, { type: i4.TranslateService }] });
1500
+
1501
+ /*
1502
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1503
+ *
1504
+ * Licensed under EUPL, Version 1.2 (the "License");
1505
+ * you may not use this file except in compliance with the License.
1506
+ * You may obtain a copy of the License at
1507
+ *
1508
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1509
+ *
1510
+ * Unless required by applicable law or agreed to in writing, software
1511
+ * distributed under the License is distributed on an "AS IS" basis,
1512
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1513
+ * See the License for the specific language governing permissions and
1514
+ * limitations under the License.
1515
+ */
1516
+ class ProcessManagementComponent {
1517
+ constructor(processManagementService, route, router) {
1518
+ this.processManagementService = processManagementService;
1519
+ this.route = route;
1520
+ this.router = router;
1521
+ this.context$ = getContextObservable(this.route);
1522
+ this.params$ = this.context$.pipe(filter$1(context => context === 'case'), switchMap(() => getCaseManagementRouteParams(this.route)), distinctUntilChanged((previous, current) => isEqual(previous, current)));
1523
+ this.paramsAreSet$ = new BehaviorSubject(false);
1524
+ this._subscriptions = new Subscription();
1525
+ }
1526
+ ngOnInit() {
1527
+ this.openParamsAndContextSubscription();
1528
+ }
333
1529
  ngOnDestroy() {
334
- this.bpmnModeler.destroy();
335
- this.bpmnViewer.destroy();
1530
+ this._subscriptions.unsubscribe();
1531
+ }
1532
+ onProcessSelected(selectedProcessEvent) {
1533
+ const editParam = selectedProcessEvent === 'create' ? 'create' : selectedProcessEvent?.processDefinition?.key;
1534
+ this.router.navigate([editParam], {
1535
+ relativeTo: this.route,
1536
+ });
336
1537
  }
337
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementBuilderComponent, deps: [{ token: i2.HttpClient }, { token: i1.ProcessService }, { token: i3.LayoutService }, { token: i4.AlertService }, { token: i5.ActivatedRoute }, { token: i5.Router }, { token: i4.PageTitleService }], target: i0.ɵɵFactoryTarget.Component }); }
338
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ProcessManagementBuilderComponent, selector: "valtimo-process-management-builder", ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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<div class=\"mb-5\" [ngClass]=\"{'main-content pt-0': !layoutService.isFullscreen}\">\n <div [ngClass]=\"{'container-fluid': !layoutService.isFullscreen}\">\n <div class=\"text-right\">\n <div\n class=\"btn-group mt-m3px mb-3\"\n *ngIf=\"(selectedVersion !== null || processKey === null) && !layoutService.isFullscreen\"\n >\n <button class=\"btn btn-primary btn-space\" (click)=\"download()\">\n <i class=\"icon mdi mdi-download mr-1\"></i>{{ 'processManagement.download' | translate }}\n </button>\n <button\n class=\"btn btn-success btn-space\"\n (click)=\"deploy()\"\n *ngIf=\"(isReadOnlyProcess$ | async) === false\"\n [ngClass]=\"{'mr-0': selectedVersion !== null}\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>{{ 'processManagement.deploy' | translate }}\n </button>\n <button\n *ngIf=\"selectedVersion === null\"\n class=\"btn btn-danger btn-space mr-0\"\n (click)=\"reset()\"\n >\n <i class=\"icon mdi mdi-delete mr-1\"></i>{{ 'processManagement.clear' | translate }}\n </button>\n </div>\n </div>\n\n <div class=\"modeler pl-3 pr-3 mb-3\" [ngClass]=\"{'mt-4': !layoutService.isFullscreen}\">\n <div\n class=\"row pt-4 pb-3 bg-light versions\"\n *ngIf=\"processDefinitionVersions\"\n [ngClass]=\"{'border-bottom-0': selectedVersion !== null}\"\n >\n <div class=\"col-md-4\" *ngIf=\"processDefinitionVersions.length > 0\">\n <span class=\"badge badge-pill badge-info mr-1\" *ngIf=\"isReadOnlyProcess$ | async\">\n {{ 'processManagement.readOnly' | translate }}\n </span>\n <span class=\"badge badge-pill badge-warning mr-1\" *ngIf=\"isSystemProcess$ | async\">\n {{ 'processManagement.systemProcess' | translate }}\n </span>\n </div>\n <div class=\"col-md-2 offset-md-2\">\n <label for=\"processVersion\"><strong>Version</strong></label>\n <select\n id=\"processVersion\"\n class=\"form-control select-version-control\"\n [(ngModel)]=\"selectedVersion\"\n (change)=\"loadProcessBpmn()\"\n [compareWith]=\"compareProcessDefinitions\"\n >\n <option [ngValue]=\"null\" disabled selected>Version</option>\n <option\n *ngFor=\"let processDefinition of processDefinitionVersions\"\n [ngValue]=\"processDefinition\"\n >\n {{ processDefinition.version }}\n </option>\n </select>\n </div>\n <div\n class=\"col-md-auto d-flex align-items-end text-right\"\n *ngIf=\"(selectedVersion !== null || processKey === null) && layoutService.isFullscreen\"\n >\n <div class=\"btn-group\">\n <button class=\"btn btn-primary btn-space\" (click)=\"download()\">\n <i class=\"icon mdi mdi-download mr-1\"></i\n >{{ 'processManagement.download' | translate }}\n </button>\n <button\n class=\"btn btn-success btn-space\"\n (click)=\"deploy()\"\n *ngIf=\"(isReadOnlyProcess$ | async) === false\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>{{ 'processManagement.deploy' | translate }}\n </button>\n <button *ngIf=\"!selectedVersion\" class=\"btn btn-danger btn-space\" (click)=\"reset()\">\n <i class=\"icon mdi mdi-delete mr-1\"></i>{{ 'processManagement.clear' | translate }}\n </button>\n </div>\n </div>\n <div\n *ngIf=\"selectedVersion\"\n class=\"col-md-1 fullscreen-toggle text-right\"\n [ngClass]=\"{'offset-md-2': !layoutService.isFullscreen}\"\n >\n <i\n class=\"fas\"\n [ngClass]=\"{\n 'fa-expand-arrows-alt': !layoutService.isFullscreen,\n 'fa-compress-arrows-alt': layoutService.isFullscreen,\n }\"\n (click)=\"layoutService.toggleFullscreen()\"\n ></i>\n </div>\n </div>\n <div\n *ngIf=\"(isSystemProcess$ | async) && (isReadOnlyProcess$ | async)\"\n class=\"row bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'processManagement.readOnlySystemProcessWarningMessage'\"\n ></div>\n <div\n *ngIf=\"(isSystemProcess$ | async) && (isReadOnlyProcess$ | async) === false\"\n class=\"row bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'processManagement.systemProcessWarningMessage'\"\n ></div>\n <div [hidden]=\"!selectedVersion && processKey\" class=\"row bg-white diagram mb-3\">\n <div id=\"canvas\" class=\"col-9\" [hidden]=\"isReadOnlyProcess$ | async\"></div>\n <div id=\"properties\" class=\"col-3 pr-0\" [hidden]=\"isReadOnlyProcess$ | async\"></div>\n <div\n id=\"readOnlyCanvas\"\n class=\"col-12\"\n [hidden]=\"(isReadOnlyProcess$ | async) === false\"\n ></div>\n </div>\n </div>\n </div>\n</div>\n", styles: [".versions,.diagram{border:1px solid #dee2e6}.process-title{color:#6b6b6b;font-size:1.5rem}.fullscreen-toggle{font-size:2rem}.fullscreen-toggle>i{cursor:pointer}.modeler{height:90vh}.select-version-control{width:90px}#properties{border-left:1px solid #dee2e6;padding-left:0}#readOnlyCanvas{height:90vh}\n/*!\n * Copyright 2015-2024 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"], dependencies: [{ kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i7.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i7.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4$1.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
1538
+ openParamsAndContextSubscription() {
1539
+ this._subscriptions.add(combineLatest([this.context$, this.params$.pipe(startWith(null))]).subscribe(([context, params]) => {
1540
+ if (context)
1541
+ this.processManagementService.context = context;
1542
+ if (params) {
1543
+ this.processManagementService.setParams(params.caseDefinitionKey, params.caseDefinitionVersionTag);
1544
+ }
1545
+ this.paramsAreSet$.next(true);
1546
+ }));
1547
+ }
1548
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementComponent, deps: [{ token: ProcessManagementService }, { token: i8.ActivatedRoute }, { token: i8.Router }], target: i0.ɵɵFactoryTarget.Component }); }
1549
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ProcessManagementComponent, isStandalone: true, selector: "valtimo-process-management", providers: [TranslateService], ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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<ng-container\n *ngIf=\"{\n paramsAreSet: paramsAreSet$ | async,\n } as obs\"\n>\n @if (obs.paramsAreSet) {\n <valtimo-process-management-list\n (processSelected)=\"onProcessSelected($event)\"\n ></valtimo-process-management-list>\n\n <valtimo-process-management-upload></valtimo-process-management-upload>\n } @else {\n <cds-loading></cds-loading>\n }\n</ng-container>\n", styles: ["/*!\n * Copyright 2015-2025 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"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "component", type: ProcessManagementListComponent, selector: "valtimo-process-management-list", outputs: ["processSelected"] }, { kind: "component", type: ProcessManagementUploadComponent, selector: "valtimo-process-management-upload" }, { kind: "ngmodule", type: LoadingModule }, { kind: "component", type: i2$2.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "ngmodule", type: NotificationModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
339
1550
  }
340
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementBuilderComponent, decorators: [{
1551
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementComponent, decorators: [{
341
1552
  type: Component,
342
- args: [{ selector: 'valtimo-process-management-builder', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2024 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<div class=\"mb-5\" [ngClass]=\"{'main-content pt-0': !layoutService.isFullscreen}\">\n <div [ngClass]=\"{'container-fluid': !layoutService.isFullscreen}\">\n <div class=\"text-right\">\n <div\n class=\"btn-group mt-m3px mb-3\"\n *ngIf=\"(selectedVersion !== null || processKey === null) && !layoutService.isFullscreen\"\n >\n <button class=\"btn btn-primary btn-space\" (click)=\"download()\">\n <i class=\"icon mdi mdi-download mr-1\"></i>{{ 'processManagement.download' | translate }}\n </button>\n <button\n class=\"btn btn-success btn-space\"\n (click)=\"deploy()\"\n *ngIf=\"(isReadOnlyProcess$ | async) === false\"\n [ngClass]=\"{'mr-0': selectedVersion !== null}\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>{{ 'processManagement.deploy' | translate }}\n </button>\n <button\n *ngIf=\"selectedVersion === null\"\n class=\"btn btn-danger btn-space mr-0\"\n (click)=\"reset()\"\n >\n <i class=\"icon mdi mdi-delete mr-1\"></i>{{ 'processManagement.clear' | translate }}\n </button>\n </div>\n </div>\n\n <div class=\"modeler pl-3 pr-3 mb-3\" [ngClass]=\"{'mt-4': !layoutService.isFullscreen}\">\n <div\n class=\"row pt-4 pb-3 bg-light versions\"\n *ngIf=\"processDefinitionVersions\"\n [ngClass]=\"{'border-bottom-0': selectedVersion !== null}\"\n >\n <div class=\"col-md-4\" *ngIf=\"processDefinitionVersions.length > 0\">\n <span class=\"badge badge-pill badge-info mr-1\" *ngIf=\"isReadOnlyProcess$ | async\">\n {{ 'processManagement.readOnly' | translate }}\n </span>\n <span class=\"badge badge-pill badge-warning mr-1\" *ngIf=\"isSystemProcess$ | async\">\n {{ 'processManagement.systemProcess' | translate }}\n </span>\n </div>\n <div class=\"col-md-2 offset-md-2\">\n <label for=\"processVersion\"><strong>Version</strong></label>\n <select\n id=\"processVersion\"\n class=\"form-control select-version-control\"\n [(ngModel)]=\"selectedVersion\"\n (change)=\"loadProcessBpmn()\"\n [compareWith]=\"compareProcessDefinitions\"\n >\n <option [ngValue]=\"null\" disabled selected>Version</option>\n <option\n *ngFor=\"let processDefinition of processDefinitionVersions\"\n [ngValue]=\"processDefinition\"\n >\n {{ processDefinition.version }}\n </option>\n </select>\n </div>\n <div\n class=\"col-md-auto d-flex align-items-end text-right\"\n *ngIf=\"(selectedVersion !== null || processKey === null) && layoutService.isFullscreen\"\n >\n <div class=\"btn-group\">\n <button class=\"btn btn-primary btn-space\" (click)=\"download()\">\n <i class=\"icon mdi mdi-download mr-1\"></i\n >{{ 'processManagement.download' | translate }}\n </button>\n <button\n class=\"btn btn-success btn-space\"\n (click)=\"deploy()\"\n *ngIf=\"(isReadOnlyProcess$ | async) === false\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>{{ 'processManagement.deploy' | translate }}\n </button>\n <button *ngIf=\"!selectedVersion\" class=\"btn btn-danger btn-space\" (click)=\"reset()\">\n <i class=\"icon mdi mdi-delete mr-1\"></i>{{ 'processManagement.clear' | translate }}\n </button>\n </div>\n </div>\n <div\n *ngIf=\"selectedVersion\"\n class=\"col-md-1 fullscreen-toggle text-right\"\n [ngClass]=\"{'offset-md-2': !layoutService.isFullscreen}\"\n >\n <i\n class=\"fas\"\n [ngClass]=\"{\n 'fa-expand-arrows-alt': !layoutService.isFullscreen,\n 'fa-compress-arrows-alt': layoutService.isFullscreen,\n }\"\n (click)=\"layoutService.toggleFullscreen()\"\n ></i>\n </div>\n </div>\n <div\n *ngIf=\"(isSystemProcess$ | async) && (isReadOnlyProcess$ | async)\"\n class=\"row bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'processManagement.readOnlySystemProcessWarningMessage'\"\n ></div>\n <div\n *ngIf=\"(isSystemProcess$ | async) && (isReadOnlyProcess$ | async) === false\"\n class=\"row bg-warning text-black mb-0 p-3 text-center\"\n [translate]=\"'processManagement.systemProcessWarningMessage'\"\n ></div>\n <div [hidden]=\"!selectedVersion && processKey\" class=\"row bg-white diagram mb-3\">\n <div id=\"canvas\" class=\"col-9\" [hidden]=\"isReadOnlyProcess$ | async\"></div>\n <div id=\"properties\" class=\"col-3 pr-0\" [hidden]=\"isReadOnlyProcess$ | async\"></div>\n <div\n id=\"readOnlyCanvas\"\n class=\"col-12\"\n [hidden]=\"(isReadOnlyProcess$ | async) === false\"\n ></div>\n </div>\n </div>\n </div>\n</div>\n", styles: [".versions,.diagram{border:1px solid #dee2e6}.process-title{color:#6b6b6b;font-size:1.5rem}.fullscreen-toggle{font-size:2rem}.fullscreen-toggle>i{cursor:pointer}.modeler{height:90vh}.select-version-control{width:90px}#properties{border-left:1px solid #dee2e6;padding-left:0}#readOnlyCanvas{height:90vh}\n/*!\n * Copyright 2015-2024 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"] }]
343
- }], ctorParameters: () => [{ type: i2.HttpClient }, { type: i1.ProcessService }, { type: i3.LayoutService }, { type: i4.AlertService }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: i4.PageTitleService }] });
1553
+ args: [{ selector: 'valtimo-process-management', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1554
+ CommonModule,
1555
+ ProcessManagementListComponent,
1556
+ ProcessManagementUploadComponent,
1557
+ ProcessManagementBuilderComponent,
1558
+ LoadingModule,
1559
+ NotificationModule,
1560
+ ], providers: [TranslateService], template: "<!--\n ~ Copyright 2015-2025 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<ng-container\n *ngIf=\"{\n paramsAreSet: paramsAreSet$ | async,\n } as obs\"\n>\n @if (obs.paramsAreSet) {\n <valtimo-process-management-list\n (processSelected)=\"onProcessSelected($event)\"\n ></valtimo-process-management-list>\n\n <valtimo-process-management-upload></valtimo-process-management-upload>\n } @else {\n <cds-loading></cds-loading>\n }\n</ng-container>\n", styles: ["/*!\n * Copyright 2015-2025 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"] }]
1561
+ }], ctorParameters: () => [{ type: ProcessManagementService }, { type: i8.ActivatedRoute }, { type: i8.Router }] });
1562
+
1563
+ /*
1564
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1565
+ *
1566
+ * Licensed under EUPL, Version 1.2 (the "License");
1567
+ * you may not use this file except in compliance with the License.
1568
+ * You may obtain a copy of the License at
1569
+ *
1570
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1571
+ *
1572
+ * Unless required by applicable law or agreed to in writing, software
1573
+ * distributed under the License is distributed on an "AS IS" basis,
1574
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1575
+ * See the License for the specific language governing permissions and
1576
+ * limitations under the License.
1577
+ */
344
1578
 
345
1579
  /*
346
- * Copyright 2015-2024 Ritense BV, the Netherlands.
1580
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
347
1581
  *
348
1582
  * Licensed under EUPL, Version 1.2 (the "License");
349
1583
  * you may not use this file except in compliance with the License.
@@ -362,27 +1596,42 @@ const routes = [
362
1596
  path: 'processes',
363
1597
  component: ProcessManagementComponent,
364
1598
  canActivate: [AuthGuardService],
365
- data: { title: 'Processes', roles: [ROLE_ADMIN] },
1599
+ data: {
1600
+ title: 'Processes',
1601
+ roles: [ROLE_ADMIN],
1602
+ context: 'independent',
1603
+ },
366
1604
  },
367
1605
  {
368
1606
  path: 'processes/create',
369
1607
  component: ProcessManagementBuilderComponent,
370
1608
  canActivate: [AuthGuardService],
371
- data: { title: 'Create new Process', roles: [ROLE_ADMIN] },
1609
+ canDeactivate: [pendingChangesGuard],
1610
+ data: {
1611
+ title: 'Create new Process',
1612
+ roles: [ROLE_ADMIN],
1613
+ context: 'independent',
1614
+ },
372
1615
  },
373
1616
  {
374
- path: 'processes/process/:key',
1617
+ path: 'processes/:processDefinitionKey',
375
1618
  component: ProcessManagementBuilderComponent,
376
1619
  canActivate: [AuthGuardService],
377
- data: { title: 'Process details', roles: [ROLE_ADMIN], customPageTitle: true },
1620
+ canDeactivate: [pendingChangesGuard],
1621
+ data: {
1622
+ title: 'Process details',
1623
+ roles: [ROLE_ADMIN],
1624
+ customPageTitle: true,
1625
+ context: 'independent',
1626
+ },
378
1627
  },
379
1628
  ];
380
1629
  class ProcessManagementRoutingModule {
381
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
382
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementRoutingModule, imports: [CommonModule, i5.RouterModule], exports: [RouterModule] }); }
383
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
1630
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1631
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementRoutingModule, imports: [CommonModule, i8.RouterModule], exports: [RouterModule] }); }
1632
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
384
1633
  }
385
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementRoutingModule, decorators: [{
1634
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementRoutingModule, decorators: [{
386
1635
  type: NgModule,
387
1636
  args: [{
388
1637
  declarations: [],
@@ -392,7 +1641,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
392
1641
  }] });
393
1642
 
394
1643
  /*
395
- * Copyright 2015-2024 Ritense BV, the Netherlands.
1644
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
396
1645
  *
397
1646
  * Licensed under EUPL, Version 1.2 (the "License");
398
1647
  * you may not use this file except in compliance with the License.
@@ -407,46 +1656,75 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
407
1656
  * limitations under the License.
408
1657
  */
409
1658
  class ProcessManagementModule {
410
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
411
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementModule, declarations: [ProcessManagementComponent,
412
- ProcessManagementBuilderComponent,
413
- ProcessManagementListComponent,
414
- ProcessManagementUploadComponent], imports: [CommonModule,
1659
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1660
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementModule, imports: [CommonModule,
415
1661
  ProcessManagementRoutingModule,
416
1662
  WidgetModule,
417
- ListModule,
418
1663
  FormsModule,
419
- TranslateModule], exports: [ProcessManagementComponent] }); }
420
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementModule, imports: [CommonModule,
1664
+ TranslateModule,
1665
+ ProcessLinkModule,
1666
+ ProcessManagementComponent,
1667
+ ProcessManagementBuilderComponent,
1668
+ CarbonListModule,
1669
+ ButtonModule,
1670
+ IconModule,
1671
+ DropdownModule,
1672
+ ModalModule,
1673
+ NotificationModule,
1674
+ RadioModule,
1675
+ ReactiveFormsModule,
1676
+ ModalModule,
1677
+ FileUploaderModule,
1678
+ LayerModule] }); }
1679
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementModule, imports: [CommonModule,
421
1680
  ProcessManagementRoutingModule,
422
1681
  WidgetModule,
423
- ListModule,
424
1682
  FormsModule,
425
- TranslateModule] }); }
1683
+ TranslateModule,
1684
+ ProcessLinkModule,
1685
+ ProcessManagementComponent,
1686
+ ProcessManagementBuilderComponent,
1687
+ CarbonListModule,
1688
+ ButtonModule,
1689
+ IconModule,
1690
+ DropdownModule,
1691
+ ModalModule,
1692
+ NotificationModule,
1693
+ RadioModule,
1694
+ ReactiveFormsModule,
1695
+ ModalModule,
1696
+ FileUploaderModule,
1697
+ LayerModule] }); }
426
1698
  }
427
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ProcessManagementModule, decorators: [{
1699
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProcessManagementModule, decorators: [{
428
1700
  type: NgModule,
429
1701
  args: [{
430
- declarations: [
431
- ProcessManagementComponent,
432
- ProcessManagementBuilderComponent,
433
- ProcessManagementListComponent,
434
- ProcessManagementUploadComponent,
435
- ],
436
1702
  imports: [
437
1703
  CommonModule,
438
1704
  ProcessManagementRoutingModule,
439
1705
  WidgetModule,
440
- ListModule,
441
1706
  FormsModule,
442
1707
  TranslateModule,
1708
+ ProcessLinkModule,
1709
+ ProcessManagementComponent,
1710
+ ProcessManagementBuilderComponent,
1711
+ CarbonListModule,
1712
+ ButtonModule,
1713
+ IconModule,
1714
+ DropdownModule,
1715
+ ModalModule,
1716
+ NotificationModule,
1717
+ RadioModule,
1718
+ ReactiveFormsModule,
1719
+ ModalModule,
1720
+ FileUploaderModule,
1721
+ LayerModule,
443
1722
  ],
444
- exports: [ProcessManagementComponent],
445
1723
  }]
446
1724
  }] });
447
1725
 
448
1726
  /*
449
- * Copyright 2015-2024 Ritense BV, the Netherlands.
1727
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
450
1728
  *
451
1729
  * Licensed under EUPL, Version 1.2 (the "License");
452
1730
  * you may not use this file except in compliance with the License.
@@ -468,5 +1746,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
468
1746
  * Generated bundle index. Do not edit.
469
1747
  */
470
1748
 
471
- export { ProcessManagementComponent, ProcessManagementModule };
1749
+ export { PROCESS_MANAGEMENT_ENDPOINTS, ProcessManagementBuilderComponent, ProcessManagementComponent, ProcessManagementModule, ProcessManagementStateService };
472
1750
  //# sourceMappingURL=valtimo-process-management.mjs.map