@valtimo/decision 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 (40) hide show
  1. package/README.md +31 -0
  2. package/fesm2022/valtimo-decision.mjs +982 -0
  3. package/fesm2022/valtimo-decision.mjs.map +1 -0
  4. package/index.d.ts +6 -0
  5. package/lib/constants/decision.test-ids.d.ts +11 -0
  6. package/lib/constants/decision.test-ids.d.ts.map +1 -0
  7. package/lib/constants/index.d.ts +2 -0
  8. package/lib/constants/index.d.ts.map +1 -0
  9. package/lib/decision-deploy/decision-deploy.component.d.ts +34 -0
  10. package/lib/decision-deploy/decision-deploy.component.d.ts.map +1 -0
  11. package/lib/decision-display/decision-display.component.d.ts +21 -0
  12. package/lib/decision-display/decision-display.component.d.ts.map +1 -0
  13. package/lib/decision-list/decision-list.component.d.ts +40 -0
  14. package/lib/decision-list/decision-list.component.d.ts.map +1 -0
  15. package/lib/decision-modeler/decision-modeler.component.d.ts +70 -0
  16. package/lib/decision-modeler/decision-modeler.component.d.ts.map +1 -0
  17. package/lib/decision-modeler/empty-decision.d.ts +4 -0
  18. package/lib/decision-modeler/empty-decision.d.ts.map +1 -0
  19. package/lib/decision-routing.module.d.ts +9 -0
  20. package/lib/decision-routing.module.d.ts.map +1 -0
  21. package/lib/decision.module.d.ts +17 -0
  22. package/lib/decision.module.d.ts.map +1 -0
  23. package/lib/models/decision-management.model.d.ts +6 -0
  24. package/lib/models/decision-management.model.d.ts.map +1 -0
  25. package/lib/models/decision.model.d.ts +19 -0
  26. package/lib/models/decision.model.d.ts.map +1 -0
  27. package/lib/models/index.d.ts +3 -0
  28. package/lib/models/index.d.ts.map +1 -0
  29. package/lib/services/decision-state.service.d.ts +10 -0
  30. package/lib/services/decision-state.service.d.ts.map +1 -0
  31. package/lib/services/decision.service.d.ts +30 -0
  32. package/lib/services/decision.service.d.ts.map +1 -0
  33. package/lib/services/index.d.ts +3 -0
  34. package/lib/services/index.d.ts.map +1 -0
  35. package/lib/utils/decision.utils.d.ts +3 -0
  36. package/lib/utils/decision.utils.d.ts.map +1 -0
  37. package/package.json +26 -0
  38. package/public-api.d.ts +10 -0
  39. package/public-api.d.ts.map +1 -0
  40. package/valtimo-decision.d.ts.map +1 -0
@@ -0,0 +1,982 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, ViewEncapsulation, EventEmitter, Output, ViewChild, NgModule } from '@angular/core';
3
+ import { Subject, startWith, BehaviorSubject, map, combineLatest, switchMap, tap, filter, take, from, of, catchError } from 'rxjs';
4
+ import * as i1 from '@angular/common/http';
5
+ import { HttpHeaders } from '@angular/common/http';
6
+ import * as i6 from '@valtimo/shared';
7
+ import { BaseApiService, InterceptorSkip, getCaseManagementRouteParams, getBuildingBlockManagementRouteParams, getContextObservable, ROLE_ADMIN } from '@valtimo/shared';
8
+ import * as i2 from '@angular/router';
9
+ import { RouterModule } from '@angular/router';
10
+ import * as i7 from '@angular/common';
11
+ import { CommonModule } from '@angular/common';
12
+ import { AuthGuardService } from '@valtimo/security';
13
+ import DmnJS from 'dmn-js/dist/dmn-modeler.development.js';
14
+ import { migrateDiagram } from '@bpmn-io/dmn-migrate';
15
+ import * as i4 from '@valtimo/components';
16
+ import { PendingChangesComponent, WidgetModule, SelectModule as SelectModule$1, RenderInPageHeaderDirective, FitPageDirective, OverflowMenuComponent, OverflowMenuOptionComponent, OverflowMenuTriggerComponent, CarbonListModule, ModalModule as ModalModule$1, SpinnerModule } from '@valtimo/components';
17
+ import * as i3 from '@ngx-translate/core';
18
+ import { TranslateModule } from '@ngx-translate/core';
19
+ import * as i6$1 from 'carbon-components-angular';
20
+ import { ModalModule, SelectModule, ButtonModule, IconModule, LayerModule, FileUploaderModule } from 'carbon-components-angular';
21
+ import { Deploy16, Download16, ArrowLeft16, Upload16 } from '@carbon/icons';
22
+ import DmnViewer from 'dmn-js';
23
+ import * as i3$1 from '@angular/forms';
24
+ import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
25
+
26
+ /*
27
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
28
+ *
29
+ * Licensed under EUPL, Version 1.2 (the "License");
30
+ * you may not use this file except in compliance with the License.
31
+ * You may obtain a copy of the License at
32
+ *
33
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
34
+ *
35
+ * Unless required by applicable law or agreed to in writing, software
36
+ * distributed under the License is distributed on an "AS IS" basis,
37
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
38
+ * See the License for the specific language governing permissions and
39
+ * limitations under the License.
40
+ */
41
+
42
+ /*
43
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
44
+ *
45
+ * Licensed under EUPL, Version 1.2 (the "License");
46
+ * you may not use this file except in compliance with the License.
47
+ * You may obtain a copy of the License at
48
+ *
49
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
50
+ *
51
+ * Unless required by applicable law or agreed to in writing, software
52
+ * distributed under the License is distributed on an "AS IS" basis,
53
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
54
+ * See the License for the specific language governing permissions and
55
+ * limitations under the License.
56
+ */
57
+
58
+ /*
59
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
60
+ *
61
+ * Licensed under EUPL, Version 1.2 (the "License");
62
+ * you may not use this file except in compliance with the License.
63
+ * You may obtain a copy of the License at
64
+ *
65
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
66
+ *
67
+ * Unless required by applicable law or agreed to in writing, software
68
+ * distributed under the License is distributed on an "AS IS" basis,
69
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
70
+ * See the License for the specific language governing permissions and
71
+ * limitations under the License.
72
+ */
73
+
74
+ /*
75
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
76
+ *
77
+ * Licensed under EUPL, Version 1.2 (the "License");
78
+ * you may not use this file except in compliance with the License.
79
+ * You may obtain a copy of the License at
80
+ *
81
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
82
+ *
83
+ * Unless required by applicable law or agreed to in writing, software
84
+ * distributed under the License is distributed on an "AS IS" basis,
85
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
86
+ * See the License for the specific language governing permissions and
87
+ * limitations under the License.
88
+ */
89
+ class DecisionStateService {
90
+ constructor() {
91
+ this._refreshDecisions$ = new Subject();
92
+ }
93
+ get refreshDecisions$() {
94
+ return this._refreshDecisions$.asObservable().pipe(startWith(null));
95
+ }
96
+ refreshDecisions() {
97
+ this._refreshDecisions$.next(null);
98
+ }
99
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
100
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionStateService, providedIn: 'root' }); }
101
+ }
102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionStateService, decorators: [{
103
+ type: Injectable,
104
+ args: [{
105
+ providedIn: 'root',
106
+ }]
107
+ }] });
108
+
109
+ /*
110
+ * Copyright 2015-2026 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 DecisionService extends BaseApiService {
125
+ constructor(httpClient, configService) {
126
+ super(httpClient, configService);
127
+ this.httpClient = httpClient;
128
+ this.configService = configService;
129
+ }
130
+ deployDmn(dmn) {
131
+ const formData = new FormData();
132
+ formData.append('file', dmn);
133
+ formData.append('deployment-name', 'dmnTableDeploy');
134
+ formData.append('deployment-source', 'process application');
135
+ return this.httpClient.post(this.getApiUrl('/v1/process/definition/deployment'), formData);
136
+ }
137
+ getDecisions() {
138
+ return this.httpClient.get(this.getApiUrl('/operaton-rest/engine/default/decision-definition'));
139
+ }
140
+ getDecisionById(decisionId) {
141
+ return this.httpClient.get(this.getApiUrl(`/operaton-rest/engine/default/decision-definition/${decisionId}`));
142
+ }
143
+ getLatestDecisionByKey(decisionKey) {
144
+ return this.httpClient.get(this.getApiUrl(`/operaton-rest/engine/default/decision-definition/key/${decisionKey}`));
145
+ }
146
+ getDecisionXml(decisionId) {
147
+ return this.httpClient.get(this.getApiUrl(`/operaton-rest/engine/default/decision-definition/${decisionId}/xml`));
148
+ }
149
+ listCaseDecisionDefinitions(caseDefinitionKey, versionTag) {
150
+ return this.httpClient.get(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${versionTag}/decision-definition`));
151
+ }
152
+ deployCaseDecisionDefinition(caseDefinitionKey, versionTag, dmn) {
153
+ const formData = new FormData();
154
+ formData.append('file', dmn);
155
+ return this.httpClient.post(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${versionTag}/decision-definition`), formData, {
156
+ headers: new HttpHeaders().set(InterceptorSkip, '204'),
157
+ });
158
+ }
159
+ deleteCaseDecisionDefinition(caseDefinitionKey, versionTag, decisionDefinitionKey) {
160
+ return this.httpClient.delete(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${versionTag}/decision-definition/${decisionDefinitionKey}`));
161
+ }
162
+ listBuildingBlockDecisionDefinitions(key, versionTag) {
163
+ return this.httpClient.get(this.getApiUrl(`/management/v1/building-block/${key}/version/${versionTag}/decision-definition`));
164
+ }
165
+ deployBuildingBlockDecisionDefinition(key, versionTag, dmn) {
166
+ const formData = new FormData();
167
+ formData.append('file', dmn);
168
+ return this.httpClient.post(this.getApiUrl(`/management/v1/building-block/${key}/version/${versionTag}/decision-definition`), formData, {
169
+ headers: new HttpHeaders().set(InterceptorSkip, '204'),
170
+ });
171
+ }
172
+ deleteBuildingBlockDecisionDefinition(key, versionTag, decisionDefinitionKey) {
173
+ return this.httpClient.delete(this.getApiUrl(`/management/v1/building-block/${key}/version/${versionTag}/decision-definition/${decisionDefinitionKey}`));
174
+ }
175
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionService, deps: [{ token: i1.HttpClient }, { token: i6.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
176
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionService, providedIn: 'root' }); }
177
+ }
178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionService, decorators: [{
179
+ type: Injectable,
180
+ args: [{
181
+ providedIn: 'root',
182
+ }]
183
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i6.ConfigService }] });
184
+
185
+ /*
186
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
187
+ *
188
+ * Licensed under EUPL, Version 1.2 (the "License");
189
+ * you may not use this file except in compliance with the License.
190
+ * You may obtain a copy of the License at
191
+ *
192
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
193
+ *
194
+ * Unless required by applicable law or agreed to in writing, software
195
+ * distributed under the License is distributed on an "AS IS" basis,
196
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
197
+ * See the License for the specific language governing permissions and
198
+ * limitations under the License.
199
+ */
200
+
201
+ /*
202
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
203
+ *
204
+ * Licensed under EUPL, Version 1.2 (the "License");
205
+ * you may not use this file except in compliance with the License.
206
+ * You may obtain a copy of the License at
207
+ *
208
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
209
+ *
210
+ * Unless required by applicable law or agreed to in writing, software
211
+ * distributed under the License is distributed on an "AS IS" basis,
212
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
213
+ * See the License for the specific language governing permissions and
214
+ * limitations under the License.
215
+ */
216
+ const DECISION_LIST_TEST_IDS = {
217
+ uploadButton: 'decisionListUploadButton',
218
+ };
219
+ const DECISION_UPLOAD_TEST_IDS = {
220
+ submitButton: 'decisionUploadModalSubmitButton',
221
+ };
222
+ const DECISION_MODELER_TEST_IDS = {
223
+ deployButton: 'decisionModelerDeployButton',
224
+ backButton: 'decisionModelerBackButton',
225
+ };
226
+
227
+ /*
228
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
229
+ *
230
+ * Licensed under EUPL, Version 1.2 (the "License");
231
+ * you may not use this file except in compliance with the License.
232
+ * You may obtain a copy of the License at
233
+ *
234
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
235
+ *
236
+ * Unless required by applicable law or agreed to in writing, software
237
+ * distributed under the License is distributed on an "AS IS" basis,
238
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
239
+ * See the License for the specific language governing permissions and
240
+ * limitations under the License.
241
+ */
242
+
243
+ /*
244
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
245
+ *
246
+ * Licensed under EUPL, Version 1.2 (the "License");
247
+ * you may not use this file except in compliance with the License.
248
+ * You may obtain a copy of the License at
249
+ *
250
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
251
+ *
252
+ * Unless required by applicable law or agreed to in writing, software
253
+ * distributed under the License is distributed on an "AS IS" basis,
254
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
255
+ * See the License for the specific language governing permissions and
256
+ * limitations under the License.
257
+ */
258
+ const EMPTY_DECISION = {
259
+ id: '',
260
+ dmnXml: `<?xml version="1.0" encoding="UTF-8"?>
261
+ <definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" id="Definitions_1h198v9" name="DRD" namespace="http://camunda.org/schema/1.0/dmn" xmlns:modeler="http://camunda.org/schema/modeler/1.0" exporter="Camunda Modeler" exporterVersion="5.2.0" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.0.0">
262
+ <decision id="Decision_1e18q76" name="Decision 1">
263
+ <decisionTable id="DecisionTable_1apu23m">
264
+ <input id="Input_1">
265
+ <inputExpression id="InputExpression_1" typeRef="string">
266
+ <text></text>
267
+ </inputExpression>
268
+ </input>
269
+ <output id="Output_1" typeRef="string" />
270
+ </decisionTable>
271
+ </decision>
272
+ <dmndi:DMNDI>
273
+ <dmndi:DMNDiagram>
274
+ <dmndi:DMNShape dmnElementRef="Decision_1e18q76">
275
+ <dc:Bounds height="80" width="180" x="160" y="100" />
276
+ </dmndi:DMNShape>
277
+ </dmndi:DMNDiagram>
278
+ </dmndi:DMNDI>
279
+ </definitions>
280
+ `,
281
+ };
282
+
283
+ /*
284
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
285
+ *
286
+ * Licensed under EUPL, Version 1.2 (the "License");
287
+ * you may not use this file except in compliance with the License.
288
+ * You may obtain a copy of the License at
289
+ *
290
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
291
+ *
292
+ * Unless required by applicable law or agreed to in writing, software
293
+ * distributed under the License is distributed on an "AS IS" basis,
294
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
295
+ * See the License for the specific language governing permissions and
296
+ * limitations under the License.
297
+ */
298
+ class DecisionModelerComponent extends PendingChangesComponent {
299
+ constructor(decisionService, route, router, translateService, pageTitleService, breadcrumbService, iconService, pageHeaderService, notificationService, editPermissionsService) {
300
+ super();
301
+ this.decisionService = decisionService;
302
+ this.route = route;
303
+ this.router = router;
304
+ this.translateService = translateService;
305
+ this.pageTitleService = pageTitleService;
306
+ this.breadcrumbService = breadcrumbService;
307
+ this.iconService = iconService;
308
+ this.pageHeaderService = pageHeaderService;
309
+ this.notificationService = notificationService;
310
+ this.editPermissionsService = editPermissionsService;
311
+ this.CLASS_NAMES = {
312
+ drd: 'dmn-icon-lasso-tool',
313
+ decisionTable: 'dmn-icon-decision-table',
314
+ literalExpression: 'dmn-icon-literal-expression',
315
+ };
316
+ this.testIds = DECISION_MODELER_TEST_IDS;
317
+ this.versionSelectionDisabled$ = new BehaviorSubject(true);
318
+ this.isCreating$ = new BehaviorSubject(false);
319
+ this.selectionId$ = new BehaviorSubject('');
320
+ this.caseManagementRouteParams$ = getCaseManagementRouteParams(this.route);
321
+ this.buildingBlockManagementRouteParams$ = getBuildingBlockManagementRouteParams(this.route);
322
+ this.context$ = getContextObservable(this.route);
323
+ this.isIndependent$ = this.context$.pipe(map(context => context === 'independent'));
324
+ this.compactMode$ = this.pageHeaderService.compactMode$;
325
+ this.hasEditPermissions$ = combineLatest([
326
+ this.caseManagementRouteParams$,
327
+ this.context$,
328
+ ]).pipe(switchMap(([params, context]) => this.editPermissionsService.hasPermissionsToEditBasedOnContext(params, context ?? '')));
329
+ this.decisionId$ = this.route.params.pipe(map(params => params?.id), tap(id => {
330
+ this.isCreating$.next(id === 'create');
331
+ this.versionSelectionDisabled$.next(true);
332
+ }), filter(id => !!id && id !== 'create'));
333
+ this.decision$ = this.decisionId$.pipe(switchMap(id => this.decisionService.getDecisionById(id)), tap(decision => {
334
+ this._fileName = decision.resource;
335
+ if (decision)
336
+ this.selectionId$.next(decision.id);
337
+ }));
338
+ this.decisionTitle$ = this.decision$.pipe(map(d => d?.name || d?.key || '-'), tap(title => this.pageTitleService.setCustomPageTitle(title)));
339
+ this._refreshDecisionSelectItems$ = new BehaviorSubject(null);
340
+ this.decisionVersionSelectItems$ = this._refreshDecisionSelectItems$.pipe(switchMap(() => combineLatest([this.decision$, this.decisionService.getDecisions()])), map(([current, list]) => {
341
+ const filtered = list.filter(d => d.key === current.key);
342
+ return [...filtered.map(d => ({ id: d.id, text: d.version.toString() }))].sort((a, b) => +(b.text ?? '') - +(a.text ?? ''));
343
+ }), tap(() => this.versionSelectionDisabled$.next(false)));
344
+ this.decisionXml$ = this.decisionId$.pipe(switchMap(id => this.decisionService.getDecisionXml(id)), tap(xml => xml && this.loadDecisionXml(xml)));
345
+ this.iconService.registerAll([Deploy16, Download16, ArrowLeft16]);
346
+ }
347
+ ngOnInit() {
348
+ this.pageTitleService.disableReset();
349
+ }
350
+ ngOnDestroy() {
351
+ this.pageTitleService.enableReset();
352
+ this.breadcrumbService.clearThirdBreadcrumb();
353
+ this.breadcrumbService.clearFourthBreadcrumb();
354
+ }
355
+ ngAfterViewInit() {
356
+ this.setProperties();
357
+ this.setTabEvents();
358
+ this.setModelerEvents();
359
+ this.context$.pipe(take(1)).subscribe(context => {
360
+ if (!context)
361
+ return;
362
+ if (context === 'buildingBlock') {
363
+ this.buildingBlockManagementRouteParams$.pipe(take(1)).subscribe(params => {
364
+ if (params)
365
+ this.initBuildingBlockBreadcrumbs(params);
366
+ });
367
+ }
368
+ else {
369
+ this.caseManagementRouteParams$.pipe(take(1)).subscribe(params => {
370
+ if (params)
371
+ this.initBreadcrumbs(params, context);
372
+ });
373
+ }
374
+ });
375
+ }
376
+ switchVersion(decisionId) {
377
+ if (!decisionId)
378
+ return;
379
+ this.router.navigate(['../', decisionId], { relativeTo: this.route });
380
+ this._refreshDecisionSelectItems$.next(null);
381
+ }
382
+ deploy() {
383
+ from(this.dmnModeler.saveXML({ format: true }))
384
+ .pipe(map(result => new File([result.xml], this._fileName, { type: 'text/xml' })), switchMap(file => combineLatest([of(file), this.context$])), switchMap(([file, context]) => {
385
+ if (context === 'independent') {
386
+ return this.decisionService.deployDmn(file);
387
+ }
388
+ if (context === 'buildingBlock') {
389
+ return this.buildingBlockManagementRouteParams$.pipe(switchMap(params => this.decisionService.deployBuildingBlockDecisionDefinition(params?.buildingBlockDefinitionKey ?? '', params?.buildingBlockDefinitionVersionTag ?? '', file)));
390
+ }
391
+ return this.caseManagementRouteParams$.pipe(switchMap(params => this.decisionService.deployCaseDecisionDefinition(params?.caseDefinitionKey ?? '', params?.caseDefinitionVersionTag ?? '', file)));
392
+ }), tap((res) => {
393
+ this.switchVersion(res.identifier);
394
+ this.showNotification('success', 'decisions.deploySuccess');
395
+ }), catchError(() => {
396
+ this.showNotification('error', 'decisions.deployFailure');
397
+ return of(null);
398
+ }))
399
+ .subscribe();
400
+ }
401
+ download() {
402
+ from(this.dmnModeler.saveXML({ format: true }))
403
+ .pipe(map(result => new File([result.xml], 'decision.dmn', { type: 'text/xml' })), tap(file => {
404
+ const link = document.createElement('a');
405
+ link.download = 'diagram.dmn';
406
+ link.href = window.URL.createObjectURL(file);
407
+ link.click();
408
+ window.URL.revokeObjectURL(link.href);
409
+ link.remove();
410
+ }))
411
+ .subscribe();
412
+ }
413
+ navigateBack(notification, message) {
414
+ this.router.navigate(['../'], { relativeTo: this.route });
415
+ if (!notification)
416
+ return;
417
+ this.showNotification(notification, message);
418
+ }
419
+ showNotification(notification, message) {
420
+ if (!notification)
421
+ return;
422
+ this.notificationService.showToast({
423
+ caption: this.translateService.instant(message),
424
+ type: notification,
425
+ title: this.translateService.instant(`interface.${notification}`),
426
+ });
427
+ }
428
+ setProperties() {
429
+ const isCreating = this.isCreating$.getValue();
430
+ this.$container = $('.editor-container');
431
+ this.$tabs = $('.editor-tabs');
432
+ this.dmnModeler = new DmnJS({
433
+ container: this.$container,
434
+ height: 500,
435
+ width: '100%',
436
+ keyboard: { bindTo: window },
437
+ });
438
+ if (isCreating)
439
+ this.loadEmptyDecisionTable();
440
+ }
441
+ loadEmptyDecisionTable() {
442
+ this.loadDecisionXml(EMPTY_DECISION);
443
+ }
444
+ setTabEvents() {
445
+ this.$tabs.delegate('.tab', 'click', async (event) => {
446
+ const index = +event.currentTarget.getAttribute('data-id');
447
+ const view = this.dmnModeler.getViews()[index];
448
+ try {
449
+ await this.dmnModeler.open(view);
450
+ }
451
+ catch (err) {
452
+ console.error('tab open error', err);
453
+ }
454
+ });
455
+ }
456
+ setModelerEvents() {
457
+ this.dmnModeler.on('views.changed', event => {
458
+ const { views, activeView } = event;
459
+ this.$tabs.empty();
460
+ views.forEach((v, i) => {
461
+ const className = this.CLASS_NAMES[v.type];
462
+ const tab = $(`<div class="tab ${v === activeView ? 'active' : ''}" data-id="${i}"><span class="${className}"></span>${v.element.name || v.element.id}</div>`);
463
+ this.$tabs.append(tab);
464
+ });
465
+ });
466
+ }
467
+ loadDecisionXml(decision) {
468
+ from(this.dmnModeler.importXML(decision.dmnXml))
469
+ .pipe(tap(() => this.setEditor()), catchError(() => {
470
+ this.migrateAndLoadDecisionXml(decision);
471
+ return of(null);
472
+ }))
473
+ .subscribe();
474
+ }
475
+ migrateAndLoadDecisionXml(decision) {
476
+ from(migrateDiagram(decision.dmnXml))
477
+ .pipe(switchMap(xml => this.dmnModeler.importXML(xml)), tap(() => this.setEditor()), catchError(() => {
478
+ this.showNotification('error', 'decisions.loadFailure');
479
+ return of(null);
480
+ }))
481
+ .subscribe();
482
+ }
483
+ setEditor() {
484
+ const view = this.dmnModeler.getActiveView();
485
+ if (view?.type === 'drd') {
486
+ const canvas = this.dmnModeler.getActiveViewer().get('canvas');
487
+ canvas.zoom('fit-viewport');
488
+ }
489
+ }
490
+ initBreadcrumbs(params, context) {
491
+ if (context === 'independent')
492
+ return;
493
+ const route = `/case-management/case/${params.caseDefinitionKey}/version/${params.caseDefinitionVersionTag}`;
494
+ this.breadcrumbService.setThirdBreadcrumb({
495
+ route: [route],
496
+ content: `${params.caseDefinitionKey} (${params.caseDefinitionVersionTag})`,
497
+ href: route,
498
+ });
499
+ const routeWithDecisions = `${route}/decisions`;
500
+ this.breadcrumbService.setFourthBreadcrumb({
501
+ route: [routeWithDecisions],
502
+ content: this.translateService.instant('caseManagement.tabs.decision'),
503
+ href: routeWithDecisions,
504
+ });
505
+ }
506
+ initBuildingBlockBreadcrumbs(params) {
507
+ const route = `/building-block-management/building-block/${params.buildingBlockDefinitionKey}/version/${params.buildingBlockDefinitionVersionTag}`;
508
+ const generalRoute = `${route}/general`;
509
+ this.breadcrumbService.setThirdBreadcrumb({
510
+ route: [generalRoute],
511
+ content: `${params.buildingBlockDefinitionKey} (${params.buildingBlockDefinitionVersionTag})`,
512
+ href: generalRoute,
513
+ });
514
+ const routeWithDecisions = `${route}/decisions`;
515
+ this.breadcrumbService.setFourthBreadcrumb({
516
+ route: [routeWithDecisions],
517
+ content: this.translateService.instant('buildingBlockManagement.tabs.decisions'),
518
+ href: routeWithDecisions,
519
+ });
520
+ }
521
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionModelerComponent, deps: [{ token: DecisionService }, { token: i2.ActivatedRoute }, { token: i2.Router }, { token: i3.TranslateService }, { token: i4.PageTitleService }, { token: i4.BreadcrumbService }, { token: i6$1.IconService }, { token: i4.PageHeaderService }, { token: i6.GlobalNotificationService }, { token: i6.EditPermissionsService }], target: i0.ɵɵFactoryTarget.Component }); }
522
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: DecisionModelerComponent, isStandalone: true, selector: "valtimo-decision-modeler", usesInheritance: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n *ngIf=\"{\n decisionXml: decisionXml$ | async,\n decisionTitle: decisionTitle$ | async,\n } as obs\"\n fitPage\n [disableOverflow]=\"true\"\n class=\"dmn-editor\"\n>\n <ng-container *ngTemplateOutlet=\"diagram\"></ng-container>\n</div>\n\n<ng-template #diagram>\n <div class=\"editor-parent\">\n <div class=\"editor-container\"></div>\n <div class=\"editor-tabs\"></div>\n </div>\n</ng-template>\n\n<ng-container renderInPageHeader>\n <ng-template>\n <div\n *ngIf=\"{\n selectionId: selectionId$ | async,\n isCreating: isCreating$ | async,\n context: context$ | async,\n compactMode: compactMode$ | async,\n hasEditPermissions: hasEditPermissions$ | async,\n } as obs\"\n class=\"decision-modeler-actions\"\n >\n <ng-container *ngTemplateOutlet=\"versionSelection\"></ng-container>\n\n <button\n *ngIf=\"obs.context === 'case'\"\n cdsButton=\"secondary\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n (click)=\"navigateBack(null)\"\n [attr.data-test-id]=\"testIds.backButton\"\n >\n <svg class=\"cds--btn__icon\" cdsIcon=\"arrow--left\" size=\"16\"></svg>\n\n <span>{{ 'interface.back' | translate }}</span>\n </button>\n\n @if (obs.selectionId && !obs.isCreating) {\n <button\n *ngIf=\"obs.hasEditPermissions\"\n cdsButton=\"primary\"\n (click)=\"deploy()\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n [attr.data-test-id]=\"testIds.deployButton\"\n >\n {{ 'decisions.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 (selected)=\"download()\"\n >{{ 'interface.export' | translate }}\n </v-overflow-menu-option>\n </v-overflow-menu>\n } @else {\n <button class=\"btn btn-success btn-space\" (click)=\"deploy()\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>{{ 'decisions.deploy' | translate }}\n </button>\n }\n </div>\n </ng-template>\n</ng-container>\n\n<ng-template #versionSelection>\n <ng-container\n *ngIf=\"{\n selectItems: (decisionVersionSelectItems$ | async) || [],\n isIndependent: isIndependent$ | async,\n versionSelectionDisabled: versionSelectionDisabled$ | async,\n selectionId: selectionId$ | async,\n } as obs\"\n >\n <v-select\n *ngIf=\"obs.isIndependent\"\n name=\"version\"\n [title]=\"'decisions.version' | translate\"\n [disabled]=\"obs.versionSelectionDisabled\"\n [clearable]=\"false\"\n [loading]=\"obs.selectItems.length === 0\"\n [items]=\"obs.selectItems\"\n [defaultSelectionId]=\"obs.selectionId\"\n [widthInPx]=\"120\"\n (selectedChange)=\"switchVersion($event)\"\n ></v-select>\n </ng-container>\n</ng-template>\n", styles: ["#save-button{position:absolute;bottom:10px;left:10px;background:#fff;border:solid 1px #ccc;border-radius:2px;padding:8px;font-family:Arial,sans-serif;font-weight:700;cursor:default;font-size:14px;color:#444}.dmn-modeler{display:flex;flex-direction:column;width:100%;padding:1rem}.diagram,.diagram-header{border:1px solid #dee2e6}.decision-title{color:#6b6b6b;font-size:1.5rem;margin:0}.fullscreen-toggle{font-size:2rem}.fullscreen-toggle>i{cursor:pointer}.dmn-editor{background-color:var(--cds-layer);outline:1px solid var(--cds-border-subtle);outline-offset:-1px;padding:16px}.decision-modeler-actions{display:flex;width:100%;justify-content:flex-end;align-items:flex-end;gap:16px}\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: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: ModalModule }, { kind: "ngmodule", type: SelectModule }, { kind: "ngmodule", type: WidgetModule }, { kind: "ngmodule", type: SelectModule$1 }, { kind: "component", type: i4.SelectComponent, selector: "v-select", inputs: ["items", "defaultSelection", "defaultSelectionId", "defaultSelectionIds", "disabled", "dropUp", "invalid", "multiple", "margin", "widthInPx", "notFoundText", "clearAllText", "clearText", "clearable", "name", "title", "titleTranslationKey", "clearSelectionSubject$", "tooltip", "required", "loading", "loadingText", "placeholder", "smallMargin", "carbonTheme", "appendInline", "warn", "warnText", "dataTestId"], outputs: ["selectedChange"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "directive", type: RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i6$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "directive", type: FitPageDirective, selector: "[fitPage]", inputs: ["spaceAdjustment", "fitPageDisabled", "disableOverflow"] }, { 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"] }] }); }
523
+ }
524
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionModelerComponent, decorators: [{
525
+ type: Component,
526
+ args: [{ selector: 'valtimo-decision-modeler', standalone: true, imports: [
527
+ CommonModule,
528
+ RouterModule,
529
+ ModalModule,
530
+ SelectModule,
531
+ WidgetModule,
532
+ SelectModule$1,
533
+ TranslateModule,
534
+ RenderInPageHeaderDirective,
535
+ ButtonModule,
536
+ IconModule,
537
+ FitPageDirective,
538
+ OverflowMenuComponent,
539
+ OverflowMenuOptionComponent,
540
+ OverflowMenuTriggerComponent,
541
+ ], 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 *ngIf=\"{\n decisionXml: decisionXml$ | async,\n decisionTitle: decisionTitle$ | async,\n } as obs\"\n fitPage\n [disableOverflow]=\"true\"\n class=\"dmn-editor\"\n>\n <ng-container *ngTemplateOutlet=\"diagram\"></ng-container>\n</div>\n\n<ng-template #diagram>\n <div class=\"editor-parent\">\n <div class=\"editor-container\"></div>\n <div class=\"editor-tabs\"></div>\n </div>\n</ng-template>\n\n<ng-container renderInPageHeader>\n <ng-template>\n <div\n *ngIf=\"{\n selectionId: selectionId$ | async,\n isCreating: isCreating$ | async,\n context: context$ | async,\n compactMode: compactMode$ | async,\n hasEditPermissions: hasEditPermissions$ | async,\n } as obs\"\n class=\"decision-modeler-actions\"\n >\n <ng-container *ngTemplateOutlet=\"versionSelection\"></ng-container>\n\n <button\n *ngIf=\"obs.context === 'case'\"\n cdsButton=\"secondary\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n (click)=\"navigateBack(null)\"\n [attr.data-test-id]=\"testIds.backButton\"\n >\n <svg class=\"cds--btn__icon\" cdsIcon=\"arrow--left\" size=\"16\"></svg>\n\n <span>{{ 'interface.back' | translate }}</span>\n </button>\n\n @if (obs.selectionId && !obs.isCreating) {\n <button\n *ngIf=\"obs.hasEditPermissions\"\n cdsButton=\"primary\"\n (click)=\"deploy()\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n [attr.data-test-id]=\"testIds.deployButton\"\n >\n {{ 'decisions.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 (selected)=\"download()\"\n >{{ 'interface.export' | translate }}\n </v-overflow-menu-option>\n </v-overflow-menu>\n } @else {\n <button class=\"btn btn-success btn-space\" (click)=\"deploy()\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>{{ 'decisions.deploy' | translate }}\n </button>\n }\n </div>\n </ng-template>\n</ng-container>\n\n<ng-template #versionSelection>\n <ng-container\n *ngIf=\"{\n selectItems: (decisionVersionSelectItems$ | async) || [],\n isIndependent: isIndependent$ | async,\n versionSelectionDisabled: versionSelectionDisabled$ | async,\n selectionId: selectionId$ | async,\n } as obs\"\n >\n <v-select\n *ngIf=\"obs.isIndependent\"\n name=\"version\"\n [title]=\"'decisions.version' | translate\"\n [disabled]=\"obs.versionSelectionDisabled\"\n [clearable]=\"false\"\n [loading]=\"obs.selectItems.length === 0\"\n [items]=\"obs.selectItems\"\n [defaultSelectionId]=\"obs.selectionId\"\n [widthInPx]=\"120\"\n (selectedChange)=\"switchVersion($event)\"\n ></v-select>\n </ng-container>\n</ng-template>\n", styles: ["#save-button{position:absolute;bottom:10px;left:10px;background:#fff;border:solid 1px #ccc;border-radius:2px;padding:8px;font-family:Arial,sans-serif;font-weight:700;cursor:default;font-size:14px;color:#444}.dmn-modeler{display:flex;flex-direction:column;width:100%;padding:1rem}.diagram,.diagram-header{border:1px solid #dee2e6}.decision-title{color:#6b6b6b;font-size:1.5rem;margin:0}.fullscreen-toggle{font-size:2rem}.fullscreen-toggle>i{cursor:pointer}.dmn-editor{background-color:var(--cds-layer);outline:1px solid var(--cds-border-subtle);outline-offset:-1px;padding:16px}.decision-modeler-actions{display:flex;width:100%;justify-content:flex-end;align-items:flex-end;gap:16px}\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"] }]
542
+ }], ctorParameters: () => [{ type: DecisionService }, { type: i2.ActivatedRoute }, { type: i2.Router }, { type: i3.TranslateService }, { type: i4.PageTitleService }, { type: i4.BreadcrumbService }, { type: i6$1.IconService }, { type: i4.PageHeaderService }, { type: i6.GlobalNotificationService }, { type: i6.EditPermissionsService }] });
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
+ class DecisionDisplayComponent {
560
+ constructor(decisionService, route) {
561
+ this.decisionService = decisionService;
562
+ this.route = route;
563
+ }
564
+ ngOnInit() {
565
+ this.viewer = new DmnViewer({
566
+ container: '#canvas',
567
+ });
568
+ this.decisionId = this.route.snapshot.paramMap.get('id');
569
+ this.loadDecisionXml();
570
+ }
571
+ loadDecisionXml() {
572
+ this.decisionService.getDecisionXml(this.decisionId).subscribe((decision) => {
573
+ this.viewer.importXML(decision.dmnXml, error => {
574
+ if (error) {
575
+ this.migrateAndLoadDecisionXml(decision);
576
+ }
577
+ });
578
+ this.decisionXml = decision.dmnXml;
579
+ });
580
+ }
581
+ async migrateAndLoadDecisionXml(decision) {
582
+ const decisionXml = await migrateDiagram(decision.dmnXml);
583
+ if (decisionXml) {
584
+ this.viewer.importXML(decisionXml, error => {
585
+ if (error) {
586
+ console.error('Error importing migrated XML', error);
587
+ }
588
+ });
589
+ this.decisionXml = decisionXml;
590
+ }
591
+ }
592
+ download() {
593
+ const file = new Blob([this.decisionXml], { type: 'text/xml' });
594
+ const link = document.createElement('a');
595
+ link.download = `decision_table_${this.decisionId}.dmn`;
596
+ link.href = window.URL.createObjectURL(file);
597
+ link.click();
598
+ window.URL.revokeObjectURL(link.href);
599
+ link.remove();
600
+ }
601
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionDisplayComponent, deps: [{ token: DecisionService }, { token: i2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
602
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: DecisionDisplayComponent, isStandalone: true, selector: "valtimo-decision-display", 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 class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button (click)=\"download()\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"fa fa-save\"></i> &nbsp;\n <span>{{ 'Download' | translate }}</span>\n </button>\n </div>\n </div>\n <div id=\"canvas\" class=\"canvas-dmn\"></div>\n </div>\n</div>\n", styles: [".canvas-dmn{height:70vh}\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: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
603
+ }
604
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionDisplayComponent, decorators: [{
605
+ type: Component,
606
+ args: [{ selector: 'valtimo-decision-display', standalone: true, encapsulation: ViewEncapsulation.None, imports: [CommonModule, RouterModule, TranslateModule], 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 class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button (click)=\"download()\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"fa fa-save\"></i> &nbsp;\n <span>{{ 'Download' | translate }}</span>\n </button>\n </div>\n </div>\n <div id=\"canvas\" class=\"canvas-dmn\"></div>\n </div>\n</div>\n", styles: [".canvas-dmn{height:70vh}\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"] }]
607
+ }], ctorParameters: () => [{ type: DecisionService }, { type: i2.ActivatedRoute }] });
608
+
609
+ /*
610
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
611
+ *
612
+ * Licensed under EUPL, Version 1.2 (the "License");
613
+ * you may not use this file except in compliance with the License.
614
+ * You may obtain a copy of the License at
615
+ *
616
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
617
+ *
618
+ * Unless required by applicable law or agreed to in writing, software
619
+ * distributed under the License is distributed on an "AS IS" basis,
620
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
621
+ * See the License for the specific language governing permissions and
622
+ * limitations under the License.
623
+ */
624
+ function filterLatestDecisionVersions(decisions) {
625
+ return decisions.reduce((acc, curr) => {
626
+ const existing = acc.find(d => d.key === curr.key);
627
+ if (existing && existing.version >= curr.version)
628
+ return acc;
629
+ if (existing && existing.version < curr.version)
630
+ return [...acc.filter(d => d.key !== curr.key), curr];
631
+ return [...acc, curr];
632
+ }, []);
633
+ }
634
+
635
+ /*
636
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
637
+ *
638
+ * Licensed under EUPL, Version 1.2 (the "License");
639
+ * you may not use this file except in compliance with the License.
640
+ * You may obtain a copy of the License at
641
+ *
642
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
643
+ *
644
+ * Unless required by applicable law or agreed to in writing, software
645
+ * distributed under the License is distributed on an "AS IS" basis,
646
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
647
+ * See the License for the specific language governing permissions and
648
+ * limitations under the License.
649
+ */
650
+ class DecisionDeployComponent {
651
+ constructor(decisionService, stateService, route, formBuilder) {
652
+ this.decisionService = decisionService;
653
+ this.stateService = stateService;
654
+ this.route = route;
655
+ this.formBuilder = formBuilder;
656
+ this.deploySuccessful = new EventEmitter();
657
+ this.dmn = null;
658
+ this.modalOpen$ = new BehaviorSubject(false);
659
+ this.testIds = DECISION_UPLOAD_TEST_IDS;
660
+ this.caseManagementRouteParams$ = getCaseManagementRouteParams(this.route);
661
+ this.buildingBlockManagementRouteParams$ = getBuildingBlockManagementRouteParams(this.route);
662
+ this.context$ = getContextObservable(this.route);
663
+ this.ACCEPTED_FILES = ['dmn'];
664
+ this.form = this.formBuilder.group({
665
+ file: this.formBuilder.control(new Set(), [Validators.required]),
666
+ });
667
+ }
668
+ get selectedDmnFile() {
669
+ const fileSet = this.form.value?.file;
670
+ return fileSet?.size ? fileSet.values().next().value?.file || null : null;
671
+ }
672
+ onChange(files) {
673
+ this.dmn = files.item(0);
674
+ }
675
+ deployDmn() {
676
+ const dmnFile = this.selectedDmnFile;
677
+ if (!dmnFile)
678
+ return;
679
+ this.context$
680
+ .pipe(take(1), switchMap(context => {
681
+ if (context === 'case') {
682
+ return this.caseManagementRouteParams$.pipe(take(1), switchMap(params => this.decisionService.deployCaseDecisionDefinition(params.caseDefinitionKey, params.caseDefinitionVersionTag, dmnFile)));
683
+ }
684
+ if (context === 'buildingBlock') {
685
+ return this.buildingBlockManagementRouteParams$.pipe(take(1), switchMap(params => this.decisionService.deployBuildingBlockDecisionDefinition(params.buildingBlockDefinitionKey, params.buildingBlockDefinitionVersionTag, dmnFile)));
686
+ }
687
+ return this.decisionService.deployDmn(dmnFile);
688
+ }))
689
+ .subscribe(() => {
690
+ this.closeModal();
691
+ this.deploySuccessful.emit();
692
+ this.stateService.refreshDecisions();
693
+ });
694
+ }
695
+ openModal() {
696
+ this.modalOpen$.next(true);
697
+ }
698
+ closeModal() {
699
+ this.modalOpen$.next(false);
700
+ }
701
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionDeployComponent, deps: [{ token: DecisionService }, { token: DecisionStateService }, { token: i2.ActivatedRoute }, { token: i3$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
702
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: DecisionDeployComponent, isStandalone: true, selector: "valtimo-decision-deploy", outputs: { deploySuccessful: "deploySuccessful" }, 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 showFooter=\"true\" valtimoCdsModal [open]=\"modalOpen$ | async\" (close)=\"closeModal()\">\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'decisions.upload.title' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"ACCEPTED_FILES\"\n [multiple]=\"false\"\n buttonType=\"primary\"\n [title]=\"'decisions.upload.fileUploaderTitle' | translate\"\n [description]=\"'decisions.upload.fileUploaderDescription' | translate\"\n [buttonText]=\"'decisions.upload.fileUploaderButton' | translate\"\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]=\"!selectedDmnFile\"\n (click)=\"deployDmn()\"\n [attr.data-test-id]=\"testIds.submitButton\"\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: i7.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i6$1.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i6$1.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i6$1.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i6$1.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i6$1.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i6$1.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: FileUploaderModule }, { kind: "component", type: i6$1.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: ReactiveFormsModule }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
703
+ }
704
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionDeployComponent, decorators: [{
705
+ type: Component,
706
+ args: [{ selector: 'valtimo-decision-deploy', standalone: true, imports: [
707
+ CommonModule,
708
+ FormsModule,
709
+ TranslateModule,
710
+ ModalModule,
711
+ ButtonModule,
712
+ LayerModule,
713
+ FileUploaderModule,
714
+ ReactiveFormsModule,
715
+ ], 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 showFooter=\"true\" valtimoCdsModal [open]=\"modalOpen$ | async\" (close)=\"closeModal()\">\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'decisions.upload.title' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"ACCEPTED_FILES\"\n [multiple]=\"false\"\n buttonType=\"primary\"\n [title]=\"'decisions.upload.fileUploaderTitle' | translate\"\n [description]=\"'decisions.upload.fileUploaderDescription' | translate\"\n [buttonText]=\"'decisions.upload.fileUploaderButton' | translate\"\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]=\"!selectedDmnFile\"\n (click)=\"deployDmn()\"\n [attr.data-test-id]=\"testIds.submitButton\"\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"] }]
716
+ }], ctorParameters: () => [{ type: DecisionService }, { type: DecisionStateService }, { type: i2.ActivatedRoute }, { type: i3$1.FormBuilder }], propDecorators: { deploySuccessful: [{
717
+ type: Output
718
+ }] } });
719
+
720
+ /*
721
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
722
+ *
723
+ * Licensed under EUPL, Version 1.2 (the "License");
724
+ * you may not use this file except in compliance with the License.
725
+ * You may obtain a copy of the License at
726
+ *
727
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
728
+ *
729
+ * Unless required by applicable law or agreed to in writing, software
730
+ * distributed under the License is distributed on an "AS IS" basis,
731
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
732
+ * See the License for the specific language governing permissions and
733
+ * limitations under the License.
734
+ */
735
+ class DecisionListComponent {
736
+ constructor(decisionService, iconService, router, configService, stateService, route, cdr, editPermissionsService) {
737
+ this.decisionService = decisionService;
738
+ this.iconService = iconService;
739
+ this.router = router;
740
+ this.configService = configService;
741
+ this.stateService = stateService;
742
+ this.route = route;
743
+ this.cdr = cdr;
744
+ this.editPermissionsService = editPermissionsService;
745
+ this.fields = [
746
+ { key: 'key', label: 'Key' },
747
+ { key: 'name', label: 'Name' },
748
+ { key: 'version', label: 'Version' },
749
+ ];
750
+ this.loading$ = new BehaviorSubject(true);
751
+ this.testIds = DECISION_LIST_TEST_IDS;
752
+ this.caseManagementRouteParams$ = getCaseManagementRouteParams(this.route);
753
+ this.buildingBlockManagementRouteParams$ = getBuildingBlockManagementRouteParams(this.route);
754
+ this.context$ = getContextObservable(this.route);
755
+ this.decisionsLatestVersions$ = this.stateService.refreshDecisions$.pipe(switchMap(() => this.context$), switchMap(context => {
756
+ if (context === 'case') {
757
+ return this.caseManagementRouteParams$.pipe(switchMap(params => this.decisionService.listCaseDecisionDefinitions(params.caseDefinitionKey, params.caseDefinitionVersionTag)));
758
+ }
759
+ if (context === 'buildingBlock') {
760
+ return this.buildingBlockManagementRouteParams$.pipe(switchMap(params => this.decisionService.listBuildingBlockDecisionDefinitions(params.buildingBlockDefinitionKey, params.buildingBlockDefinitionVersionTag)));
761
+ }
762
+ return this.decisionService.getDecisions();
763
+ }), map(filterLatestDecisionVersions), tap(() => {
764
+ this.loading$.next(false);
765
+ this.cdr.detectChanges();
766
+ }));
767
+ this.hasEditPermissions$ = combineLatest([
768
+ this.caseManagementRouteParams$,
769
+ this.context$,
770
+ ]).pipe(switchMap(([params, context]) => {
771
+ return this.editPermissionsService.hasPermissionsToEditBasedOnContext(params, context);
772
+ }));
773
+ this.iconService.registerAll([Upload16]);
774
+ this.experimentalEditing = this.configService.config.featureToggles.experimentalDmnEditing;
775
+ }
776
+ viewDecisionTable(decision) {
777
+ this.context$.pipe(take(1)).subscribe(context => {
778
+ if (context === 'independent') {
779
+ const basePath = this.experimentalEditing ? '/decision-tables/edit/' : '/decision-tables/';
780
+ this.router.navigate([basePath + decision.id]);
781
+ }
782
+ else if (context === 'buildingBlock') {
783
+ this.buildingBlockManagementRouteParams$.pipe(take(1)).subscribe(params => {
784
+ this.router.navigateByUrl(`building-block-management/building-block/${params.buildingBlockDefinitionKey}/version/${params.buildingBlockDefinitionVersionTag}/decisions/${decision.id}`);
785
+ });
786
+ }
787
+ else {
788
+ this.caseManagementRouteParams$.pipe(take(1)).subscribe(params => {
789
+ this.router.navigateByUrl(`case-management/case/${params.caseDefinitionKey}/version/${params.caseDefinitionVersionTag}/decisions/${decision.id}`);
790
+ });
791
+ }
792
+ });
793
+ }
794
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionListComponent, deps: [{ token: DecisionService }, { token: i6$1.IconService }, { token: i2.Router }, { token: i6.ConfigService }, { token: DecisionStateService }, { token: i2.ActivatedRoute }, { token: i0.ChangeDetectorRef }, { token: i6.EditPermissionsService }], target: i0.ɵɵFactoryTarget.Component }); }
795
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: DecisionListComponent, isStandalone: true, selector: "valtimo-decision-list", viewQueries: [{ propertyName: "deploy", first: true, predicate: ["decisionDeploy"], 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<valtimo-carbon-list\n [items]=\"(decisionsLatestVersions$ | async) || []\"\n [loading]=\"loading$ | async\"\n [fields]=\"fields\"\n (rowClicked)=\"viewDecisionTable($event)\"\n [header]=\"false\"\n [isSearchable]=\"true\"\n>\n <ng-container carbonToolbarContent>\n <button\n *ngIf=\"hasEditPermissions$ | async\"\n cdsButton=\"primary\"\n (click)=\"this.deploy.openModal()\"\n [attr.data-test-id]=\"testIds.uploadButton\"\n >\n {{ 'Upload' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n </ng-container>\n</valtimo-carbon-list>\n\n<valtimo-decision-deploy #decisionDeploy></valtimo-decision-deploy>\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: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i4.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: "ngmodule", type: IconModule }, { kind: "directive", type: i6$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: WidgetModule }, { kind: "component", type: DecisionDeployComponent, selector: "valtimo-decision-deploy", outputs: ["deploySuccessful"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }] }); }
796
+ }
797
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionListComponent, decorators: [{
798
+ type: Component,
799
+ args: [{ selector: 'valtimo-decision-list', standalone: true, imports: [
800
+ CommonModule,
801
+ RouterModule,
802
+ CarbonListModule,
803
+ IconModule,
804
+ WidgetModule,
805
+ DecisionDeployComponent,
806
+ TranslateModule,
807
+ ButtonModule,
808
+ ], 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 [items]=\"(decisionsLatestVersions$ | async) || []\"\n [loading]=\"loading$ | async\"\n [fields]=\"fields\"\n (rowClicked)=\"viewDecisionTable($event)\"\n [header]=\"false\"\n [isSearchable]=\"true\"\n>\n <ng-container carbonToolbarContent>\n <button\n *ngIf=\"hasEditPermissions$ | async\"\n cdsButton=\"primary\"\n (click)=\"this.deploy.openModal()\"\n [attr.data-test-id]=\"testIds.uploadButton\"\n >\n {{ 'Upload' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n </ng-container>\n</valtimo-carbon-list>\n\n<valtimo-decision-deploy #decisionDeploy></valtimo-decision-deploy>\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"] }]
809
+ }], ctorParameters: () => [{ type: DecisionService }, { type: i6$1.IconService }, { type: i2.Router }, { type: i6.ConfigService }, { type: DecisionStateService }, { type: i2.ActivatedRoute }, { type: i0.ChangeDetectorRef }, { type: i6.EditPermissionsService }], propDecorators: { deploy: [{
810
+ type: ViewChild,
811
+ args: ['decisionDeploy']
812
+ }] } });
813
+
814
+ /*
815
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
816
+ *
817
+ * Licensed under EUPL, Version 1.2 (the "License");
818
+ * you may not use this file except in compliance with the License.
819
+ * You may obtain a copy of the License at
820
+ *
821
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
822
+ *
823
+ * Unless required by applicable law or agreed to in writing, software
824
+ * distributed under the License is distributed on an "AS IS" basis,
825
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
826
+ * See the License for the specific language governing permissions and
827
+ * limitations under the License.
828
+ */
829
+ const routes = [
830
+ {
831
+ path: 'decision-tables',
832
+ component: DecisionListComponent,
833
+ canActivate: [AuthGuardService],
834
+ data: {
835
+ title: 'Decision tables',
836
+ roles: [ROLE_ADMIN],
837
+ context: 'independent',
838
+ },
839
+ },
840
+ {
841
+ path: 'decision-tables/:id',
842
+ component: DecisionDisplayComponent,
843
+ canActivate: [AuthGuardService],
844
+ data: {
845
+ title: 'Decision tables',
846
+ roles: [ROLE_ADMIN],
847
+ context: 'independent',
848
+ },
849
+ },
850
+ {
851
+ path: 'decision-tables/edit/:id',
852
+ component: DecisionModelerComponent,
853
+ canActivate: [AuthGuardService],
854
+ data: {
855
+ title: 'Edit decision table',
856
+ roles: [ROLE_ADMIN],
857
+ customPageTitle: true,
858
+ context: 'independent',
859
+ },
860
+ },
861
+ {
862
+ path: 'decision-tables/edit/create',
863
+ component: DecisionModelerComponent,
864
+ canActivate: [AuthGuardService],
865
+ data: {
866
+ title: 'Create decision table',
867
+ roles: [ROLE_ADMIN],
868
+ context: 'independent',
869
+ },
870
+ },
871
+ ];
872
+ class DecisionRoutingModule {
873
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
874
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.20", ngImport: i0, type: DecisionRoutingModule, imports: [CommonModule, i2.RouterModule], exports: [RouterModule] }); }
875
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
876
+ }
877
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionRoutingModule, decorators: [{
878
+ type: NgModule,
879
+ args: [{
880
+ declarations: [],
881
+ imports: [CommonModule, RouterModule.forChild(routes)],
882
+ exports: [RouterModule],
883
+ }]
884
+ }] });
885
+
886
+ /*
887
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
888
+ *
889
+ * Licensed under EUPL, Version 1.2 (the "License");
890
+ * you may not use this file except in compliance with the License.
891
+ * You may obtain a copy of the License at
892
+ *
893
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
894
+ *
895
+ * Unless required by applicable law or agreed to in writing, software
896
+ * distributed under the License is distributed on an "AS IS" basis,
897
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
898
+ * See the License for the specific language governing permissions and
899
+ * limitations under the License.
900
+ */
901
+ class DecisionModule {
902
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
903
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.20", ngImport: i0, type: DecisionModule, imports: [DecisionRoutingModule,
904
+ WidgetModule,
905
+ TranslateModule,
906
+ ModalModule$1,
907
+ CommonModule,
908
+ FormsModule,
909
+ SelectModule$1,
910
+ SpinnerModule,
911
+ CarbonListModule,
912
+ ButtonModule,
913
+ IconModule,
914
+ DecisionDeployComponent,
915
+ DecisionModelerComponent,
916
+ DecisionListComponent,
917
+ DecisionDisplayComponent], exports: [DecisionModelerComponent] }); }
918
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionModule, imports: [DecisionRoutingModule,
919
+ WidgetModule,
920
+ TranslateModule,
921
+ ModalModule$1,
922
+ CommonModule,
923
+ FormsModule,
924
+ SelectModule$1,
925
+ SpinnerModule,
926
+ CarbonListModule,
927
+ ButtonModule,
928
+ IconModule,
929
+ DecisionDeployComponent,
930
+ DecisionModelerComponent,
931
+ DecisionListComponent,
932
+ DecisionDisplayComponent] }); }
933
+ }
934
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DecisionModule, decorators: [{
935
+ type: NgModule,
936
+ args: [{
937
+ imports: [
938
+ DecisionRoutingModule,
939
+ WidgetModule,
940
+ TranslateModule,
941
+ ModalModule$1,
942
+ CommonModule,
943
+ FormsModule,
944
+ SelectModule$1,
945
+ SpinnerModule,
946
+ CarbonListModule,
947
+ ButtonModule,
948
+ IconModule,
949
+ DecisionDeployComponent,
950
+ DecisionModelerComponent,
951
+ DecisionListComponent,
952
+ DecisionDisplayComponent,
953
+ ],
954
+ exports: [DecisionModelerComponent],
955
+ }]
956
+ }] });
957
+
958
+ /*
959
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
960
+ *
961
+ * Licensed under EUPL, Version 1.2 (the "License");
962
+ * you may not use this file except in compliance with the License.
963
+ * You may obtain a copy of the License at
964
+ *
965
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
966
+ *
967
+ * Unless required by applicable law or agreed to in writing, software
968
+ * distributed under the License is distributed on an "AS IS" basis,
969
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
970
+ * See the License for the specific language governing permissions and
971
+ * limitations under the License.
972
+ */
973
+ /*
974
+ * Public API Surface of decision
975
+ */
976
+
977
+ /**
978
+ * Generated bundle index. Do not edit.
979
+ */
980
+
981
+ export { DECISION_LIST_TEST_IDS, DECISION_MODELER_TEST_IDS, DECISION_UPLOAD_TEST_IDS, DecisionDeployComponent, DecisionDisplayComponent, DecisionListComponent, DecisionModelerComponent, DecisionModule, DecisionService, DecisionStateService, filterLatestDecisionVersions };
982
+ //# sourceMappingURL=valtimo-decision.mjs.map