@valtimo/process-management 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +33 -0
  2. package/fesm2022/valtimo-process-management.mjs +1752 -0
  3. package/fesm2022/valtimo-process-management.mjs.map +1 -0
  4. package/index.d.ts +6 -0
  5. package/lib/components/index.d.ts +3 -0
  6. package/lib/components/index.d.ts.map +1 -0
  7. package/lib/components/process-management/process-management.component.d.ts +23 -0
  8. package/lib/components/process-management/process-management.component.d.ts.map +1 -0
  9. package/lib/components/process-management-builder/panel/index.d.ts +2 -0
  10. package/lib/components/process-management-builder/panel/index.d.ts.map +1 -0
  11. package/lib/components/process-management-builder/panel/valtimo-properties-provider.d.ts +18 -0
  12. package/lib/components/process-management-builder/panel/valtimo-properties-provider.d.ts.map +1 -0
  13. package/lib/components/process-management-builder/process-management-builder.component.d.ts +98 -0
  14. package/lib/components/process-management-builder/process-management-builder.component.d.ts.map +1 -0
  15. package/lib/components/process-management-list/process-management-list.component.d.ts +40 -0
  16. package/lib/components/process-management-list/process-management-list.component.d.ts.map +1 -0
  17. package/lib/components/process-management-upload/process-management-upload.component.d.ts +24 -0
  18. package/lib/components/process-management-upload/process-management-upload.component.d.ts.map +1 -0
  19. package/lib/constants/bpmn.constants.d.ts +3 -0
  20. package/lib/constants/bpmn.constants.d.ts.map +1 -0
  21. package/lib/constants/index.d.ts +2 -0
  22. package/lib/constants/index.d.ts.map +1 -0
  23. package/lib/models/bpmn.model.d.ts +12 -0
  24. package/lib/models/bpmn.model.d.ts.map +1 -0
  25. package/lib/models/index.d.ts +5 -0
  26. package/lib/models/index.d.ts.map +1 -0
  27. package/lib/models/process-management.model.d.ts +19 -0
  28. package/lib/models/process-management.model.d.ts.map +1 -0
  29. package/lib/models/process.model.d.ts +11 -0
  30. package/lib/models/process.model.d.ts.map +1 -0
  31. package/lib/models/window.model.d.ts +11 -0
  32. package/lib/models/window.model.d.ts.map +1 -0
  33. package/lib/process-management-routing.module.d.ts +9 -0
  34. package/lib/process-management-routing.module.d.ts.map +1 -0
  35. package/lib/process-management.module.d.ts +16 -0
  36. package/lib/process-management.module.d.ts.map +1 -0
  37. package/lib/services/index.d.ts +4 -0
  38. package/lib/services/index.d.ts.map +1 -0
  39. package/lib/services/process-management-editor.service.d.ts +47 -0
  40. package/lib/services/process-management-editor.service.d.ts.map +1 -0
  41. package/lib/services/process-management-state.service.d.ts +14 -0
  42. package/lib/services/process-management-state.service.d.ts.map +1 -0
  43. package/lib/services/process-management.service.d.ts +30 -0
  44. package/lib/services/process-management.service.d.ts.map +1 -0
  45. package/lib/utils/bpmn.utils.d.ts +3 -0
  46. package/lib/utils/bpmn.utils.d.ts.map +1 -0
  47. package/lib/utils/index.d.ts +3 -0
  48. package/lib/utils/index.d.ts.map +1 -0
  49. package/lib/utils/process-management.utils.d.ts +6 -0
  50. package/lib/utils/process-management.utils.d.ts.map +1 -0
  51. package/package.json +29 -0
  52. package/public-api.d.ts +6 -0
  53. package/public-api.d.ts.map +1 -0
  54. package/valtimo-process-management.d.ts.map +1 -0
@@ -0,0 +1,1752 @@
1
+ import * as i6 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
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, 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';
18
+ import Modeler from 'bpmn-js/lib/Modeler';
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';
36
+
37
+ /*
38
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
39
+ *
40
+ * Licensed under EUPL, Version 1.2 (the "License");
41
+ * you may not use this file except in compliance with the License.
42
+ * You may obtain a copy of the License at
43
+ *
44
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
45
+ *
46
+ * Unless required by applicable law or agreed to in writing, software
47
+ * distributed under the License is distributed on an "AS IS" basis,
48
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
49
+ * See the License for the specific language governing permissions and
50
+ * limitations under the License.
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)));
102
+ }
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);
171
+ }
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);
192
+ });
193
+ }
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();
209
+ }
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.17", 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.17", ngImport: i0, type: ProcessManagementEditorService }); }
228
+ }
229
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ProcessManagementEditorService, decorators: [{
230
+ type: Injectable
231
+ }], ctorParameters: () => [{ type: i5.ProcessLinkService }, { type: i2.FormService }] });
232
+
233
+ /*
234
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
235
+ *
236
+ * Licensed under EUPL, Version 1.2 (the "License");
237
+ * you may not use this file except in compliance with the License.
238
+ * You may obtain a copy of the License at
239
+ *
240
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
241
+ *
242
+ * Unless required by applicable law or agreed to in writing, software
243
+ * distributed under the License is distributed on an "AS IS" basis,
244
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
245
+ * See the License for the specific language governing permissions and
246
+ * limitations under the License.
247
+ */
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.17", ngImport: i0, type: ProcessManagementStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
269
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ProcessManagementStateService, providedIn: 'root' }); }
270
+ }
271
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", 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;
370
+ this.configService = configService;
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}`));
397
+ }
398
+ deployBpmn(bpmn) {
399
+ const formData = new FormData();
400
+ formData.append('file', bpmn);
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;
437
+ }
438
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", 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.17", ngImport: i0, type: ProcessManagementService, providedIn: 'root' }); }
440
+ }
441
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ProcessManagementService, decorators: [{
442
+ type: Injectable,
443
+ args: [{
444
+ providedIn: 'root',
445
+ }]
446
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$1.ConfigService }] });
447
+
448
+ /*
449
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
450
+ *
451
+ * Licensed under EUPL, Version 1.2 (the "License");
452
+ * you may not use this file except in compliance with the License.
453
+ * You may obtain a copy of the License at
454
+ *
455
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
456
+ *
457
+ * Unless required by applicable law or agreed to in writing, software
458
+ * distributed under the License is distributed on an "AS IS" basis,
459
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
460
+ * See the License for the specific language governing permissions and
461
+ * limitations under the License.
462
+ */
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;
525
+ }
526
+ get translateService() {
527
+ return window.translateService;
528
+ }
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
+ };
573
+ }
574
+ }
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
+ };
779
+
780
+ /*
781
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
782
+ *
783
+ * Licensed under EUPL, Version 1.2 (the "License");
784
+ * you may not use this file except in compliance with the License.
785
+ * You may obtain a copy of the License at
786
+ *
787
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
788
+ *
789
+ * Unless required by applicable law or agreed to in writing, software
790
+ * distributed under the License is distributed on an "AS IS" basis,
791
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
792
+ * See the License for the specific language governing permissions and
793
+ * limitations under the License.
794
+ */
795
+
796
+ /*
797
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
798
+ *
799
+ * Licensed under EUPL, Version 1.2 (the "License");
800
+ * you may not use this file except in compliance with the License.
801
+ * You may obtain a copy of the License at
802
+ *
803
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
804
+ *
805
+ * Unless required by applicable law or agreed to in writing, software
806
+ * distributed under the License is distributed on an "AS IS" basis,
807
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
808
+ * See the License for the specific language governing permissions and
809
+ * limitations under the License.
810
+ */
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;
825
+ this.processService = processService;
826
+ this.route = route;
827
+ this.router = router;
828
+ this.translateService = translateService;
829
+ this.pluginTranslationService = pluginTranslationService;
830
+ this.editPermissionsService = editPermissionsService;
831
+ this._selectedProcess$ = new BehaviorSubject(null);
832
+ this.loading$ = new BehaviorSubject(true);
833
+ this.isReadOnlyProcess$ = new BehaviorSubject(false);
834
+ this.isSystemProcess$ = new BehaviorSubject(false);
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';
853
+ }
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.$spaceAdjustment = 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();
912
+ }
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();
924
+ }
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();
933
+ }
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' });
939
+ const link = document.createElement('a');
940
+ link.download = 'diagram.bpmn';
941
+ link.href = window.URL.createObjectURL(file);
942
+ link.click();
943
+ window.URL.revokeObjectURL(link.href);
944
+ link.remove();
945
+ });
946
+ }
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
+ },
976
+ });
977
+ }
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: '-',
989
+ }));
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
+ },
1002
+ });
1003
+ }
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
+ });
1013
+ }
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();
1077
+ });
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.17", 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.17", 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 [spaceAdjustment]=\"$spaceAdjustment()\"\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: ["spaceAdjustment", "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.17", 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 [spaceAdjustment]=\"$spaceAdjustment()\"\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.17", 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.17", 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.17", 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.17", 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.17", 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.17", 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
+ }
1529
+ ngOnDestroy() {
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
+ });
1537
+ }
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.17", 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.17", 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 }); }
1550
+ }
1551
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ProcessManagementComponent, decorators: [{
1552
+ type: Component,
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
+ */
1578
+
1579
+ /*
1580
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1581
+ *
1582
+ * Licensed under EUPL, Version 1.2 (the "License");
1583
+ * you may not use this file except in compliance with the License.
1584
+ * You may obtain a copy of the License at
1585
+ *
1586
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1587
+ *
1588
+ * Unless required by applicable law or agreed to in writing, software
1589
+ * distributed under the License is distributed on an "AS IS" basis,
1590
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1591
+ * See the License for the specific language governing permissions and
1592
+ * limitations under the License.
1593
+ */
1594
+ const routes = [
1595
+ {
1596
+ path: 'processes',
1597
+ component: ProcessManagementComponent,
1598
+ canActivate: [AuthGuardService],
1599
+ data: {
1600
+ title: 'Processes',
1601
+ roles: [ROLE_ADMIN],
1602
+ context: 'independent',
1603
+ },
1604
+ },
1605
+ {
1606
+ path: 'processes/create',
1607
+ component: ProcessManagementBuilderComponent,
1608
+ canActivate: [AuthGuardService],
1609
+ //TODO: Re-enable when pending changes is fixed
1610
+ // canDeactivate: [pendingChangesGuard],
1611
+ data: {
1612
+ title: 'Create new Process',
1613
+ roles: [ROLE_ADMIN],
1614
+ context: 'independent',
1615
+ },
1616
+ },
1617
+ {
1618
+ path: 'processes/:processDefinitionKey',
1619
+ component: ProcessManagementBuilderComponent,
1620
+ canActivate: [AuthGuardService],
1621
+ //TODO: Re-enable when pending changes is fixed
1622
+ // canDeactivate: [pendingChangesGuard],
1623
+ data: {
1624
+ title: 'Process details',
1625
+ roles: [ROLE_ADMIN],
1626
+ customPageTitle: true,
1627
+ context: 'independent',
1628
+ },
1629
+ },
1630
+ ];
1631
+ class ProcessManagementRoutingModule {
1632
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ProcessManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1633
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: ProcessManagementRoutingModule, imports: [CommonModule, i8.RouterModule], exports: [RouterModule] }); }
1634
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ProcessManagementRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
1635
+ }
1636
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ProcessManagementRoutingModule, decorators: [{
1637
+ type: NgModule,
1638
+ args: [{
1639
+ declarations: [],
1640
+ imports: [CommonModule, RouterModule.forChild(routes)],
1641
+ exports: [RouterModule],
1642
+ }]
1643
+ }] });
1644
+
1645
+ /*
1646
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1647
+ *
1648
+ * Licensed under EUPL, Version 1.2 (the "License");
1649
+ * you may not use this file except in compliance with the License.
1650
+ * You may obtain a copy of the License at
1651
+ *
1652
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1653
+ *
1654
+ * Unless required by applicable law or agreed to in writing, software
1655
+ * distributed under the License is distributed on an "AS IS" basis,
1656
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1657
+ * See the License for the specific language governing permissions and
1658
+ * limitations under the License.
1659
+ */
1660
+ class ProcessManagementModule {
1661
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ProcessManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1662
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: ProcessManagementModule, imports: [CommonModule,
1663
+ ProcessManagementRoutingModule,
1664
+ WidgetModule,
1665
+ FormsModule,
1666
+ TranslateModule,
1667
+ ProcessLinkModule,
1668
+ ProcessManagementComponent,
1669
+ ProcessManagementBuilderComponent,
1670
+ CarbonListModule,
1671
+ ButtonModule,
1672
+ IconModule,
1673
+ DropdownModule,
1674
+ ModalModule,
1675
+ NotificationModule,
1676
+ RadioModule,
1677
+ ReactiveFormsModule,
1678
+ ModalModule,
1679
+ FileUploaderModule,
1680
+ LayerModule] }); }
1681
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ProcessManagementModule, imports: [CommonModule,
1682
+ ProcessManagementRoutingModule,
1683
+ WidgetModule,
1684
+ FormsModule,
1685
+ TranslateModule,
1686
+ ProcessLinkModule,
1687
+ ProcessManagementComponent,
1688
+ ProcessManagementBuilderComponent,
1689
+ CarbonListModule,
1690
+ ButtonModule,
1691
+ IconModule,
1692
+ DropdownModule,
1693
+ ModalModule,
1694
+ NotificationModule,
1695
+ RadioModule,
1696
+ ReactiveFormsModule,
1697
+ ModalModule,
1698
+ FileUploaderModule,
1699
+ LayerModule] }); }
1700
+ }
1701
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ProcessManagementModule, decorators: [{
1702
+ type: NgModule,
1703
+ args: [{
1704
+ imports: [
1705
+ CommonModule,
1706
+ ProcessManagementRoutingModule,
1707
+ WidgetModule,
1708
+ FormsModule,
1709
+ TranslateModule,
1710
+ ProcessLinkModule,
1711
+ ProcessManagementComponent,
1712
+ ProcessManagementBuilderComponent,
1713
+ CarbonListModule,
1714
+ ButtonModule,
1715
+ IconModule,
1716
+ DropdownModule,
1717
+ ModalModule,
1718
+ NotificationModule,
1719
+ RadioModule,
1720
+ ReactiveFormsModule,
1721
+ ModalModule,
1722
+ FileUploaderModule,
1723
+ LayerModule,
1724
+ ],
1725
+ }]
1726
+ }] });
1727
+
1728
+ /*
1729
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1730
+ *
1731
+ * Licensed under EUPL, Version 1.2 (the "License");
1732
+ * you may not use this file except in compliance with the License.
1733
+ * You may obtain a copy of the License at
1734
+ *
1735
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1736
+ *
1737
+ * Unless required by applicable law or agreed to in writing, software
1738
+ * distributed under the License is distributed on an "AS IS" basis,
1739
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1740
+ * See the License for the specific language governing permissions and
1741
+ * limitations under the License.
1742
+ */
1743
+ /*
1744
+ * Public API Surface of process-management
1745
+ */
1746
+
1747
+ /**
1748
+ * Generated bundle index. Do not edit.
1749
+ */
1750
+
1751
+ export { PROCESS_MANAGEMENT_ENDPOINTS, ProcessManagementBuilderComponent, ProcessManagementComponent, ProcessManagementModule, ProcessManagementStateService };
1752
+ //# sourceMappingURL=valtimo-process-management.mjs.map