@valtimo/process-management 0.0.0-test

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 (58) hide show
  1. package/README.md +33 -0
  2. package/fesm2022/valtimo-process-management.mjs +2018 -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 +104 -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 +44 -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 +3 -0
  22. package/lib/constants/index.d.ts.map +1 -0
  23. package/lib/constants/process-management.test-ids.d.ts +10 -0
  24. package/lib/constants/process-management.test-ids.d.ts.map +1 -0
  25. package/lib/models/bpmn.model.d.ts +12 -0
  26. package/lib/models/bpmn.model.d.ts.map +1 -0
  27. package/lib/models/index.d.ts +5 -0
  28. package/lib/models/index.d.ts.map +1 -0
  29. package/lib/models/process-management.model.d.ts +22 -0
  30. package/lib/models/process-management.model.d.ts.map +1 -0
  31. package/lib/models/process.model.d.ts +11 -0
  32. package/lib/models/process.model.d.ts.map +1 -0
  33. package/lib/models/window.model.d.ts +11 -0
  34. package/lib/models/window.model.d.ts.map +1 -0
  35. package/lib/process-management-routing.module.d.ts +9 -0
  36. package/lib/process-management-routing.module.d.ts.map +1 -0
  37. package/lib/process-management.module.d.ts +16 -0
  38. package/lib/process-management.module.d.ts.map +1 -0
  39. package/lib/services/index.d.ts +4 -0
  40. package/lib/services/index.d.ts.map +1 -0
  41. package/lib/services/process-management-editor.service.d.ts +48 -0
  42. package/lib/services/process-management-editor.service.d.ts.map +1 -0
  43. package/lib/services/process-management-state.service.d.ts +14 -0
  44. package/lib/services/process-management-state.service.d.ts.map +1 -0
  45. package/lib/services/process-management.service.d.ts +31 -0
  46. package/lib/services/process-management.service.d.ts.map +1 -0
  47. package/lib/utils/bpmn.utils.d.ts +3 -0
  48. package/lib/utils/bpmn.utils.d.ts.map +1 -0
  49. package/lib/utils/index.d.ts +4 -0
  50. package/lib/utils/index.d.ts.map +1 -0
  51. package/lib/utils/process-management-builder.utils.d.ts +27 -0
  52. package/lib/utils/process-management-builder.utils.d.ts.map +1 -0
  53. package/lib/utils/process-management.utils.d.ts +6 -0
  54. package/lib/utils/process-management.utils.d.ts.map +1 -0
  55. package/package.json +29 -0
  56. package/public-api.d.ts +7 -0
  57. package/public-api.d.ts.map +1 -0
  58. package/valtimo-process-management.d.ts.map +1 -0
@@ -0,0 +1,2018 @@
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 { FitPageDirective, RenderInPageHeaderDirective, OverflowMenuComponent, OverflowMenuOptionComponent, OverflowMenuTriggerComponent, ViewType, CarbonListModule, ConfirmationModalModule, CARBON_CONSTANTS, WidgetModule } from '@valtimo/components';
11
+ import * as i5 from '@valtimo/process-link';
12
+ import { 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, ToggleModule, TooltipModule, FileUploaderModule, ModalModule, LayerModule, NotificationModule, RadioModule } from 'carbon-components-angular';
15
+ import * as i2$1 from '@valtimo/shared';
16
+ import { BaseApiService, getCaseManagementRouteParams, getBuildingBlockManagementRouteParams, 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, Subject, Subscription, combineLatest, switchMap, of, tap, map as map$1, startWith, from, take, merge } 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 { is } from 'bpmn-js/lib/util/ModelUtil';
28
+ import { html } from 'htm/preact';
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-2026 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
+ const PROCESS_MANAGEMENT_LIST_TEST_IDS = {
84
+ uploadButton: 'processManagementUploadButton',
85
+ createProcessButton: 'processManagementCreateProcessButton',
86
+ };
87
+ const PROCESS_MANAGEMENT_BUILDER_TEST_IDS = {
88
+ startsCaseToggle: 'processManagementBuilderStartsCaseToggle',
89
+ startableByUserToggle: 'processManagementBuilderStartableByUserToggle',
90
+ deployButton: 'processManagementBuilderDeployButton',
91
+ };
92
+
93
+ /*
94
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
95
+ *
96
+ * Licensed under EUPL, Version 1.2 (the "License");
97
+ * you may not use this file except in compliance with the License.
98
+ * You may obtain a copy of the License at
99
+ *
100
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
101
+ *
102
+ * Unless required by applicable law or agreed to in writing, software
103
+ * distributed under the License is distributed on an "AS IS" basis,
104
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
105
+ * See the License for the specific language governing permissions and
106
+ * limitations under the License.
107
+ */
108
+
109
+ /*
110
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
111
+ *
112
+ * Licensed under EUPL, Version 1.2 (the "License");
113
+ * you may not use this file except in compliance with the License.
114
+ * You may obtain a copy of the License at
115
+ *
116
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
117
+ *
118
+ * Unless required by applicable law or agreed to in writing, software
119
+ * distributed under the License is distributed on an "AS IS" basis,
120
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
121
+ * See the License for the specific language governing permissions and
122
+ * limitations under the License.
123
+ */
124
+ class ProcessManagementEditorService {
125
+ get selectionProcessDefinition$() {
126
+ return this._selectionProcessDefinitionSubject$.pipe(filter(selectedProcessDefinition => !!selectedProcessDefinition?.id), distinctUntilChanged((previous, current) => isEqual(previous, current)));
127
+ }
128
+ get selectionProcessDefinition() {
129
+ return this._selectionProcessDefinitionSubject$.getValue();
130
+ }
131
+ get processLinksForSelectedDefinition$() {
132
+ return this._processLinksForSelectedDefinition$.asObservable();
133
+ }
134
+ get processLinksForSelectedDefinition() {
135
+ return this._processLinksForSelectedDefinition$.getValue();
136
+ }
137
+ get openProcessLinkModalEvents$() {
138
+ return this._openProcessLinkModalEvents$.asObservable();
139
+ }
140
+ get deleteProcessLinkEvents$() {
141
+ return this._deleteProcessLinkEvents$.asObservable();
142
+ }
143
+ setSelectedProcessDefinition(definition) {
144
+ this._selectionProcessDefinitionSubject$.next(definition);
145
+ }
146
+ get formDefinitionOptions() {
147
+ return this._formDefinitionOptions$.getValue();
148
+ }
149
+ constructor(processLinkService, formService) {
150
+ this.processLinkService = processLinkService;
151
+ this.formService = formService;
152
+ this._selectionProcessDefinitionSubject$ = new BehaviorSubject(null);
153
+ this._processLinksForSelectedDefinition$ = new BehaviorSubject([]);
154
+ this._openProcessLinkModalEvents$ = new Subject();
155
+ this._deleteProcessLinkEvents$ = new Subject();
156
+ this._managementRouteParams$ = new BehaviorSubject(null);
157
+ this._formDefinitionOptions$ = new BehaviorSubject([]);
158
+ this._updatingBpmnView = false;
159
+ this._activityIdBusinessIdMap = {};
160
+ this._subscriptions = new Subscription();
161
+ this.openSelectedProcessDefinitionSubscription();
162
+ this.openFormDefinitionOptionsSubscription();
163
+ }
164
+ ngOnDestroy() {
165
+ this._subscriptions.unsubscribe();
166
+ }
167
+ setManagementRouteParams(context, params) {
168
+ this._managementRouteParams$.next([context, params]);
169
+ }
170
+ sendOpenProcessLinkModalEvent(event, updateBpmnViewFunction) {
171
+ this._updateBpmnViewFunction = updateBpmnViewFunction;
172
+ this._openProcessLinkModalEvents$.next(event);
173
+ }
174
+ sendDeleteProcessLinkEvent(event, updateBpmnViewFunction) {
175
+ this._updateBpmnViewFunction = updateBpmnViewFunction;
176
+ this._deleteProcessLinkEvents$.next(event);
177
+ }
178
+ updateProcessLink(event) {
179
+ this.setProcessLinksForSelectedDefinition(this.processLinksForSelectedDefinition.map(processLink => {
180
+ if (processLink.activityId === event.activityId) {
181
+ return { ...processLink, ...event };
182
+ }
183
+ return processLink;
184
+ }));
185
+ this.updateBpmnView();
186
+ }
187
+ createProcessLink(event) {
188
+ this.setProcessLinksForSelectedDefinition([
189
+ ...this.processLinksForSelectedDefinition,
190
+ event,
191
+ ]);
192
+ this.updateBpmnView();
193
+ }
194
+ deleteProcessLink(event, updateBpmnViewFunction) {
195
+ if (updateBpmnViewFunction) {
196
+ this._updateBpmnViewFunction = updateBpmnViewFunction;
197
+ }
198
+ this.setProcessLinksForSelectedDefinition(this.processLinksForSelectedDefinition.filter(processLink => processLink.activityId !== event.activityId));
199
+ this.updateBpmnView();
200
+ }
201
+ setProcessLinksForSelectedDefinition(processLinks) {
202
+ this._processLinksForSelectedDefinition$.next(processLinks);
203
+ }
204
+ setActivityIdBusinessIdMap(activityIdBusinessIdMap) {
205
+ this._activityIdBusinessIdMap = activityIdBusinessIdMap;
206
+ }
207
+ updateProcessLinksOnIdChange(activityId, newBusinessId) {
208
+ const newBusinessIdWithoutLabelString = newBusinessId.replace('_label', '');
209
+ if (!this._activityIdBusinessIdMap[activityId] ||
210
+ this._activityIdBusinessIdMap[activityId] === newBusinessIdWithoutLabelString) {
211
+ return;
212
+ }
213
+ this.updateProcessLinkId(this._activityIdBusinessIdMap[activityId], newBusinessId);
214
+ this._activityIdBusinessIdMap = { ...this._activityIdBusinessIdMap, [activityId]: newBusinessId };
215
+ }
216
+ openSelectedProcessDefinitionSubscription() {
217
+ this._subscriptions.add(this.selectionProcessDefinition$.subscribe(definition => {
218
+ this.fetchProcessLinksForDefinition(definition.id);
219
+ }));
220
+ }
221
+ fetchProcessLinksForDefinition(processDefinitionId) {
222
+ this.processLinkService.getProcessLink({ processDefinitionId }).subscribe(res => {
223
+ this.setProcessLinksForSelectedDefinition(res);
224
+ });
225
+ }
226
+ updateBpmnView() {
227
+ if (!this._updateBpmnViewFunction || this._updatingBpmnView)
228
+ return;
229
+ this._updatingBpmnView = true;
230
+ this._updateBpmnViewFunction();
231
+ this._updatingBpmnView = false;
232
+ }
233
+ updateProcessLinkId(oldBusinessId, newBusinessId) {
234
+ this.setProcessLinksForSelectedDefinition(this.processLinksForSelectedDefinition.map(processLink => {
235
+ if (processLink.activityId === oldBusinessId) {
236
+ return { ...processLink, activityId: newBusinessId };
237
+ }
238
+ return processLink;
239
+ }));
240
+ this.updateBpmnView();
241
+ }
242
+ openFormDefinitionOptionsSubscription() {
243
+ this._subscriptions.add(this._managementRouteParams$
244
+ .pipe(filter((params) => params !== null))
245
+ .subscribe(([context, params]) => {
246
+ switch (context) {
247
+ case 'independent':
248
+ this.formService
249
+ .getAllUnlinkedFormDefinitions()
250
+ .subscribe(options => this._formDefinitionOptions$.next(options));
251
+ break;
252
+ case 'case':
253
+ const caseParams = params;
254
+ this.formService
255
+ .getAllFormDefinitionsForCaseDefinition(caseParams.caseDefinitionKey, caseParams.caseDefinitionVersionTag)
256
+ .subscribe(options => this._formDefinitionOptions$.next(options));
257
+ break;
258
+ case 'buildingBlock': {
259
+ const buildingBlockParams = params;
260
+ this.formService
261
+ .getAllFormDefinitionsForBuildingBlock(buildingBlockParams.buildingBlockDefinitionKey, buildingBlockParams.buildingBlockDefinitionVersionTag)
262
+ .subscribe(options => this._formDefinitionOptions$.next(options));
263
+ break;
264
+ }
265
+ }
266
+ }));
267
+ }
268
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementEditorService, deps: [{ token: i5.ProcessLinkService }, { token: i2.FormService }], target: i0.ɵɵFactoryTarget.Injectable }); }
269
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementEditorService }); }
270
+ }
271
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementEditorService, decorators: [{
272
+ type: Injectable
273
+ }], ctorParameters: () => [{ type: i5.ProcessLinkService }, { type: i2.FormService }] });
274
+
275
+ /*
276
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
277
+ *
278
+ * Licensed under EUPL, Version 1.2 (the "License");
279
+ * you may not use this file except in compliance with the License.
280
+ * You may obtain a copy of the License at
281
+ *
282
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
283
+ *
284
+ * Unless required by applicable law or agreed to in writing, software
285
+ * distributed under the License is distributed on an "AS IS" basis,
286
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
287
+ * See the License for the specific language governing permissions and
288
+ * limitations under the License.
289
+ */
290
+ class ProcessManagementStateService {
291
+ constructor() {
292
+ this._openModal$ = new Subject();
293
+ this._reloadDefinitions$ = new BehaviorSubject(null);
294
+ }
295
+ get openModal$() {
296
+ return this._openModal$.asObservable();
297
+ }
298
+ get reloadDefinitions$() {
299
+ return this._reloadDefinitions$.asObservable();
300
+ }
301
+ openModal() {
302
+ this._openModal$.next(true);
303
+ }
304
+ closeModal() {
305
+ this._openModal$.next(false);
306
+ }
307
+ reloadDefinitions() {
308
+ this._reloadDefinitions$.next(null);
309
+ }
310
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
311
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementStateService, providedIn: 'root' }); }
312
+ }
313
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementStateService, decorators: [{
314
+ type: Injectable,
315
+ args: [{ providedIn: 'root' }]
316
+ }] });
317
+
318
+ /*
319
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
320
+ *
321
+ * Licensed under EUPL, Version 1.2 (the "License");
322
+ * you may not use this file except in compliance with the License.
323
+ * You may obtain a copy of the License at
324
+ *
325
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
326
+ *
327
+ * Unless required by applicable law or agreed to in writing, software
328
+ * distributed under the License is distributed on an "AS IS" basis,
329
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
330
+ * See the License for the specific language governing permissions and
331
+ * limitations under the License.
332
+ */
333
+
334
+ /*
335
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
336
+ *
337
+ * Licensed under EUPL, Version 1.2 (the "License");
338
+ * you may not use this file except in compliance with the License.
339
+ * You may obtain a copy of the License at
340
+ *
341
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
342
+ *
343
+ * Unless required by applicable law or agreed to in writing, software
344
+ * distributed under the License is distributed on an "AS IS" basis,
345
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
346
+ * See the License for the specific language governing permissions and
347
+ * limitations under the License.
348
+ */
349
+
350
+ /*
351
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
352
+ *
353
+ * Licensed under EUPL, Version 1.2 (the "License");
354
+ * you may not use this file except in compliance with the License.
355
+ * You may obtain a copy of the License at
356
+ *
357
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
358
+ *
359
+ * Unless required by applicable law or agreed to in writing, software
360
+ * distributed under the License is distributed on an "AS IS" basis,
361
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
362
+ * See the License for the specific language governing permissions and
363
+ * limitations under the License.
364
+ */
365
+ const PROCESS_MANAGEMENT_ENDPOINTS = {
366
+ case: '/management/v1/case-definition',
367
+ independent: '/management/v1/process-definition',
368
+ };
369
+
370
+ /*
371
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
372
+ *
373
+ * Licensed under EUPL, Version 1.2 (the "License");
374
+ * you may not use this file except in compliance with the License.
375
+ * You may obtain a copy of the License at
376
+ *
377
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
378
+ *
379
+ * Unless required by applicable law or agreed to in writing, software
380
+ * distributed under the License is distributed on an "AS IS" basis,
381
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
382
+ * See the License for the specific language governing permissions and
383
+ * limitations under the License.
384
+ */
385
+
386
+ /*
387
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
388
+ *
389
+ * Licensed under EUPL, Version 1.2 (the "License");
390
+ * you may not use this file except in compliance with the License.
391
+ * You may obtain a copy of the License at
392
+ *
393
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
394
+ *
395
+ * Unless required by applicable law or agreed to in writing, software
396
+ * distributed under the License is distributed on an "AS IS" basis,
397
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
398
+ * See the License for the specific language governing permissions and
399
+ * limitations under the License.
400
+ */
401
+
402
+ class ProcessManagementService extends BaseApiService {
403
+ set context(value) {
404
+ this._$context.set(value);
405
+ }
406
+ get $context() {
407
+ return this._$context.asReadonly();
408
+ }
409
+ constructor(httpClient, configService) {
410
+ super(httpClient, configService);
411
+ this.httpClient = httpClient;
412
+ this.configService = configService;
413
+ this._definitionKey$ = new BehaviorSubject(null);
414
+ this._versionTag$ = new BehaviorSubject(null);
415
+ this._$context = signal('independent');
416
+ this.processes$ = combineLatest([
417
+ this._definitionKey$,
418
+ this._versionTag$,
419
+ toObservable(this._$context),
420
+ ]).pipe(switchMap(([definitionKey, versionTag, context]) => {
421
+ if (context === 'independent') {
422
+ return this.getUnlinkedProcesses();
423
+ }
424
+ if (!!definitionKey && !!versionTag) {
425
+ return this.getProcesses(definitionKey, versionTag);
426
+ }
427
+ return of([]);
428
+ }));
429
+ }
430
+ setParams(key, versionTag) {
431
+ this._definitionKey$.next(key);
432
+ this._versionTag$.next(versionTag);
433
+ }
434
+ deleteProcess(processDefinitionKey) {
435
+ return this.httpClient.delete(this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._$context()]}/${this._definitionKey$.getValue()}/version/${this._versionTag$.getValue()}/process-definition/key/${processDefinitionKey}`));
436
+ }
437
+ deleteUnlinkedProcess(processDefinitionKey) {
438
+ return this.httpClient.delete(this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._$context()]}/key/${processDefinitionKey}`));
439
+ }
440
+ deployBpmn(bpmn) {
441
+ const formData = new FormData();
442
+ formData.append('file', bpmn);
443
+ formData.append('processLinks', new Blob([JSON.stringify([].map(processLink => this.emptyStringToNull(processLink)))], {
444
+ type: 'application/json',
445
+ }));
446
+ return this.httpClient.post(this._$context() === 'case'
447
+ ? this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._$context()]}/${this._definitionKey$.getValue()}/version/${this._versionTag$.getValue()}/process-definition`)
448
+ : this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._$context()]}`), formData);
449
+ }
450
+ getProcessDefinitionForCase(caseDefinitionKey, caseDefinitionVersionTag, processDefinitionKey) {
451
+ return this.httpClient.get(this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._$context()]}/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/process-definition/key/${processDefinitionKey}`));
452
+ }
453
+ getBuildingBlockProcessDefinition(key, versionTag, processDefinitionId) {
454
+ return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/process-definition/${processDefinitionId}`));
455
+ }
456
+ getUnlinkedProcessDefinitionsByKey(processDefinitionKey) {
457
+ return this.httpClient.get(this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._$context()]}/key/${processDefinitionKey}`));
458
+ }
459
+ updateProcessDefinitionCaseDefinitionProperties(caseDefinitionKey, caseDefinitionVersionTag, processDefinitionId, body) {
460
+ return this.httpClient.put(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/process/${processDefinitionId}/properties`), body);
461
+ }
462
+ getProcesses(definitionName, versionTag) {
463
+ return this.httpClient.get(this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._$context()]}/${definitionName}/version/${versionTag}/process-definition`));
464
+ }
465
+ getUnlinkedProcesses() {
466
+ return this.httpClient.get(this.getApiUrl(`${PROCESS_MANAGEMENT_ENDPOINTS[this._$context()]}`));
467
+ }
468
+ emptyStringToNull(object) {
469
+ if (object && typeof object === 'object') {
470
+ Object.keys(object).forEach(key => {
471
+ const typedKey = key;
472
+ const value = object[typedKey];
473
+ if (typeof value === 'object' && value !== null) {
474
+ this.emptyStringToNull(value);
475
+ }
476
+ else if (value === '') {
477
+ object[typedKey] = null;
478
+ }
479
+ });
480
+ }
481
+ return object;
482
+ }
483
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementService, deps: [{ token: i1.HttpClient }, { token: i2$1.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
484
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementService, providedIn: 'root' }); }
485
+ }
486
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementService, decorators: [{
487
+ type: Injectable,
488
+ args: [{
489
+ providedIn: 'root',
490
+ }]
491
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2$1.ConfigService }] });
492
+
493
+ /*
494
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
495
+ *
496
+ * Licensed under EUPL, Version 1.2 (the "License");
497
+ * you may not use this file except in compliance with the License.
498
+ * You may obtain a copy of the License at
499
+ *
500
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
501
+ *
502
+ * Unless required by applicable law or agreed to in writing, software
503
+ * distributed under the License is distributed on an "AS IS" basis,
504
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
505
+ * See the License for the specific language governing permissions and
506
+ * limitations under the License.
507
+ */
508
+
509
+ /*
510
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
511
+ *
512
+ * Licensed under EUPL, Version 1.2 (the "License");
513
+ * you may not use this file except in compliance with the License.
514
+ * You may obtain a copy of the License at
515
+ *
516
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
517
+ *
518
+ * Unless required by applicable law or agreed to in writing, software
519
+ * distributed under the License is distributed on an "AS IS" basis,
520
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
521
+ * See the License for the specific language governing permissions and
522
+ * limitations under the License.
523
+ */
524
+ const mapActivityTypeToActivityListenerType = (activityType, element) => {
525
+ if (activityType === 'bpmn:UserTask') {
526
+ return activityType + ':create';
527
+ }
528
+ if (activityType === 'bpmn:StartEvent' && element) {
529
+ const eventDefinitions = element.businessObject?.eventDefinitions;
530
+ if (eventDefinitions?.length > 0 && eventDefinitions[0].$type === 'bpmn:MessageEventDefinition') {
531
+ return 'bpmn:MessageStartEvent:start';
532
+ }
533
+ }
534
+ if (activityType === 'bpmn:ReceiveTask' || activityType === 'bpmn:IntermediateCatchEvent') {
535
+ return activityType + ':end';
536
+ }
537
+ return activityType + ':start';
538
+ };
539
+
540
+ function getContextObservable(route) {
541
+ return route.data.pipe(map(data => (data && data['context']) || null), distinctUntilChanged());
542
+ }
543
+
544
+ /*
545
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
546
+ *
547
+ * Licensed under EUPL, Version 1.2 (the "License");
548
+ * you may not use this file except in compliance with the License.
549
+ * You may obtain a copy of the License at
550
+ *
551
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
552
+ *
553
+ * Unless required by applicable law or agreed to in writing, software
554
+ * distributed under the License is distributed on an "AS IS" basis,
555
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
556
+ * See the License for the specific language governing permissions and
557
+ * limitations under the License.
558
+ */
559
+ const getLatestProcessDefinition = (processDefinitions) => {
560
+ if (!processDefinitions || processDefinitions.length === 0)
561
+ return null;
562
+ return processDefinitions.reduce((acc, version) => version.version > acc.version ? version : acc);
563
+ };
564
+ const initBreadcrumbsForContext = (breadcrumbService, translateService, params, context) => {
565
+ if (!params)
566
+ return;
567
+ if (context === 'case') {
568
+ const caseParams = params;
569
+ const route = `/case-management/case/${caseParams.caseDefinitionKey}/version/${caseParams.caseDefinitionVersionTag}`;
570
+ breadcrumbService.setThirdBreadcrumb({
571
+ route: [route],
572
+ content: `${caseParams.caseDefinitionKey} (${caseParams.caseDefinitionVersionTag})`,
573
+ href: route,
574
+ });
575
+ const routeWithProcesses = `${route}/processes`;
576
+ breadcrumbService.setFourthBreadcrumb({
577
+ route: [routeWithProcesses],
578
+ content: translateService.instant('caseManagement.tabs.processes'),
579
+ href: routeWithProcesses,
580
+ });
581
+ }
582
+ if (context === 'buildingBlock') {
583
+ const bbParams = params;
584
+ const route = `/building-block-management/building-block/${bbParams.buildingBlockDefinitionKey}/version/${bbParams.buildingBlockDefinitionVersionTag}`;
585
+ const generalRoute = `${route}/general`;
586
+ breadcrumbService.setThirdBreadcrumb({
587
+ route: [generalRoute],
588
+ content: `${bbParams.buildingBlockDefinitionKey} (${bbParams.buildingBlockDefinitionVersionTag})`,
589
+ href: generalRoute,
590
+ });
591
+ const processRoute = `${route}/process-definition`;
592
+ breadcrumbService.setFourthBreadcrumb({
593
+ route: [processRoute],
594
+ content: translateService.instant('buildingBlockManagement.tabs.processes'),
595
+ href: processRoute,
596
+ });
597
+ }
598
+ };
599
+ const DisableBpmnWriteModule = {
600
+ paletteProvider: ['value', {}],
601
+ contextPadProvider: ['value', {}],
602
+ directEditing: [
603
+ 'value',
604
+ {
605
+ registerProvider: () => { },
606
+ activate: () => { },
607
+ deactivate: () => { },
608
+ isActive: () => false,
609
+ },
610
+ ],
611
+ move: ['value', null],
612
+ resizeHandles: ['value', { addResizer: () => { }, removeResizers: () => { } }],
613
+ };
614
+ const disableCommands = (editor) => {
615
+ const commandStack = editor.get('commandStack');
616
+ const originalExecute = commandStack?.execute?.bind(commandStack);
617
+ if (commandStack?.execute) {
618
+ commandStack.execute = (command, context) => {
619
+ if (command === 'elements.delete' ||
620
+ command === 'elements.copy' ||
621
+ command === 'elements.paste' ||
622
+ command === 'elements.create') {
623
+ return;
624
+ }
625
+ originalExecute(command, context);
626
+ };
627
+ }
628
+ };
629
+ const applyBuildingBlockCalledElement = (editor, activityId, mainProcessDefinitionKey, versionTag) => {
630
+ if (!editor)
631
+ return;
632
+ const elementRegistry = editor.get('elementRegistry');
633
+ const modeling = editor.get('modeling');
634
+ const moddle = editor.get('moddle');
635
+ const element = elementRegistry.get(activityId);
636
+ if (!element || !is(element, 'bpmn:CallActivity')) {
637
+ return;
638
+ }
639
+ modeling.updateProperties(element, {
640
+ calledElement: mainProcessDefinitionKey,
641
+ 'camunda:calledElementBinding': 'versionTag',
642
+ 'camunda:calledElementVersionTag': versionTag,
643
+ 'camunda:calledElementType': 'BPMN',
644
+ });
645
+ let extensionElements = element.businessObject.extensionElements;
646
+ if (!extensionElements) {
647
+ extensionElements = moddle.create('bpmn:ExtensionElements', { values: [] });
648
+ modeling.updateProperties(element, {
649
+ extensionElements,
650
+ });
651
+ }
652
+ extensionElements.values = (extensionElements.values || []).filter((val) => !(val.$type === 'camunda:In' && val.businessKey));
653
+ const inWithBusinessKey = moddle.create('camunda:In', {
654
+ businessKey: '#{buildingBlockDocumentId}',
655
+ });
656
+ extensionElements.values.push(inWithBusinessKey);
657
+ modeling.updateProperties(element, {
658
+ extensionElements,
659
+ });
660
+ };
661
+ const clearBuildingBlockCalledElement = (editor, activityId) => {
662
+ const localEditor = editor;
663
+ if (!localEditor)
664
+ return;
665
+ const elementRegistry = localEditor.get('elementRegistry');
666
+ const modeling = localEditor.get('modeling');
667
+ const element = elementRegistry.get(activityId);
668
+ if (!element || !is(element, 'bpmn:CallActivity'))
669
+ return;
670
+ const bo = element.businessObject;
671
+ const versionTag = bo.get('camunda:calledElementVersionTag');
672
+ if (!versionTag || !versionTag.startsWith('BB:'))
673
+ return;
674
+ const props = {
675
+ calledElement: undefined,
676
+ 'camunda:calledElementBinding': undefined,
677
+ 'camunda:calledElementVersionTag': undefined,
678
+ 'camunda:calledElementType': undefined,
679
+ };
680
+ const extensionElements = bo.extensionElements;
681
+ if (extensionElements && Array.isArray(extensionElements.values)) {
682
+ // Keep all elements except camunda:In with businessKey (building block mapping)
683
+ extensionElements.values = extensionElements.values.filter((val) => val.$type !== 'camunda:In' || !val.businessKey);
684
+ if (extensionElements.values.length === 0) {
685
+ props.extensionElements = undefined;
686
+ }
687
+ else {
688
+ props.extensionElements = extensionElements;
689
+ }
690
+ }
691
+ modeling.updateProperties(element, props);
692
+ const attrs = bo.$attrs || {};
693
+ Object.keys(attrs).forEach(key => {
694
+ if (key.startsWith('camunda:calledElement'))
695
+ delete attrs[key];
696
+ if (key === 'calledElement')
697
+ delete attrs[key];
698
+ });
699
+ };
700
+
701
+ /*
702
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
703
+ *
704
+ * Licensed under EUPL, Version 1.2 (the "License");
705
+ * you may not use this file except in compliance with the License.
706
+ * You may obtain a copy of the License at
707
+ *
708
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
709
+ *
710
+ * Unless required by applicable law or agreed to in writing, software
711
+ * distributed under the License is distributed on an "AS IS" basis,
712
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
713
+ * See the License for the specific language governing permissions and
714
+ * limitations under the License.
715
+ */
716
+
717
+ /*
718
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
719
+ *
720
+ * Licensed under EUPL, Version 1.2 (the "License");
721
+ * you may not use this file except in compliance with the License.
722
+ * You may obtain a copy of the License at
723
+ *
724
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
725
+ *
726
+ * Unless required by applicable law or agreed to in writing, software
727
+ * distributed under the License is distributed on an "AS IS" basis,
728
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
729
+ * See the License for the specific language governing permissions and
730
+ * limitations under the License.
731
+ */
732
+ class ValtimoPropertiesProvider {
733
+ static { this.$inject = ['propertiesPanel', 'translate']; }
734
+ get processManagementEditorService() {
735
+ return window.processManagementEditorService;
736
+ }
737
+ get translateService() {
738
+ return window.translateService;
739
+ }
740
+ get pluginTranslationService() {
741
+ return window.pluginTranslationService;
742
+ }
743
+ constructor(propertiesPanel) {
744
+ propertiesPanel.registerProvider(500, this);
745
+ }
746
+ addAsSecondOrFirst(arr, element) {
747
+ if (arr.length === 0) {
748
+ arr.push(element);
749
+ }
750
+ else {
751
+ arr.splice(1, 0, element);
752
+ }
753
+ return arr;
754
+ }
755
+ getGroups(element) {
756
+ const processLink = this.processManagementEditorService.processLinksForSelectedDefinition.find(processLink => processLink.activityId === element.id) || null;
757
+ return (groups) => {
758
+ if (is(element, 'bpmn:UserTask') ||
759
+ is(element, 'bpmn:StartEvent') ||
760
+ is(element, 'bpmn:ServiceTask') ||
761
+ is(element, 'bpmn:SendTask') ||
762
+ is(element, 'bpmn:ReceiveTask') ||
763
+ is(element, 'bpmn:IntermediateThrowEvent') ||
764
+ is(element, 'bpmn:IntermediateCatchEvent') ||
765
+ is(element, 'bpmn:CallActivity')) {
766
+ const customGroup = {
767
+ id: 'customRootGroup',
768
+ label: 'Process link',
769
+ entries: [this.createCustomRootElement(element, processLink)],
770
+ groupType: 'root',
771
+ };
772
+ this.addAsSecondOrFirst(groups, customGroup);
773
+ }
774
+ return groups;
775
+ };
776
+ }
777
+ createCustomRootElement(element, processLink) {
778
+ return {
779
+ translateService: this.translateService,
780
+ processManagementEditorService: this.processManagementEditorService,
781
+ pluginTranslationService: this.pluginTranslationService,
782
+ id: 'customRootElement',
783
+ processLink,
784
+ element,
785
+ component: CustomRootElement,
786
+ isEdited: () => false,
787
+ };
788
+ }
789
+ }
790
+ const CustomRootElement = (props) => {
791
+ const { element, processLink, translateService, processManagementEditorService, pluginTranslationService, } = props;
792
+ const modeling = useService('modeling');
793
+ const elementRegistry = useService('elementRegistry');
794
+ const editProcessLinkText = translateService.instant('interface.edit');
795
+ const unlinkText = translateService.instant('processLink.unlink');
796
+ const createText = translateService.instant('processLink.create');
797
+ const getModalParams = () => {
798
+ const currentElement = elementRegistry.get(element.id) || element;
799
+ return {
800
+ processDefinitionKey: processManagementEditorService.selectionProcessDefinition?.key,
801
+ processDefinitionId: processManagementEditorService.selectionProcessDefinition?.id,
802
+ element: {
803
+ id: currentElement.id,
804
+ type: currentElement.type,
805
+ activityListenerType: mapActivityTypeToActivityListenerType(currentElement.type, currentElement),
806
+ name: currentElement.di?.bpmnElement?.name,
807
+ },
808
+ };
809
+ };
810
+ const handleCreateClick = () => {
811
+ const event = {
812
+ modalParams: getModalParams(),
813
+ };
814
+ processManagementEditorService.sendOpenProcessLinkModalEvent(event, () => {
815
+ // Defer to avoid calling modeling.updateProperties during command stack execute/revert phase
816
+ setTimeout(() => modeling.updateProperties(element, {}), 0);
817
+ });
818
+ };
819
+ const handleEditClick = () => {
820
+ const event = {
821
+ processLink,
822
+ modalParams: getModalParams(),
823
+ };
824
+ processManagementEditorService.sendOpenProcessLinkModalEvent(event, () => {
825
+ // Defer to avoid calling modeling.updateProperties during command stack execute/revert phase
826
+ setTimeout(() => modeling.updateProperties(element, {}), 0);
827
+ });
828
+ };
829
+ const handleUnlinkClick = () => {
830
+ processManagementEditorService.sendDeleteProcessLinkEvent({ activityId: processLink.activityId }, () => {
831
+ // Defer to avoid calling modeling.updateProperties during command stack execute/revert phase
832
+ setTimeout(() => modeling.updateProperties(element, {}), 0);
833
+ });
834
+ };
835
+ const processLinkFormDefinitionId = processLink?.formDefinitionId;
836
+ const processLinkFormDefinitionName = processManagementEditorService.formDefinitionOptions.find(option => option.id === processLinkFormDefinitionId)?.name;
837
+ if (processLinkFormDefinitionName) {
838
+ return html `<div class="process-link-properties-panel">
839
+ <div class="process-link-properties-panel__header">
840
+ <span class="process-link-properties-panel__title">${processLinkFormDefinitionName}</span>
841
+
842
+ <cds-tag
843
+ class="cds--tag cds--tag--blue cds--tag--md cds--layout--size-md cds-tag--no-margin"
844
+ ><span class="cds--tag__label">
845
+ ${translateService.instant('processLinkType.form')}
846
+ </span>
847
+ </cds-tag>
848
+ </div>
849
+
850
+ <div class="process-link-properties-panel__buttons">
851
+ <button
852
+ class="cds--btn cds--btn--danger cds--btn--sm cds--layout--side-md"
853
+ onClick=${handleUnlinkClick}
854
+ >
855
+ ${unlinkText}
856
+ </button>
857
+
858
+ <button
859
+ class="cds--btn cds--btn--primary cds--btn--sm cds--layout--size-md"
860
+ onClick=${handleEditClick}
861
+ >
862
+ ${editProcessLinkText}
863
+ </button>
864
+ </div>
865
+ </div>`;
866
+ }
867
+ const processLinkFormFlowDefinitionKey = processLink?.formFlowDefinitionKey;
868
+ if (processLinkFormFlowDefinitionKey) {
869
+ return html `<div class="process-link-properties-panel">
870
+ <div class="process-link-properties-panel__header">
871
+ <span class="process-link-properties-panel__title"
872
+ >${processLinkFormFlowDefinitionKey}</span
873
+ >
874
+
875
+ <cds-tag
876
+ class="cds--tag cds--tag--teal cds--tag--md cds--layout--size-md cds-tag--no-margin"
877
+ ><span class="cds--tag__label">
878
+ ${translateService.instant('processLinkType.form-flow')}
879
+ </span>
880
+ </cds-tag>
881
+ </div>
882
+
883
+ <div class="process-link-properties-panel__buttons">
884
+ <button
885
+ class="cds--btn cds--btn--danger cds--btn--sm cds--layout--side-md"
886
+ onClick=${handleUnlinkClick}
887
+ >
888
+ ${unlinkText}
889
+ </button>
890
+
891
+ <button
892
+ class="cds--btn cds--btn--primary cds--btn--sm cds--layout--size-md"
893
+ onClick=${handleEditClick}
894
+ >
895
+ ${editProcessLinkText}
896
+ </button>
897
+ </div>
898
+ </div>`;
899
+ }
900
+ const buildingBlockDefinitionKey = processLink?.buildingBlockDefinitionKey;
901
+ const buildingBlockDefinitionVersion = processLink?.buildingBlockDefinitionVersionTag;
902
+ if (buildingBlockDefinitionKey) {
903
+ return html `<div class="process-link-properties-panel">
904
+ <div class="process-link-properties-panel__header">
905
+ <span class="process-link-properties-panel__title"
906
+ >${buildingBlockDefinitionKey} (${buildingBlockDefinitionVersion})</span
907
+ >
908
+
909
+ <cds-tag
910
+ class="cds--tag cds--tag--green cds--tag--md cds--layout--size-md cds-tag--no-margin"
911
+ ><span class="cds--tag__label">
912
+ ${translateService.instant('processLinkType.building-block')}
913
+ </span>
914
+ </cds-tag>
915
+ </div>
916
+
917
+ <div class="process-link-properties-panel__buttons">
918
+ <button
919
+ class="cds--btn cds--btn--danger cds--btn--sm cds--layout--side-md"
920
+ onClick=${handleUnlinkClick}
921
+ >
922
+ ${unlinkText}
923
+ </button>
924
+
925
+ <button
926
+ class="cds--btn cds--btn--primary cds--btn--sm cds--layout--size-md"
927
+ onClick=${handleEditClick}
928
+ >
929
+ ${editProcessLinkText}
930
+ </button>
931
+ </div>
932
+ </div>`;
933
+ }
934
+ const pluginActionKey = processLink?.pluginActionDefinitionKey;
935
+ const pluginActionTranslation = pluginTranslationService.instantByPluginActionKey(pluginActionKey);
936
+ const pluginTitleTranslation = pluginTranslationService.instantPluginTitleByPluginActionKey(pluginActionKey);
937
+ if (pluginActionKey) {
938
+ return html `<div class="process-link-properties-panel">
939
+ <div class="process-link-properties-panel__header">
940
+ <span class="process-link-properties-panel__title-container">
941
+ <span class="process-link-properties-panel__title">${pluginTitleTranslation}</span>
942
+
943
+ <span class="process-link-properties-panel__title">${pluginActionTranslation}</span>
944
+ </span>
945
+
946
+ <cds-tag
947
+ class="cds--tag cds--tag--purple cds--tag--md cds--layout--size-md cds-tag--no-margin"
948
+ ><span class="cds--tag__label">
949
+ ${translateService.instant('processLinkType.plugin')}
950
+ </span>
951
+ </cds-tag>
952
+ </div>
953
+
954
+ <div class="process-link-properties-panel__buttons">
955
+ <button
956
+ class="cds--btn cds--btn--danger cds--btn--sm cds--layout--side-md"
957
+ onClick=${handleUnlinkClick}
958
+ >
959
+ ${unlinkText}
960
+ </button>
961
+
962
+ <button
963
+ class="cds--btn cds--btn--primary cds--btn--sm cds--layout--size-md"
964
+ onClick=${handleEditClick}
965
+ >
966
+ ${editProcessLinkText}
967
+ </button>
968
+ </div>
969
+ </div>`;
970
+ }
971
+ const uiComponentKey = processLink?.componentKey;
972
+ if (uiComponentKey) {
973
+ return html `<div class="process-link-properties-panel">
974
+ <div class="process-link-properties-panel__header">
975
+ <span class="process-link-properties-panel__title">${uiComponentKey}</span>
976
+
977
+ <cds-tag
978
+ class="cds--tag cds--tag--magenta cds--tag--md cds--layout--size-md cds-tag--no-margin"
979
+ ><span class="cds--tag__label">
980
+ ${translateService.instant('processLinkType.ui-component')}
981
+ </span>
982
+ </cds-tag>
983
+ </div>
984
+
985
+ <div class="process-link-properties-panel__buttons">
986
+ <button
987
+ class="cds--btn cds--btn--danger cds--btn--sm cds--layout--side-md"
988
+ onClick=${handleUnlinkClick}
989
+ >
990
+ ${unlinkText}
991
+ </button>
992
+
993
+ <button
994
+ class="cds--btn cds--btn--primary cds--btn--sm cds--layout--size-md"
995
+ onClick=${handleEditClick}
996
+ >
997
+ ${editProcessLinkText}
998
+ </button>
999
+ </div>
1000
+ </div>`;
1001
+ }
1002
+ const genericLinkedPanel = html `<div class="process-link-properties-panel">
1003
+ <div class="process-link-properties-panel__buttons">
1004
+ <button
1005
+ class="cds--btn cds--btn--danger cds--btn--sm cds--layout--side-md"
1006
+ onClick=${handleUnlinkClick}
1007
+ >
1008
+ ${unlinkText}
1009
+ </button>
1010
+
1011
+ <button
1012
+ class="cds--btn cds--btn--primary cds--btn--sm cds--layout--size-md"
1013
+ onClick=${handleEditClick}
1014
+ >
1015
+ ${editProcessLinkText}
1016
+ </button>
1017
+ </div>
1018
+ </div>`;
1019
+ const genericCreatePanel = html `<div class="process-link-properties-panel">
1020
+ <div class="process-link-properties-panel__buttons">
1021
+ <button
1022
+ class="cds--btn cds--btn--primary cds--btn--sm cds--layout--size-md"
1023
+ onClick=${handleCreateClick}
1024
+ >
1025
+ ${createText}
1026
+ </button>
1027
+ </div>
1028
+ </div>`;
1029
+ return processLink ? genericLinkedPanel : genericCreatePanel;
1030
+ };
1031
+ const ValtimoPropertiesProviderModule = {
1032
+ __init__: ['customPropertiesProvider'],
1033
+ customPropertiesProvider: ['type', ValtimoPropertiesProvider],
1034
+ };
1035
+
1036
+ /*
1037
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1038
+ *
1039
+ * Licensed under EUPL, Version 1.2 (the "License");
1040
+ * you may not use this file except in compliance with the License.
1041
+ * You may obtain a copy of the License at
1042
+ *
1043
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1044
+ *
1045
+ * Unless required by applicable law or agreed to in writing, software
1046
+ * distributed under the License is distributed on an "AS IS" basis,
1047
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1048
+ * See the License for the specific language governing permissions and
1049
+ * limitations under the License.
1050
+ */
1051
+
1052
+ /*
1053
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1054
+ *
1055
+ * Licensed under EUPL, Version 1.2 (the "License");
1056
+ * you may not use this file except in compliance with the License.
1057
+ * You may obtain a copy of the License at
1058
+ *
1059
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1060
+ *
1061
+ * Unless required by applicable law or agreed to in writing, software
1062
+ * distributed under the License is distributed on an "AS IS" basis,
1063
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1064
+ * See the License for the specific language governing permissions and
1065
+ * limitations under the License.
1066
+ */
1067
+ class ProcessManagementBuilderComponent {
1068
+ constructor(breadcrumbService, iconService, logger, modalService, notificationService, pageHeaderService, pageTitleService, processLinkService, processLinkStateService, processManagementEditorService, processManagementService, processService, route, router, translateService, pluginTranslationService, editPermissionsService, processLinkBuildingBlockApiService) {
1069
+ this.breadcrumbService = breadcrumbService;
1070
+ this.iconService = iconService;
1071
+ this.logger = logger;
1072
+ this.modalService = modalService;
1073
+ this.notificationService = notificationService;
1074
+ this.pageHeaderService = pageHeaderService;
1075
+ this.pageTitleService = pageTitleService;
1076
+ this.processLinkService = processLinkService;
1077
+ this.processLinkStateService = processLinkStateService;
1078
+ this.processManagementEditorService = processManagementEditorService;
1079
+ this.processManagementService = processManagementService;
1080
+ this.processService = processService;
1081
+ this.route = route;
1082
+ this.router = router;
1083
+ this.translateService = translateService;
1084
+ this.pluginTranslationService = pluginTranslationService;
1085
+ this.editPermissionsService = editPermissionsService;
1086
+ this.processLinkBuildingBlockApiService = processLinkBuildingBlockApiService;
1087
+ this._selectedProcess$ = new BehaviorSubject(null);
1088
+ this.loading$ = new BehaviorSubject(true);
1089
+ this.isReadOnlyProcess$ = new BehaviorSubject(false);
1090
+ this.isSystemProcess$ = new BehaviorSubject(false);
1091
+ this.canInitializeDocument$ = new BehaviorSubject(false);
1092
+ this.startableByUser$ = new BehaviorSubject(false);
1093
+ this.testIds = PROCESS_MANAGEMENT_BUILDER_TEST_IDS;
1094
+ this.selectedProcessDefinitionXml$ = this.processManagementEditorService.selectionProcessDefinition$.pipe(filter(selectedProcessDefinition => !!selectedProcessDefinition?.id), distinctUntilChanged((previous, current) => isEqual(previous, current)), tap(selectedProcessDefinition => {
1095
+ this.loading$.next(true);
1096
+ this.pageTitleService.setCustomPageTitle(selectedProcessDefinition?.name || '-');
1097
+ }), switchMap(selectedProcessDefinition => this.processService.getProcessDefinitionXml(selectedProcessDefinition.id)), tap(result => {
1098
+ this.cleanUpListenersOnModeler();
1099
+ this._bpmnModeler?.importXML(result.bpmn20Xml);
1100
+ this._bpmnViewer?.importXML(result.bpmn20Xml);
1101
+ this.isReadOnlyProcess$.next(result.readOnly);
1102
+ this.isSystemProcess$.next(result.systemProcess);
1103
+ this.loading$.next(false);
1104
+ }));
1105
+ this.changesPending$ = new BehaviorSubject(false);
1106
+ this.editParam$ = this.route.url.pipe(map$1(segments => {
1107
+ const lastSegment = segments[segments.length - 1]?.path;
1108
+ if (lastSegment === 'create') {
1109
+ return 'create';
1110
+ }
1111
+ const param = this.route.snapshot.paramMap.get('processDefinitionKey');
1112
+ const idParam = this.route.snapshot.paramMap.get('processDefinitionId');
1113
+ return param || idParam || null;
1114
+ }), filter(editParam => !!editParam));
1115
+ this.context$ = getContextObservable(this.route);
1116
+ this.managementParams$ = this.context$.pipe(filter(context => context === 'case' || context === 'buildingBlock'), switchMap(context => context === 'case'
1117
+ ? getCaseManagementRouteParams(this.route)
1118
+ : getBuildingBlockManagementRouteParams(this.route)));
1119
+ this.hasEditPermissions$ = this.context$.pipe(switchMap(context => {
1120
+ if (context === 'independent') {
1121
+ return of(true);
1122
+ }
1123
+ return this.managementParams$.pipe(switchMap(params => this.editPermissionsService.hasPermissionsToEditBasedOnContext(params, context)));
1124
+ }));
1125
+ this._reload$ = new Subject();
1126
+ this.processDefinitionVersions$ = combineLatest([this.editParam$, this.context$, this._reload$.pipe(startWith(null))]).pipe(switchMap(([editParam, context]) => context === 'independent'
1127
+ ? this.processManagementService.getUnlinkedProcessDefinitionsByKey(editParam)
1128
+ : of([])), map$1(result => result.map(resultItem => resultItem.processDefinition)), tap(processDefinitions => {
1129
+ this.changesPending$.next(false);
1130
+ this.setSelectedProcessDefinitionToLatest(processDefinitions);
1131
+ }));
1132
+ this.processDefinitionVersionsListItems$ = combineLatest([
1133
+ this.processDefinitionVersions$,
1134
+ this.processManagementEditorService.selectionProcessDefinition$,
1135
+ this.translateService.stream('key'),
1136
+ ]).pipe(map$1(([processDefinitionVersions, selectionProcessDefinition]) => processDefinitionVersions
1137
+ .map(processDefinitionVersion => ({
1138
+ id: processDefinitionVersion.version,
1139
+ content: `${this.translateService.instant('processManagement.version')}${processDefinitionVersion.version}`,
1140
+ selected: selectionProcessDefinition.version === processDefinitionVersion.version,
1141
+ processDefinitionVersion,
1142
+ }))
1143
+ .sort((a, b) => b.id - a.id)));
1144
+ this.compactMode$ = this.pageHeaderService.compactMode$;
1145
+ this.creatingNewProcess$ = new BehaviorSubject(false);
1146
+ this.$spaceAdjustment = computed(() => this.processManagementService.$context() === 'case' ? 0 : 0);
1147
+ this.updatingProcessDefinitionCaseDefinition$ = new BehaviorSubject(false);
1148
+ this._subscriptions = new Subscription();
1149
+ this.shapeAddedHandler = (event) => {
1150
+ this.logger.debug('Shape added:', event);
1151
+ };
1152
+ this.shapeRemovedHandler = (event) => {
1153
+ this.logger.debug('Shape removed:', event);
1154
+ const activityId = event?.element?.id;
1155
+ if (!activityId)
1156
+ return;
1157
+ this.processManagementEditorService.deleteProcessLink({ activityId });
1158
+ };
1159
+ this.elementChangedHandler = (event) => {
1160
+ this.logger.debug('Element changed:', event);
1161
+ const activityId = event?.element?.di?.id;
1162
+ const businessId = event?.element?.id;
1163
+ if (!activityId || !businessId)
1164
+ return;
1165
+ this.processManagementEditorService.updateProcessLinksOnIdChange(activityId, businessId);
1166
+ };
1167
+ this.setProcessManagementWindow();
1168
+ }
1169
+ ngAfterViewInit() {
1170
+ this.pageTitleService.disableReset();
1171
+ this.openParamsAndContextSubscription();
1172
+ this.initModeler();
1173
+ this.initViewer();
1174
+ this.subscribeToOpenProcessLinkModalEvents();
1175
+ this.subscribeToProcessLinkUpdateEvents();
1176
+ this.subscribeToProcessLinkCreateEvents();
1177
+ this.subscribeToProcessLinkDeleteEvents();
1178
+ this.initEditing();
1179
+ }
1180
+ ngOnDestroy() {
1181
+ this._bpmnModeler?.destroy();
1182
+ this._bpmnViewer?.destroy();
1183
+ this._subscriptions.unsubscribe();
1184
+ this.pageTitleService.enableReset();
1185
+ this.pageTitleService.clearPageActionsViewContainerRef();
1186
+ this.breadcrumbService.clearThirdBreadcrumb();
1187
+ this.breadcrumbService.clearFourthBreadcrumb();
1188
+ }
1189
+ export(isReadOnlyProcess) {
1190
+ (isReadOnlyProcess ? from(this._bpmnViewer.saveXML()) : from(this._bpmnModeler.saveXML()))
1191
+ .pipe(take(1))
1192
+ .subscribe(result => {
1193
+ const file = new Blob([result.xml ?? ''], { type: 'text/xml' });
1194
+ const link = document.createElement('a');
1195
+ link.download = 'diagram.bpmn';
1196
+ link.href = window.URL.createObjectURL(file);
1197
+ link.click();
1198
+ window.URL.revokeObjectURL(link.href);
1199
+ link.remove();
1200
+ });
1201
+ }
1202
+ deployChanges(isReadOnlyProcess) {
1203
+ combineLatest([
1204
+ from(isReadOnlyProcess ? this._bpmnViewer.saveXML() : this._bpmnModeler.saveXML()),
1205
+ this.processManagementEditorService.processLinksForSelectedDefinition$,
1206
+ this.processManagementEditorService.selectionProcessDefinition$,
1207
+ this.context$,
1208
+ this.managementParams$.pipe(startWith(null)),
1209
+ ])
1210
+ .pipe(take(1), switchMap(([result, processLinks, selectedProcessDefinition, context, params]) => {
1211
+ if (context === 'case') {
1212
+ const caseManagementParams = params;
1213
+ return this.processLinkService.deployProcessWithProcessLinksForCase(processLinks, selectedProcessDefinition.id, !isReadOnlyProcess ? (result?.xml ?? '') : null, caseManagementParams?.caseDefinitionKey ?? '', caseManagementParams?.caseDefinitionVersionTag ?? '', this.canInitializeDocument$.getValue(), this.startableByUser$.getValue());
1214
+ }
1215
+ if (context === 'buildingBlock') {
1216
+ const buildingBlockManagementParams = params;
1217
+ return this.processLinkService.deployProcessWithProcessLinksForBuildingBlock(processLinks, selectedProcessDefinition.id, result?.xml, buildingBlockManagementParams.buildingBlockDefinitionKey, buildingBlockManagementParams.buildingBlockDefinitionVersionTag);
1218
+ }
1219
+ return this.processLinkService.deployProcessWithProcessLinks(processLinks, selectedProcessDefinition.id, !isReadOnlyProcess ? (result?.xml ?? '') : null);
1220
+ }), switchMap(() => this.context$))
1221
+ .subscribe({
1222
+ next: context => {
1223
+ if (context === 'independent') {
1224
+ this.reload();
1225
+ this.showNotification('success');
1226
+ }
1227
+ else {
1228
+ this.navigateBack('success');
1229
+ }
1230
+ },
1231
+ error: () => {
1232
+ this.showNotification('error');
1233
+ },
1234
+ });
1235
+ }
1236
+ deployNewProcessDefinition() {
1237
+ combineLatest([
1238
+ from(this._bpmnModeler.saveXML()),
1239
+ this.processManagementEditorService.processLinksForSelectedDefinition$,
1240
+ this.context$,
1241
+ this.managementParams$.pipe(startWith(null)),
1242
+ ])
1243
+ .pipe(take(1), switchMap(([result, processLinks, context, params]) => {
1244
+ const mappedProcessLinks = processLinks.map(link => ({
1245
+ ...link,
1246
+ processDefinitionId: '-',
1247
+ }));
1248
+ switch (context) {
1249
+ case 'independent':
1250
+ return this.processLinkService.deployProcessWithProcessLinks(mappedProcessLinks, null, result.xml ?? '');
1251
+ case 'buildingBlock':
1252
+ const buildingBlockParams = params;
1253
+ return this.processLinkService.deployProcessWithProcessLinksForBuildingBlock(mappedProcessLinks, null, result.xml ?? '', buildingBlockParams.buildingBlockDefinitionKey, buildingBlockParams.buildingBlockDefinitionVersionTag);
1254
+ case 'case':
1255
+ const caseManagementParams = params;
1256
+ return this.processLinkService.deployProcessWithProcessLinksForCase(mappedProcessLinks, null, result.xml ?? '', caseManagementParams.caseDefinitionKey, caseManagementParams.caseDefinitionVersionTag, this.canInitializeDocument$.getValue(), this.startableByUser$.getValue());
1257
+ }
1258
+ }))
1259
+ .subscribe({
1260
+ next: () => {
1261
+ this.navigateBack('success');
1262
+ },
1263
+ error: () => {
1264
+ this.showNotification('error');
1265
+ },
1266
+ });
1267
+ }
1268
+ selectedVersionChange(event) {
1269
+ this.processManagementEditorService.selectionProcessDefinition$
1270
+ .pipe(take(1))
1271
+ .subscribe(selectedVersion => {
1272
+ if (selectedVersion.id !== event.item.processDefinitionVersion.id) {
1273
+ this.processManagementEditorService.setSelectedProcessDefinition(event?.item?.processDefinitionVersion);
1274
+ this.changesPending$.next(false);
1275
+ }
1276
+ });
1277
+ }
1278
+ navigateBack(notification) {
1279
+ this.router.navigate(['../'], { relativeTo: this.route });
1280
+ if (!notification)
1281
+ return;
1282
+ this.showNotification(notification);
1283
+ }
1284
+ onProcessToggleChange(field, value) {
1285
+ if (field === 'canInitializeDocument')
1286
+ this.canInitializeDocument$.next(value);
1287
+ if (field === 'startableByUser')
1288
+ this.startableByUser$.next(value);
1289
+ this.changesPending$.next(true);
1290
+ }
1291
+ setProcessManagementWindow() {
1292
+ const processManagementWindow = window;
1293
+ if (!processManagementWindow)
1294
+ return;
1295
+ processManagementWindow.processManagementEditorService = this.processManagementEditorService;
1296
+ processManagementWindow.translateService = this.translateService;
1297
+ processManagementWindow.pluginTranslationService = this.pluginTranslationService;
1298
+ }
1299
+ showNotification(notification) {
1300
+ this.notificationService.showToast({
1301
+ caption: this.translateService.instant(`processManagement.${notification}Notification`),
1302
+ type: notification,
1303
+ title: this.translateService.instant(`interface.${notification}`),
1304
+ });
1305
+ }
1306
+ setSelectedProcessDefinitionToLatest(processDefinitions) {
1307
+ const latest = getLatestProcessDefinition(processDefinitions);
1308
+ if (!latest)
1309
+ return;
1310
+ this.processManagementEditorService.setSelectedProcessDefinition(latest);
1311
+ }
1312
+ initModeler() {
1313
+ this._bpmnModeler = new Modeler({
1314
+ additionalModules: [
1315
+ BpmnPropertiesPanelModule,
1316
+ BpmnPropertiesProviderModule,
1317
+ CamundaPlatformPropertiesProviderModule,
1318
+ camundaPlatformBehaviors,
1319
+ ValtimoPropertiesProviderModule,
1320
+ ],
1321
+ moddleExtensions: { camunda: CamundaBpmnModdle },
1322
+ propertiesPanel: { parent: this.modelerPanelElementRef.nativeElement },
1323
+ });
1324
+ this._bpmnModeler?.attachTo(this.modelerElementRef.nativeElement);
1325
+ this._bpmnModeler.on('commandStack.changed', () => {
1326
+ this.changesPending$.next(true);
1327
+ });
1328
+ this._bpmnModeler.on('import.done', () => {
1329
+ const idMap = {};
1330
+ const elementRegistry = this._bpmnModeler.get('elementRegistry');
1331
+ elementRegistry.forEach((element) => {
1332
+ const activityId = element?.di?.id;
1333
+ const businessId = element?.id;
1334
+ if (!activityId || !businessId)
1335
+ return;
1336
+ idMap[activityId] = businessId;
1337
+ });
1338
+ this.processManagementEditorService.setActivityIdBusinessIdMap(idMap);
1339
+ this.listenToActivityChangesOnModeler();
1340
+ });
1341
+ }
1342
+ initViewer() {
1343
+ this._bpmnViewer = new Modeler({
1344
+ additionalModules: [
1345
+ DisableBpmnWriteModule,
1346
+ BpmnPropertiesPanelModule,
1347
+ ValtimoPropertiesProviderModule,
1348
+ ],
1349
+ moddleExtensions: { camunda: CamundaBpmnModdle },
1350
+ propertiesPanel: { parent: this.viewerPanelElementRef.nativeElement },
1351
+ });
1352
+ this._bpmnViewer?.attachTo(this.viewerElementRef.nativeElement);
1353
+ this._bpmnViewer.on('commandStack.changed', () => {
1354
+ this.changesPending$.next(true);
1355
+ });
1356
+ this._bpmnViewer.on('import.done', () => {
1357
+ disableCommands(this._bpmnViewer);
1358
+ });
1359
+ }
1360
+ reload() {
1361
+ this._reload$.next(null);
1362
+ }
1363
+ handleUpdateEvent(event) {
1364
+ this.modalService.setModalData(event?.modalParams);
1365
+ this.processLinkStateService.setModalParams(event?.modalParams);
1366
+ this.processLinkStateService.setElementName(event?.modalParams?.element?.name ?? '');
1367
+ this.processLinkStateService.selectProcessLink(event.processLink);
1368
+ this.processLinkStateService.showModal();
1369
+ }
1370
+ handleCreateEvent(event) {
1371
+ this.processLinkService
1372
+ .getProcessLinkCandidates(event.modalParams.element.activityListenerType ?? '')
1373
+ .subscribe(candidates => {
1374
+ this.modalService.setModalData(event?.modalParams);
1375
+ this.processLinkStateService.setModalParams(event?.modalParams);
1376
+ this.processLinkStateService.setElementName(event?.modalParams?.element?.name ?? '');
1377
+ this.processLinkStateService.setAvailableProcessLinkTypes(candidates);
1378
+ this.processLinkStateService.showModal();
1379
+ });
1380
+ }
1381
+ subscribeToOpenProcessLinkModalEvents() {
1382
+ this._subscriptions.add(this.processManagementEditorService.openProcessLinkModalEvents$.subscribe(event => {
1383
+ if (event.processLink) {
1384
+ this.handleUpdateEvent(event);
1385
+ }
1386
+ else {
1387
+ this.handleCreateEvent(event);
1388
+ }
1389
+ }));
1390
+ }
1391
+ subscribeToProcessLinkUpdateEvents() {
1392
+ this._subscriptions.add(this.processLinkStateService.processLinkUpdateEvents$.subscribe(event => {
1393
+ this.processManagementEditorService.updateProcessLink(event);
1394
+ this.processLinkStateService.stopSaving();
1395
+ this.processLinkStateService.closeModal();
1396
+ const buildingBlockProcessLinkUpdateDto = event;
1397
+ if (buildingBlockProcessLinkUpdateDto.buildingBlockDefinitionKey &&
1398
+ buildingBlockProcessLinkUpdateDto.buildingBlockDefinitionVersionTag) {
1399
+ this.setCalledElementForBuildingBlockProcessLink(buildingBlockProcessLinkUpdateDto.activityId, buildingBlockProcessLinkUpdateDto.buildingBlockDefinitionKey, buildingBlockProcessLinkUpdateDto.buildingBlockDefinitionVersionTag);
1400
+ }
1401
+ }));
1402
+ }
1403
+ subscribeToProcessLinkCreateEvents() {
1404
+ this._subscriptions.add(this.processLinkStateService.processLinkCreateEvents$.subscribe(event => {
1405
+ this.processManagementEditorService.createProcessLink(event);
1406
+ this.processLinkStateService.stopSaving();
1407
+ this.processLinkStateService.closeModal();
1408
+ const buildingBlockProcessLinkCreateDto = event;
1409
+ if (buildingBlockProcessLinkCreateDto.buildingBlockDefinitionKey &&
1410
+ buildingBlockProcessLinkCreateDto.buildingBlockDefinitionVersionTag) {
1411
+ this.setCalledElementForBuildingBlockProcessLink(buildingBlockProcessLinkCreateDto.activityId, buildingBlockProcessLinkCreateDto.buildingBlockDefinitionKey, buildingBlockProcessLinkCreateDto.buildingBlockDefinitionVersionTag);
1412
+ }
1413
+ }));
1414
+ }
1415
+ subscribeToProcessLinkDeleteEvents() {
1416
+ this._subscriptions.add(merge(this.processManagementEditorService.deleteProcessLinkEvents$, this.processLinkStateService.processLinkDeleteEvents$).subscribe(event => {
1417
+ this.processManagementEditorService.deleteProcessLink(event);
1418
+ this.processLinkStateService.stopSaving();
1419
+ this.processLinkStateService.closeModal();
1420
+ this.unsetCalledElementForBuildingBlockProcessLink(event.activityId);
1421
+ }));
1422
+ }
1423
+ initIfCreate() {
1424
+ if (this._selectedProcess$.getValue() !== 'create')
1425
+ return;
1426
+ this.creatingNewProcess$.next(true);
1427
+ this._bpmnModeler?.importXML(EMPTY_BPMN);
1428
+ this.isReadOnlyProcess$.next(false);
1429
+ this.isSystemProcess$.next(false);
1430
+ this.loading$.next(false);
1431
+ }
1432
+ listenToActivityChangesOnModeler() {
1433
+ const eventBus = this._bpmnModeler.get('eventBus');
1434
+ if (!eventBus)
1435
+ return;
1436
+ eventBus.on('shape.added', this.shapeAddedHandler);
1437
+ eventBus.on('shape.removed', this.shapeRemovedHandler);
1438
+ eventBus.on('element.changed', this.elementChangedHandler);
1439
+ }
1440
+ cleanUpListenersOnModeler() {
1441
+ const eventBus = this._bpmnModeler.get('eventBus');
1442
+ if (!eventBus)
1443
+ return;
1444
+ eventBus.off('shape.added', this.shapeAddedHandler);
1445
+ eventBus.off('shape.removed', this.shapeRemovedHandler);
1446
+ eventBus.off('element.changed', this.elementChangedHandler);
1447
+ }
1448
+ initProcessDefinition() {
1449
+ this._subscriptions.add(this._selectedProcess$
1450
+ .pipe(filter(selectedProcess => selectedProcess !== null && selectedProcess !== 'create'), distinctUntilChanged((previous, current) => isEqual(previous, current)), tap(() => this.loading$.next(true)))
1451
+ .subscribe(result => {
1452
+ const processDefinitionResult = result;
1453
+ this.cleanUpListenersOnModeler();
1454
+ this._bpmnModeler?.importXML(processDefinitionResult.bpmn20Xml);
1455
+ this._bpmnViewer?.importXML(processDefinitionResult.bpmn20Xml);
1456
+ this.canInitializeDocument$.next(!!processDefinitionResult?.processCaseLink?.canInitializeDocument);
1457
+ this.startableByUser$.next(!!processDefinitionResult?.processCaseLink?.startableByUser);
1458
+ this.loading$.next(false);
1459
+ }));
1460
+ }
1461
+ openParamsAndContextSubscription() {
1462
+ this._subscriptions.add(combineLatest([
1463
+ getContextObservable(this.route),
1464
+ getCaseManagementRouteParams(this.route),
1465
+ getBuildingBlockManagementRouteParams(this.route),
1466
+ ]).subscribe(([context, caseManagementParams, buildingBlockManagementParams]) => {
1467
+ if (context)
1468
+ this.processManagementService.context = context;
1469
+ this.processLinkStateService.setContext(context);
1470
+ if (caseManagementParams) {
1471
+ this.processManagementService.setParams(caseManagementParams.caseDefinitionKey, caseManagementParams.caseDefinitionVersionTag);
1472
+ }
1473
+ if (buildingBlockManagementParams) {
1474
+ this.processManagementService.setParams(buildingBlockManagementParams.buildingBlockDefinitionKey, buildingBlockManagementParams.buildingBlockDefinitionVersionTag);
1475
+ }
1476
+ initBreadcrumbsForContext(this.breadcrumbService, this.translateService, caseManagementParams || buildingBlockManagementParams, context);
1477
+ this.processManagementEditorService.setManagementRouteParams(context, caseManagementParams || buildingBlockManagementParams);
1478
+ }));
1479
+ }
1480
+ initEditing() {
1481
+ combineLatest([this.editParam$, this.managementParams$.pipe(startWith(null)), this.context$])
1482
+ .pipe(take(1), switchMap(([editParam, params, context]) => {
1483
+ if (editParam === 'create') {
1484
+ this._selectedProcess$.next('create');
1485
+ this.initIfCreate();
1486
+ return of(null);
1487
+ }
1488
+ switch (context) {
1489
+ case 'case':
1490
+ const caseManagementParams = params;
1491
+ return this.processManagementService.getProcessDefinitionForCase(caseManagementParams.caseDefinitionKey, caseManagementParams.caseDefinitionVersionTag, editParam);
1492
+ case 'independent':
1493
+ return this.processManagementService
1494
+ .getUnlinkedProcessDefinitionsByKey(editParam)
1495
+ .pipe(map$1(processDefinitionResults => processDefinitionResults[0]));
1496
+ case 'buildingBlock':
1497
+ const buildingBlockParams = params;
1498
+ return this.processManagementService.getBuildingBlockProcessDefinition(buildingBlockParams.buildingBlockDefinitionKey, buildingBlockParams.buildingBlockDefinitionVersionTag, editParam);
1499
+ }
1500
+ }), tap(res => {
1501
+ if (res) {
1502
+ this._selectedProcess$.next(res);
1503
+ this.processManagementEditorService.setSelectedProcessDefinition(res.processDefinition);
1504
+ this.processManagementEditorService.setProcessLinksForSelectedDefinition(res.processLinks);
1505
+ this.pageTitleService.setCustomPageTitle(res.processDefinition.name || '-');
1506
+ }
1507
+ this.initProcessDefinition();
1508
+ }))
1509
+ .subscribe();
1510
+ }
1511
+ setCalledElementForBuildingBlockProcessLink(activityId, buildingBlockDefinitionKey, buildingBlockDefinitionVersionTag) {
1512
+ const editor = this._bpmnModeler || this._bpmnViewer;
1513
+ if (!editor) {
1514
+ return;
1515
+ }
1516
+ this.processLinkBuildingBlockApiService
1517
+ .getMainProcessDefinitionKeyForBuildingBlock(buildingBlockDefinitionKey, buildingBlockDefinitionVersionTag)
1518
+ .subscribe({
1519
+ next: (mainProcessDefinitionKey) => {
1520
+ const versionTag = `BB:${buildingBlockDefinitionKey}:${buildingBlockDefinitionVersionTag}`;
1521
+ applyBuildingBlockCalledElement(editor, activityId, mainProcessDefinitionKey, versionTag);
1522
+ },
1523
+ });
1524
+ }
1525
+ unsetCalledElementForBuildingBlockProcessLink(activityId) {
1526
+ const editor = this._bpmnModeler || this._bpmnViewer;
1527
+ if (!editor) {
1528
+ return;
1529
+ }
1530
+ clearBuildingBlockCalledElement(editor, activityId);
1531
+ }
1532
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", 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 }, { token: i5.ProcessLinkBuildingBlockApiService }], target: i0.ɵɵFactoryTarget.Component }); }
1533
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: ProcessManagementBuilderComponent, isStandalone: true, selector: "valtimo-process-management-builder", providers: [
1534
+ ProcessManagementEditorService,
1535
+ ProcessLinkStateService,
1536
+ ProcessLinkStepService,
1537
+ ProcessLinkButtonService,
1538
+ ], 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 }], 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 [attr.data-test-id]=\"testIds.startsCaseToggle\"\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 [attr.data-test-id]=\"testIds.startableByUserToggle\"\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 [attr.data-test-id]=\"testIds.deployButton\"\n >\n {{ 'processManagement.deploy' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"deploy\" size=\"16\"></svg>\n </button>\n\n <v-overflow-menu class=\"overflow-button\" placement=\"bottom-end\">\n <v-overflow-menu-trigger overflowTrigger></v-overflow-menu-trigger>\n <v-overflow-menu-option\n [disabled]=\"actionsObs.loading\"\n (selected)=\"export(actionsObs.isReadOnlyProcess)\"\n >{{ 'interface.export' | translate }}\n </v-overflow-menu-option>\n </v-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", "fitPageDisabled", "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: "component", type: OverflowMenuComponent, selector: "v-overflow-menu", inputs: ["open", "placement", "menuWidth", "offsetX", "offsetY", "closeOnSelect", "useHostAsReference", "portalToBody"], outputs: ["openChange"] }, { kind: "component", type: OverflowMenuOptionComponent, selector: "v-overflow-menu-option", inputs: ["disabled", "type", "testId", "optionId"], outputs: ["selected"] }, { kind: "component", type: OverflowMenuTriggerComponent, selector: "v-overflow-menu-trigger", inputs: ["compact"] }, { 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"] }] }); }
1539
+ }
1540
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementBuilderComponent, decorators: [{
1541
+ type: Component,
1542
+ args: [{ selector: 'valtimo-process-management-builder', standalone: true, imports: [
1543
+ CommonModule,
1544
+ FitPageDirective,
1545
+ LoadingModule,
1546
+ RenderInPageHeaderDirective,
1547
+ DropdownModule,
1548
+ ReactiveFormsModule,
1549
+ SelectModule,
1550
+ ButtonModule,
1551
+ IconModule,
1552
+ TranslateModule,
1553
+ TagModule,
1554
+ ProcessLinkModule,
1555
+ ProcessLinkModule,
1556
+ OverflowMenuComponent,
1557
+ OverflowMenuOptionComponent,
1558
+ OverflowMenuTriggerComponent,
1559
+ ToggleModule,
1560
+ TooltipModule,
1561
+ ], providers: [
1562
+ ProcessManagementEditorService,
1563
+ ProcessLinkStateService,
1564
+ ProcessLinkStepService,
1565
+ ProcessLinkButtonService,
1566
+ ], 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 [attr.data-test-id]=\"testIds.startsCaseToggle\"\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 [attr.data-test-id]=\"testIds.startableByUserToggle\"\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 [attr.data-test-id]=\"testIds.deployButton\"\n >\n {{ 'processManagement.deploy' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"deploy\" size=\"16\"></svg>\n </button>\n\n <v-overflow-menu class=\"overflow-button\" placement=\"bottom-end\">\n <v-overflow-menu-trigger overflowTrigger></v-overflow-menu-trigger>\n <v-overflow-menu-option\n [disabled]=\"actionsObs.loading\"\n (selected)=\"export(actionsObs.isReadOnlyProcess)\"\n >{{ 'interface.export' | translate }}\n </v-overflow-menu-option>\n </v-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"] }]
1567
+ }], 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 }, { type: i5.ProcessLinkBuildingBlockApiService }], propDecorators: { modelerElementRef: [{
1568
+ type: ViewChild,
1569
+ args: ['modeler', { static: false }]
1570
+ }], modelerPanelElementRef: [{
1571
+ type: ViewChild,
1572
+ args: ['modelerPanel', { static: false }]
1573
+ }], viewerElementRef: [{
1574
+ type: ViewChild,
1575
+ args: ['viewer', { static: false }]
1576
+ }], viewerPanelElementRef: [{
1577
+ type: ViewChild,
1578
+ args: ['viewerPanel', { static: false }]
1579
+ }] } });
1580
+
1581
+ /*
1582
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1583
+ *
1584
+ * Licensed under EUPL, Version 1.2 (the "License");
1585
+ * you may not use this file except in compliance with the License.
1586
+ * You may obtain a copy of the License at
1587
+ *
1588
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1589
+ *
1590
+ * Unless required by applicable law or agreed to in writing, software
1591
+ * distributed under the License is distributed on an "AS IS" basis,
1592
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1593
+ * See the License for the specific language governing permissions and
1594
+ * limitations under the License.
1595
+ */
1596
+ class ProcessManagementListComponent {
1597
+ constructor(iconService, notificationService, processManagementService, processManagementStateService, translateService, environmentService, route, editPermissionsService) {
1598
+ this.iconService = iconService;
1599
+ this.notificationService = notificationService;
1600
+ this.processManagementService = processManagementService;
1601
+ this.processManagementStateService = processManagementStateService;
1602
+ this.translateService = translateService;
1603
+ this.environmentService = environmentService;
1604
+ this.route = route;
1605
+ this.editPermissionsService = editPermissionsService;
1606
+ this.processSelected = new EventEmitter();
1607
+ this.$context = this.processManagementService.$context;
1608
+ this.processToDelete$ = new BehaviorSubject(null);
1609
+ this.showDeleteModal$ = new BehaviorSubject(false);
1610
+ this.loading$ = new BehaviorSubject(true);
1611
+ this.testIds = PROCESS_MANAGEMENT_LIST_TEST_IDS;
1612
+ this.ACTION_ITEMS = [
1613
+ { label: 'Delete', callback: this.onDeleteProcess.bind(this), type: 'danger' },
1614
+ ];
1615
+ this.context$ = getContextObservable(this.route);
1616
+ this.processDefinitions$ = this.processManagementStateService.reloadDefinitions$.pipe(tap(() => this.loading$.next(true)), switchMap(() => this.processManagementService.processes$), tap(() => this.loading$.next(false)));
1617
+ this.hasEditPermissions$ = combineLatest([
1618
+ getCaseManagementRouteParams(this.route),
1619
+ this.context$,
1620
+ ]).pipe(switchMap(([params, context]) => {
1621
+ return this.editPermissionsService.hasPermissionsToEditBasedOnContext(params, context);
1622
+ }));
1623
+ this.FIELDS = [
1624
+ { key: 'processDefinition.name', label: 'processManagement.name' },
1625
+ { key: 'processDefinition.key', label: 'processManagement.key' },
1626
+ {
1627
+ key: 'processDefinition.readOnly',
1628
+ label: 'processManagement.readOnly',
1629
+ viewType: ViewType.BOOLEAN,
1630
+ },
1631
+ ...(this.processManagementService.$context() === 'case'
1632
+ ? [
1633
+ {
1634
+ key: 'processCaseLink.canInitializeDocument',
1635
+ label: 'processManagement.canInitializeDocument',
1636
+ viewType: ViewType.BOOLEAN,
1637
+ },
1638
+ ]
1639
+ : []),
1640
+ ...(this.processManagementService.$context() === 'case'
1641
+ ? [
1642
+ {
1643
+ key: 'processCaseLink.startableByUser',
1644
+ label: 'processManagement.startableByUser',
1645
+ viewType: ViewType.BOOLEAN,
1646
+ },
1647
+ ]
1648
+ : []),
1649
+ ];
1650
+ this.iconService.registerAll([Upload16]);
1651
+ }
1652
+ editProcessDefinition(processDefinition) {
1653
+ this.processSelected.emit(processDefinition);
1654
+ }
1655
+ openModal() {
1656
+ this.processManagementStateService.openModal();
1657
+ }
1658
+ onCreateProcess() {
1659
+ this.processSelected.emit('create');
1660
+ }
1661
+ onDeleteConfirm(processDefinition) {
1662
+ (this.$context() === 'case'
1663
+ ? this.processManagementService.deleteProcess(processDefinition.key)
1664
+ : this.processManagementService.deleteUnlinkedProcess(processDefinition.key)).subscribe(() => {
1665
+ this.processManagementStateService.reloadDefinitions();
1666
+ this.notificationService.showToast({
1667
+ title: this.translateService.instant(`interface.delete`),
1668
+ caption: this.translateService.instant(`processManagement.deleteNotification`),
1669
+ type: 'success',
1670
+ });
1671
+ });
1672
+ }
1673
+ onDeleteProcess(process) {
1674
+ this.processToDelete$.next(process.processDefinition);
1675
+ this.showDeleteModal$.next(true);
1676
+ }
1677
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", 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 }); }
1678
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", 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 [attr.data-test-id]=\"testIds.uploadButton\"\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\" [attr.data-test-id]=\"testIds.createProcessButton\" (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", "skeletonRowCount", "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 }); }
1679
+ }
1680
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementListComponent, decorators: [{
1681
+ type: Component,
1682
+ args: [{ selector: 'valtimo-process-management-list', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1683
+ CommonModule,
1684
+ ButtonModule,
1685
+ CarbonListModule,
1686
+ IconModule,
1687
+ IconModule,
1688
+ TranslateModule,
1689
+ ConfirmationModalModule,
1690
+ ], 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 [attr.data-test-id]=\"testIds.uploadButton\"\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\" [attr.data-test-id]=\"testIds.createProcessButton\" (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"] }]
1691
+ }], 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: [{
1692
+ type: Output
1693
+ }] } });
1694
+
1695
+ /*
1696
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1697
+ *
1698
+ * Licensed under EUPL, Version 1.2 (the "License");
1699
+ * you may not use this file except in compliance with the License.
1700
+ * You may obtain a copy of the License at
1701
+ *
1702
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1703
+ *
1704
+ * Unless required by applicable law or agreed to in writing, software
1705
+ * distributed under the License is distributed on an "AS IS" basis,
1706
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1707
+ * See the License for the specific language governing permissions and
1708
+ * limitations under the License.
1709
+ */
1710
+ class ProcessManagementUploadComponent {
1711
+ constructor(formBuilder, notificationService, processManagementService, processManagementStateService, translateService) {
1712
+ this.formBuilder = formBuilder;
1713
+ this.notificationService = notificationService;
1714
+ this.processManagementService = processManagementService;
1715
+ this.processManagementStateService = processManagementStateService;
1716
+ this.translateService = translateService;
1717
+ this.modalOpen$ = this.processManagementStateService.openModal$;
1718
+ this.ACCEPTED_FILES = ['bpmn'];
1719
+ this.form = this.formBuilder.group({
1720
+ file: this.formBuilder.control(new Set(), [Validators.required]),
1721
+ });
1722
+ this.fileSelected$ = this.form.get('file')?.valueChanges.pipe(startWith(null), map$1(value => !!(value instanceof Set && value.size > 0)));
1723
+ }
1724
+ closeModal() {
1725
+ this.processManagementStateService.closeModal();
1726
+ setTimeout(() => {
1727
+ this.form.reset();
1728
+ }, CARBON_CONSTANTS.modalAnimationMs);
1729
+ }
1730
+ uploadProcessBpmn() {
1731
+ const bpmnFile = this.form.value?.file?.values()?.next()?.value?.file;
1732
+ if (!bpmnFile)
1733
+ return;
1734
+ this.processManagementService.deployBpmn(bpmnFile).subscribe({
1735
+ next: () => {
1736
+ this.notificationService.showNotification({
1737
+ type: 'success',
1738
+ title: this.translateService.instant('processManagement.upload.success'),
1739
+ });
1740
+ this.closeModal();
1741
+ this.processManagementStateService.reloadDefinitions();
1742
+ },
1743
+ error: () => {
1744
+ this.notificationService.showNotification({
1745
+ type: 'error',
1746
+ title: this.translateService.instant('processManagement.upload.failure'),
1747
+ });
1748
+ },
1749
+ });
1750
+ }
1751
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementUploadComponent, deps: [{ token: i1$2.FormBuilder }, { token: i2$1.GlobalNotificationService }, { token: ProcessManagementService }, { token: ProcessManagementStateService }, { token: i4.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
1752
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", 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=\"secondary\" (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 }); }
1753
+ }
1754
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementUploadComponent, decorators: [{
1755
+ type: Component,
1756
+ args: [{ selector: 'valtimo-process-management-upload', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1757
+ CommonModule,
1758
+ TranslateModule,
1759
+ FileUploaderModule,
1760
+ ModalModule,
1761
+ LayerModule,
1762
+ ReactiveFormsModule,
1763
+ ButtonModule,
1764
+ ], 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=\"secondary\" (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"] }]
1765
+ }], ctorParameters: () => [{ type: i1$2.FormBuilder }, { type: i2$1.GlobalNotificationService }, { type: ProcessManagementService }, { type: ProcessManagementStateService }, { type: i4.TranslateService }] });
1766
+
1767
+ /*
1768
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1769
+ *
1770
+ * Licensed under EUPL, Version 1.2 (the "License");
1771
+ * you may not use this file except in compliance with the License.
1772
+ * You may obtain a copy of the License at
1773
+ *
1774
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1775
+ *
1776
+ * Unless required by applicable law or agreed to in writing, software
1777
+ * distributed under the License is distributed on an "AS IS" basis,
1778
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1779
+ * See the License for the specific language governing permissions and
1780
+ * limitations under the License.
1781
+ */
1782
+ class ProcessManagementComponent {
1783
+ constructor(processManagementService, route, router) {
1784
+ this.processManagementService = processManagementService;
1785
+ this.route = route;
1786
+ this.router = router;
1787
+ this.context$ = getContextObservable(this.route);
1788
+ this.params$ = this.context$.pipe(filter$1(context => context === 'case'), switchMap(() => getCaseManagementRouteParams(this.route)), distinctUntilChanged((previous, current) => isEqual(previous, current)));
1789
+ this.paramsAreSet$ = new BehaviorSubject(false);
1790
+ this._subscriptions = new Subscription();
1791
+ }
1792
+ ngOnInit() {
1793
+ this.openParamsAndContextSubscription();
1794
+ }
1795
+ ngOnDestroy() {
1796
+ this._subscriptions.unsubscribe();
1797
+ }
1798
+ onProcessSelected(selectedProcessEvent) {
1799
+ const editParam = selectedProcessEvent === 'create' ? 'create' : selectedProcessEvent?.processDefinition?.key;
1800
+ this.router.navigate([editParam], {
1801
+ relativeTo: this.route,
1802
+ });
1803
+ }
1804
+ openParamsAndContextSubscription() {
1805
+ this._subscriptions.add(combineLatest([this.context$, this.params$.pipe(startWith(null))]).subscribe(([context, params]) => {
1806
+ if (context)
1807
+ this.processManagementService.context = context;
1808
+ if (params) {
1809
+ this.processManagementService.setParams(params.caseDefinitionKey, params.caseDefinitionVersionTag);
1810
+ }
1811
+ this.paramsAreSet$.next(true);
1812
+ }));
1813
+ }
1814
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementComponent, deps: [{ token: ProcessManagementService }, { token: i8.ActivatedRoute }, { token: i8.Router }], target: i0.ɵɵFactoryTarget.Component }); }
1815
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", 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 }); }
1816
+ }
1817
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementComponent, decorators: [{
1818
+ type: Component,
1819
+ args: [{ selector: 'valtimo-process-management', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1820
+ CommonModule,
1821
+ ProcessManagementListComponent,
1822
+ ProcessManagementUploadComponent,
1823
+ ProcessManagementBuilderComponent,
1824
+ LoadingModule,
1825
+ NotificationModule,
1826
+ ], 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"] }]
1827
+ }], ctorParameters: () => [{ type: ProcessManagementService }, { type: i8.ActivatedRoute }, { type: i8.Router }] });
1828
+
1829
+ /*
1830
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1831
+ *
1832
+ * Licensed under EUPL, Version 1.2 (the "License");
1833
+ * you may not use this file except in compliance with the License.
1834
+ * You may obtain a copy of the License at
1835
+ *
1836
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1837
+ *
1838
+ * Unless required by applicable law or agreed to in writing, software
1839
+ * distributed under the License is distributed on an "AS IS" basis,
1840
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1841
+ * See the License for the specific language governing permissions and
1842
+ * limitations under the License.
1843
+ */
1844
+
1845
+ /*
1846
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1847
+ *
1848
+ * Licensed under EUPL, Version 1.2 (the "License");
1849
+ * you may not use this file except in compliance with the License.
1850
+ * You may obtain a copy of the License at
1851
+ *
1852
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1853
+ *
1854
+ * Unless required by applicable law or agreed to in writing, software
1855
+ * distributed under the License is distributed on an "AS IS" basis,
1856
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1857
+ * See the License for the specific language governing permissions and
1858
+ * limitations under the License.
1859
+ */
1860
+ const routes = [
1861
+ {
1862
+ path: 'processes',
1863
+ component: ProcessManagementComponent,
1864
+ canActivate: [AuthGuardService],
1865
+ data: {
1866
+ title: 'Processes',
1867
+ roles: [ROLE_ADMIN],
1868
+ context: 'independent',
1869
+ },
1870
+ },
1871
+ {
1872
+ path: 'processes/create',
1873
+ component: ProcessManagementBuilderComponent,
1874
+ canActivate: [AuthGuardService],
1875
+ //TODO: Re-enable when pending changes is fixed
1876
+ // canDeactivate: [pendingChangesGuard],
1877
+ data: {
1878
+ title: 'Create new Process',
1879
+ roles: [ROLE_ADMIN],
1880
+ context: 'independent',
1881
+ },
1882
+ },
1883
+ {
1884
+ path: 'processes/:processDefinitionKey',
1885
+ component: ProcessManagementBuilderComponent,
1886
+ canActivate: [AuthGuardService],
1887
+ //TODO: Re-enable when pending changes is fixed
1888
+ // canDeactivate: [pendingChangesGuard],
1889
+ data: {
1890
+ title: 'Process details',
1891
+ roles: [ROLE_ADMIN],
1892
+ customPageTitle: true,
1893
+ context: 'independent',
1894
+ },
1895
+ },
1896
+ ];
1897
+ class ProcessManagementRoutingModule {
1898
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1899
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementRoutingModule, imports: [CommonModule, i8.RouterModule], exports: [RouterModule] }); }
1900
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
1901
+ }
1902
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementRoutingModule, decorators: [{
1903
+ type: NgModule,
1904
+ args: [{
1905
+ declarations: [],
1906
+ imports: [CommonModule, RouterModule.forChild(routes)],
1907
+ exports: [RouterModule],
1908
+ }]
1909
+ }] });
1910
+
1911
+ /*
1912
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1913
+ *
1914
+ * Licensed under EUPL, Version 1.2 (the "License");
1915
+ * you may not use this file except in compliance with the License.
1916
+ * You may obtain a copy of the License at
1917
+ *
1918
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1919
+ *
1920
+ * Unless required by applicable law or agreed to in writing, software
1921
+ * distributed under the License is distributed on an "AS IS" basis,
1922
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1923
+ * See the License for the specific language governing permissions and
1924
+ * limitations under the License.
1925
+ */
1926
+ class ProcessManagementModule {
1927
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1928
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementModule, imports: [CommonModule,
1929
+ ProcessManagementRoutingModule,
1930
+ WidgetModule,
1931
+ FormsModule,
1932
+ TranslateModule,
1933
+ ProcessLinkModule,
1934
+ ProcessManagementComponent,
1935
+ ProcessManagementBuilderComponent,
1936
+ CarbonListModule,
1937
+ ButtonModule,
1938
+ IconModule,
1939
+ DropdownModule,
1940
+ ModalModule,
1941
+ NotificationModule,
1942
+ RadioModule,
1943
+ ReactiveFormsModule,
1944
+ ModalModule,
1945
+ FileUploaderModule,
1946
+ LayerModule] }); }
1947
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementModule, imports: [CommonModule,
1948
+ ProcessManagementRoutingModule,
1949
+ WidgetModule,
1950
+ FormsModule,
1951
+ TranslateModule,
1952
+ ProcessLinkModule,
1953
+ ProcessManagementComponent,
1954
+ ProcessManagementBuilderComponent,
1955
+ CarbonListModule,
1956
+ ButtonModule,
1957
+ IconModule,
1958
+ DropdownModule,
1959
+ ModalModule,
1960
+ NotificationModule,
1961
+ RadioModule,
1962
+ ReactiveFormsModule,
1963
+ ModalModule,
1964
+ FileUploaderModule,
1965
+ LayerModule] }); }
1966
+ }
1967
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ProcessManagementModule, decorators: [{
1968
+ type: NgModule,
1969
+ args: [{
1970
+ imports: [
1971
+ CommonModule,
1972
+ ProcessManagementRoutingModule,
1973
+ WidgetModule,
1974
+ FormsModule,
1975
+ TranslateModule,
1976
+ ProcessLinkModule,
1977
+ ProcessManagementComponent,
1978
+ ProcessManagementBuilderComponent,
1979
+ CarbonListModule,
1980
+ ButtonModule,
1981
+ IconModule,
1982
+ DropdownModule,
1983
+ ModalModule,
1984
+ NotificationModule,
1985
+ RadioModule,
1986
+ ReactiveFormsModule,
1987
+ ModalModule,
1988
+ FileUploaderModule,
1989
+ LayerModule,
1990
+ ],
1991
+ }]
1992
+ }] });
1993
+
1994
+ /*
1995
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1996
+ *
1997
+ * Licensed under EUPL, Version 1.2 (the "License");
1998
+ * you may not use this file except in compliance with the License.
1999
+ * You may obtain a copy of the License at
2000
+ *
2001
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2002
+ *
2003
+ * Unless required by applicable law or agreed to in writing, software
2004
+ * distributed under the License is distributed on an "AS IS" basis,
2005
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2006
+ * See the License for the specific language governing permissions and
2007
+ * limitations under the License.
2008
+ */
2009
+ /*
2010
+ * Public API Surface of process-management
2011
+ */
2012
+
2013
+ /**
2014
+ * Generated bundle index. Do not edit.
2015
+ */
2016
+
2017
+ export { PROCESS_MANAGEMENT_BUILDER_TEST_IDS, PROCESS_MANAGEMENT_ENDPOINTS, PROCESS_MANAGEMENT_LIST_TEST_IDS, ProcessManagementBuilderComponent, ProcessManagementComponent, ProcessManagementModule, ProcessManagementStateService };
2018
+ //# sourceMappingURL=valtimo-process-management.mjs.map