@valtimo/decision 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/fesm2022/valtimo-decision.mjs +836 -0
- package/fesm2022/valtimo-decision.mjs.map +1 -0
- package/index.d.ts +6 -0
- package/lib/decision-deploy/decision-deploy.component.d.ts +30 -0
- package/lib/decision-deploy/decision-deploy.component.d.ts.map +1 -0
- package/lib/decision-display/decision-display.component.d.ts +21 -0
- package/lib/decision-display/decision-display.component.d.ts.map +1 -0
- package/lib/decision-list/decision-list.component.d.ts +36 -0
- package/lib/decision-list/decision-list.component.d.ts.map +1 -0
- package/lib/decision-modeler/decision-modeler.component.d.ts +64 -0
- package/lib/decision-modeler/decision-modeler.component.d.ts.map +1 -0
- package/lib/decision-modeler/empty-decision.d.ts +4 -0
- package/lib/decision-modeler/empty-decision.d.ts.map +1 -0
- package/lib/decision-routing.module.d.ts +9 -0
- package/lib/decision-routing.module.d.ts.map +1 -0
- package/lib/decision.module.d.ts +17 -0
- package/lib/decision.module.d.ts.map +1 -0
- package/lib/models/decision-management.model.d.ts +6 -0
- package/lib/models/decision-management.model.d.ts.map +1 -0
- package/lib/models/decision.model.d.ts +19 -0
- package/lib/models/decision.model.d.ts.map +1 -0
- package/lib/models/index.d.ts +3 -0
- package/lib/models/index.d.ts.map +1 -0
- package/lib/services/decision-state.service.d.ts +10 -0
- package/lib/services/decision-state.service.d.ts.map +1 -0
- package/lib/services/decision.service.d.ts +25 -0
- package/lib/services/decision.service.d.ts.map +1 -0
- package/lib/services/index.d.ts +3 -0
- package/lib/services/index.d.ts.map +1 -0
- package/package.json +26 -0
- package/public-api.d.ts +7 -0
- package/public-api.d.ts.map +1 -0
- package/valtimo-decision.d.ts.map +1 -0
|
@@ -0,0 +1,836 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Component, ViewEncapsulation, EventEmitter, Output, ViewChild, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/router';
|
|
4
|
+
import { RouterModule } from '@angular/router';
|
|
5
|
+
import * as i7 from '@angular/common';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import { AuthGuardService } from '@valtimo/security';
|
|
8
|
+
import * as i6 from '@valtimo/shared';
|
|
9
|
+
import { BaseApiService, InterceptorSkip, getCaseManagementRouteParams, getContextObservable, ROLE_ADMIN } from '@valtimo/shared';
|
|
10
|
+
import DmnJS from 'dmn-js/dist/dmn-modeler.development.js';
|
|
11
|
+
import { migrateDiagram } from '@bpmn-io/dmn-migrate';
|
|
12
|
+
import { BehaviorSubject, map, combineLatest, switchMap, tap, filter, take, from, of, catchError, Subject, startWith } from 'rxjs';
|
|
13
|
+
import * as i4 from '@valtimo/components';
|
|
14
|
+
import { PendingChangesComponent, WidgetModule, SelectModule as SelectModule$1, RenderInPageHeaderDirective, FitPageDirective, CarbonListModule, ModalModule as ModalModule$1, SpinnerModule } from '@valtimo/components';
|
|
15
|
+
import * as i3 from '@ngx-translate/core';
|
|
16
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
17
|
+
import * as i6$1 from 'carbon-components-angular';
|
|
18
|
+
import { ModalModule, SelectModule, ButtonModule, IconModule, DialogModule, LayerModule, FileUploaderModule } from 'carbon-components-angular';
|
|
19
|
+
import { Deploy16, Download16, ArrowLeft16, Upload16 } from '@carbon/icons';
|
|
20
|
+
import * as i1 from '@angular/common/http';
|
|
21
|
+
import { HttpHeaders } from '@angular/common/http';
|
|
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
|
+
const EMPTY_DECISION = {
|
|
90
|
+
id: '',
|
|
91
|
+
dmnXml: `<?xml version="1.0" encoding="UTF-8"?>
|
|
92
|
+
<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">
|
|
93
|
+
<decision id="Decision_1e18q76" name="Decision 1">
|
|
94
|
+
<decisionTable id="DecisionTable_1apu23m">
|
|
95
|
+
<input id="Input_1">
|
|
96
|
+
<inputExpression id="InputExpression_1" typeRef="string">
|
|
97
|
+
<text></text>
|
|
98
|
+
</inputExpression>
|
|
99
|
+
</input>
|
|
100
|
+
<output id="Output_1" typeRef="string" />
|
|
101
|
+
</decisionTable>
|
|
102
|
+
</decision>
|
|
103
|
+
<dmndi:DMNDI>
|
|
104
|
+
<dmndi:DMNDiagram>
|
|
105
|
+
<dmndi:DMNShape dmnElementRef="Decision_1e18q76">
|
|
106
|
+
<dc:Bounds height="80" width="180" x="160" y="100" />
|
|
107
|
+
</dmndi:DMNShape>
|
|
108
|
+
</dmndi:DMNDiagram>
|
|
109
|
+
</dmndi:DMNDI>
|
|
110
|
+
</definitions>
|
|
111
|
+
`,
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
116
|
+
*
|
|
117
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
118
|
+
* you may not use this file except in compliance with the License.
|
|
119
|
+
* You may obtain a copy of the License at
|
|
120
|
+
*
|
|
121
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
122
|
+
*
|
|
123
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
124
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
125
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
126
|
+
* See the License for the specific language governing permissions and
|
|
127
|
+
* limitations under the License.
|
|
128
|
+
*/
|
|
129
|
+
class DecisionService extends BaseApiService {
|
|
130
|
+
constructor(httpClient, configService) {
|
|
131
|
+
super(httpClient, configService);
|
|
132
|
+
this.httpClient = httpClient;
|
|
133
|
+
this.configService = configService;
|
|
134
|
+
}
|
|
135
|
+
deployDmn(dmn) {
|
|
136
|
+
const formData = new FormData();
|
|
137
|
+
formData.append('file', dmn);
|
|
138
|
+
formData.append('deployment-name', 'dmnTableDeploy');
|
|
139
|
+
formData.append('deployment-source', 'process application');
|
|
140
|
+
return this.httpClient.post(this.getApiUrl('/v1/process/definition/deployment'), formData);
|
|
141
|
+
}
|
|
142
|
+
getDecisions() {
|
|
143
|
+
return this.httpClient.get(this.getApiUrl('/operaton-rest/engine/default/decision-definition'));
|
|
144
|
+
}
|
|
145
|
+
getDecisionById(decisionId) {
|
|
146
|
+
return this.httpClient.get(this.getApiUrl(`/operaton-rest/engine/default/decision-definition/${decisionId}`));
|
|
147
|
+
}
|
|
148
|
+
getLatestDecisionByKey(decisionKey) {
|
|
149
|
+
return this.httpClient.get(this.getApiUrl(`/operaton-rest/engine/default/decision-definition/key/${decisionKey}`));
|
|
150
|
+
}
|
|
151
|
+
getDecisionXml(decisionId) {
|
|
152
|
+
return this.httpClient.get(this.getApiUrl(`/operaton-rest/engine/default/decision-definition/${decisionId}/xml`));
|
|
153
|
+
}
|
|
154
|
+
listCaseDecisionDefinitions(caseDefinitionKey, versionTag) {
|
|
155
|
+
return this.httpClient.get(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${versionTag}/decision-definition`));
|
|
156
|
+
}
|
|
157
|
+
deployCaseDecisionDefinition(caseDefinitionKey, versionTag, dmn) {
|
|
158
|
+
const formData = new FormData();
|
|
159
|
+
formData.append('file', dmn);
|
|
160
|
+
return this.httpClient.post(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${versionTag}/decision-definition`), formData, {
|
|
161
|
+
headers: new HttpHeaders().set(InterceptorSkip, '204'),
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
deleteCaseDecisionDefinition(caseDefinitionKey, versionTag, decisionDefinitionKey) {
|
|
165
|
+
return this.httpClient.delete(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${versionTag}/decision-definition/${decisionDefinitionKey}`));
|
|
166
|
+
}
|
|
167
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionService, deps: [{ token: i1.HttpClient }, { token: i6.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
168
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionService, providedIn: 'root' }); }
|
|
169
|
+
}
|
|
170
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionService, decorators: [{
|
|
171
|
+
type: Injectable,
|
|
172
|
+
args: [{
|
|
173
|
+
providedIn: 'root',
|
|
174
|
+
}]
|
|
175
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i6.ConfigService }] });
|
|
176
|
+
|
|
177
|
+
class DecisionModelerComponent extends PendingChangesComponent {
|
|
178
|
+
constructor(decisionService, route, router, translateService, pageTitleService, breadcrumbService, iconService, pageHeaderService, notificationService, editPermissionsService) {
|
|
179
|
+
super();
|
|
180
|
+
this.decisionService = decisionService;
|
|
181
|
+
this.route = route;
|
|
182
|
+
this.router = router;
|
|
183
|
+
this.translateService = translateService;
|
|
184
|
+
this.pageTitleService = pageTitleService;
|
|
185
|
+
this.breadcrumbService = breadcrumbService;
|
|
186
|
+
this.iconService = iconService;
|
|
187
|
+
this.pageHeaderService = pageHeaderService;
|
|
188
|
+
this.notificationService = notificationService;
|
|
189
|
+
this.editPermissionsService = editPermissionsService;
|
|
190
|
+
this.CLASS_NAMES = {
|
|
191
|
+
drd: 'dmn-icon-lasso-tool',
|
|
192
|
+
decisionTable: 'dmn-icon-decision-table',
|
|
193
|
+
literalExpression: 'dmn-icon-literal-expression',
|
|
194
|
+
};
|
|
195
|
+
this.versionSelectionDisabled$ = new BehaviorSubject(true);
|
|
196
|
+
this.isCreating$ = new BehaviorSubject(false);
|
|
197
|
+
this.selectionId$ = new BehaviorSubject('');
|
|
198
|
+
this.caseManagementRouteParams$ = getCaseManagementRouteParams(this.route);
|
|
199
|
+
this.context$ = getContextObservable(this.route);
|
|
200
|
+
this.isIndependent$ = this.context$.pipe(map(context => context === 'independent'));
|
|
201
|
+
this.compactMode$ = this.pageHeaderService.compactMode$;
|
|
202
|
+
this.hasEditPermissions$ = combineLatest([
|
|
203
|
+
this.caseManagementRouteParams$,
|
|
204
|
+
this.context$,
|
|
205
|
+
]).pipe(switchMap(([params, context]) => this.editPermissionsService.hasPermissionsToEditBasedOnContext(params?.caseDefinitionKey ?? '', params?.caseDefinitionVersionTag ?? '', context ?? '')));
|
|
206
|
+
this.decisionId$ = this.route.params.pipe(map(params => params?.id), tap(id => {
|
|
207
|
+
this.isCreating$.next(id === 'create');
|
|
208
|
+
this.versionSelectionDisabled$.next(true);
|
|
209
|
+
}), filter(id => !!id && id !== 'create'));
|
|
210
|
+
this.decision$ = this.decisionId$.pipe(switchMap(id => this.decisionService.getDecisionById(id)), tap(decision => {
|
|
211
|
+
this._fileName = decision.resource;
|
|
212
|
+
if (decision)
|
|
213
|
+
this.selectionId$.next(decision.id);
|
|
214
|
+
}));
|
|
215
|
+
this.decisionTitle$ = this.decision$.pipe(map(d => d?.name || d?.key || '-'), tap(title => this.pageTitleService.setCustomPageTitle(title)));
|
|
216
|
+
this._refreshDecisionSelectItems$ = new BehaviorSubject(null);
|
|
217
|
+
this.decisionVersionSelectItems$ = this._refreshDecisionSelectItems$.pipe(switchMap(() => combineLatest([this.decision$, this.decisionService.getDecisions()])), map(([current, list]) => {
|
|
218
|
+
const filtered = list.filter(d => d.key === current.key);
|
|
219
|
+
return [...filtered.map(d => ({ id: d.id, text: d.version.toString() }))].sort((a, b) => +(b.text ?? '') - +(a.text ?? ''));
|
|
220
|
+
}), tap(() => this.versionSelectionDisabled$.next(false)));
|
|
221
|
+
this.decisionXml$ = this.decisionId$.pipe(switchMap(id => this.decisionService.getDecisionXml(id)), tap(xml => xml && this.loadDecisionXml(xml)));
|
|
222
|
+
this.iconService.registerAll([Deploy16, Download16, ArrowLeft16]);
|
|
223
|
+
}
|
|
224
|
+
ngOnInit() {
|
|
225
|
+
this.pageTitleService.disableReset();
|
|
226
|
+
}
|
|
227
|
+
ngOnDestroy() {
|
|
228
|
+
this.pageTitleService.enableReset();
|
|
229
|
+
}
|
|
230
|
+
ngAfterViewInit() {
|
|
231
|
+
this.setProperties();
|
|
232
|
+
this.setTabEvents();
|
|
233
|
+
this.setModelerEvents();
|
|
234
|
+
combineLatest([this.caseManagementRouteParams$, this.context$])
|
|
235
|
+
.pipe(take(1))
|
|
236
|
+
.subscribe(([params, context]) => {
|
|
237
|
+
if (!params || !context)
|
|
238
|
+
return;
|
|
239
|
+
this.initBreadcrumbs(params, context);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
switchVersion(decisionId) {
|
|
243
|
+
if (!decisionId)
|
|
244
|
+
return;
|
|
245
|
+
this.router.navigate(['../', decisionId], { relativeTo: this.route });
|
|
246
|
+
this._refreshDecisionSelectItems$.next(null);
|
|
247
|
+
}
|
|
248
|
+
deploy() {
|
|
249
|
+
from(this.dmnModeler.saveXML({ format: true }))
|
|
250
|
+
.pipe(map(result => new File([result.xml], this._fileName, { type: 'text/xml' })), switchMap(file => combineLatest([of(file), this.context$])), switchMap(([file, context]) => context === 'independent'
|
|
251
|
+
? this.decisionService.deployDmn(file)
|
|
252
|
+
: this.caseManagementRouteParams$.pipe(switchMap(params => this.decisionService.deployCaseDecisionDefinition(params?.caseDefinitionKey ?? '', params?.caseDefinitionVersionTag ?? '', file)))), tap((res) => {
|
|
253
|
+
this.switchVersion(res.identifier);
|
|
254
|
+
this.showNotification('success', 'decisions.deploySuccess');
|
|
255
|
+
}), catchError(() => {
|
|
256
|
+
this.showNotification('error', 'decisions.deployFailure');
|
|
257
|
+
return of(null);
|
|
258
|
+
}))
|
|
259
|
+
.subscribe();
|
|
260
|
+
}
|
|
261
|
+
download() {
|
|
262
|
+
from(this.dmnModeler.saveXML({ format: true }))
|
|
263
|
+
.pipe(map(result => new File([result.xml], 'decision.dmn', { type: 'text/xml' })), tap(file => {
|
|
264
|
+
const link = document.createElement('a');
|
|
265
|
+
link.download = 'diagram.dmn';
|
|
266
|
+
link.href = window.URL.createObjectURL(file);
|
|
267
|
+
link.click();
|
|
268
|
+
window.URL.revokeObjectURL(link.href);
|
|
269
|
+
link.remove();
|
|
270
|
+
}))
|
|
271
|
+
.subscribe();
|
|
272
|
+
}
|
|
273
|
+
navigateBack(notification, message) {
|
|
274
|
+
this.router.navigate(['../'], { relativeTo: this.route });
|
|
275
|
+
if (!notification)
|
|
276
|
+
return;
|
|
277
|
+
this.showNotification(notification, message);
|
|
278
|
+
}
|
|
279
|
+
showNotification(notification, message) {
|
|
280
|
+
if (!notification)
|
|
281
|
+
return;
|
|
282
|
+
this.notificationService.showToast({
|
|
283
|
+
caption: this.translateService.instant(message),
|
|
284
|
+
type: notification,
|
|
285
|
+
title: this.translateService.instant(`interface.${notification}`),
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
setProperties() {
|
|
289
|
+
const isCreating = this.isCreating$.getValue();
|
|
290
|
+
this.$container = $('.editor-container');
|
|
291
|
+
this.$tabs = $('.editor-tabs');
|
|
292
|
+
this.dmnModeler = new DmnJS({
|
|
293
|
+
container: this.$container,
|
|
294
|
+
height: 500,
|
|
295
|
+
width: '100%',
|
|
296
|
+
keyboard: { bindTo: window },
|
|
297
|
+
});
|
|
298
|
+
if (isCreating)
|
|
299
|
+
this.loadEmptyDecisionTable();
|
|
300
|
+
}
|
|
301
|
+
loadEmptyDecisionTable() {
|
|
302
|
+
this.loadDecisionXml(EMPTY_DECISION);
|
|
303
|
+
}
|
|
304
|
+
setTabEvents() {
|
|
305
|
+
this.$tabs.delegate('.tab', 'click', async (event) => {
|
|
306
|
+
const index = +event.currentTarget.getAttribute('data-id');
|
|
307
|
+
const view = this.dmnModeler.getViews()[index];
|
|
308
|
+
try {
|
|
309
|
+
await this.dmnModeler.open(view);
|
|
310
|
+
}
|
|
311
|
+
catch (err) {
|
|
312
|
+
console.error('tab open error', err);
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
setModelerEvents() {
|
|
317
|
+
this.dmnModeler.on('views.changed', event => {
|
|
318
|
+
const { views, activeView } = event;
|
|
319
|
+
this.$tabs.empty();
|
|
320
|
+
views.forEach((v, i) => {
|
|
321
|
+
const className = this.CLASS_NAMES[v.type];
|
|
322
|
+
const tab = $(`<div class="tab ${v === activeView ? 'active' : ''}" data-id="${i}"><span class="${className}"></span>${v.element.name || v.element.id}</div>`);
|
|
323
|
+
this.$tabs.append(tab);
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
loadDecisionXml(decision) {
|
|
328
|
+
from(this.dmnModeler.importXML(decision.dmnXml))
|
|
329
|
+
.pipe(tap(() => this.setEditor()), catchError(() => {
|
|
330
|
+
this.migrateAndLoadDecisionXml(decision);
|
|
331
|
+
return of(null);
|
|
332
|
+
}))
|
|
333
|
+
.subscribe();
|
|
334
|
+
}
|
|
335
|
+
migrateAndLoadDecisionXml(decision) {
|
|
336
|
+
from(migrateDiagram(decision.dmnXml))
|
|
337
|
+
.pipe(switchMap(xml => this.dmnModeler.importXML(xml)), tap(() => this.setEditor()), catchError(() => {
|
|
338
|
+
this.showNotification('error', 'decisions.loadFailure');
|
|
339
|
+
return of(null);
|
|
340
|
+
}))
|
|
341
|
+
.subscribe();
|
|
342
|
+
}
|
|
343
|
+
setEditor() {
|
|
344
|
+
const view = this.dmnModeler.getActiveView();
|
|
345
|
+
if (view?.type === 'drd') {
|
|
346
|
+
const canvas = this.dmnModeler.getActiveViewer().get('canvas');
|
|
347
|
+
canvas.zoom('fit-viewport');
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
initBreadcrumbs(params, context) {
|
|
351
|
+
if (context === 'independent')
|
|
352
|
+
return;
|
|
353
|
+
const route = `/case-management/case/${params.caseDefinitionKey}/version/${params.caseDefinitionVersionTag}`;
|
|
354
|
+
this.breadcrumbService.setThirdBreadcrumb({
|
|
355
|
+
route: [route],
|
|
356
|
+
content: `${params.caseDefinitionKey} (${params.caseDefinitionVersionTag})`,
|
|
357
|
+
href: route,
|
|
358
|
+
});
|
|
359
|
+
const routeWithDecisions = `${route}/decisions`;
|
|
360
|
+
this.breadcrumbService.setFourthBreadcrumb({
|
|
361
|
+
route: [routeWithDecisions],
|
|
362
|
+
content: this.translateService.instant('caseManagement.tabs.decision'),
|
|
363
|
+
href: routeWithDecisions,
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", 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 }); }
|
|
367
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", 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 >\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 >\n {{ 'decisions.deploy' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"deploy\" size=\"16\"></svg>\n </button>\n\n <cds-overflow-menu class=\"overflow-button\">\n <cds-overflow-menu-option (selected)=\"download()\"\n >{{ 'interface.export' | translate }}\n </cds-overflow-menu-option>\n </cds-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", "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", "disabled", "disableOverflow"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i6$1.OverflowMenu, selector: "cds-overflow-menu, ibm-overflow-menu", inputs: ["buttonLabel", "description", "flip", "placement", "open", "customTrigger", "offset", "wrapperClass", "triggerClass"], outputs: ["openChange"] }, { kind: "component", type: i6$1.OverflowMenuOption, selector: "cds-overflow-menu-option, ibm-overflow-menu-option", inputs: ["divider", "type", "disabled", "href", "target", "innerClass"], outputs: ["selected"] }] }); }
|
|
368
|
+
}
|
|
369
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionModelerComponent, decorators: [{
|
|
370
|
+
type: Component,
|
|
371
|
+
args: [{ selector: 'valtimo-decision-modeler', standalone: true, imports: [
|
|
372
|
+
CommonModule,
|
|
373
|
+
RouterModule,
|
|
374
|
+
ModalModule,
|
|
375
|
+
SelectModule,
|
|
376
|
+
WidgetModule,
|
|
377
|
+
SelectModule$1,
|
|
378
|
+
TranslateModule,
|
|
379
|
+
RenderInPageHeaderDirective,
|
|
380
|
+
ButtonModule,
|
|
381
|
+
IconModule,
|
|
382
|
+
FitPageDirective,
|
|
383
|
+
DialogModule,
|
|
384
|
+
], 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 >\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 >\n {{ 'decisions.deploy' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"deploy\" size=\"16\"></svg>\n </button>\n\n <cds-overflow-menu class=\"overflow-button\">\n <cds-overflow-menu-option (selected)=\"download()\"\n >{{ 'interface.export' | translate }}\n </cds-overflow-menu-option>\n </cds-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"] }]
|
|
385
|
+
}], 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 }] });
|
|
386
|
+
|
|
387
|
+
/*
|
|
388
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
389
|
+
*
|
|
390
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
391
|
+
* you may not use this file except in compliance with the License.
|
|
392
|
+
* You may obtain a copy of the License at
|
|
393
|
+
*
|
|
394
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
395
|
+
*
|
|
396
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
397
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
398
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
399
|
+
* See the License for the specific language governing permissions and
|
|
400
|
+
* limitations under the License.
|
|
401
|
+
*/
|
|
402
|
+
class DecisionDisplayComponent {
|
|
403
|
+
constructor(decisionService, route) {
|
|
404
|
+
this.decisionService = decisionService;
|
|
405
|
+
this.route = route;
|
|
406
|
+
}
|
|
407
|
+
ngOnInit() {
|
|
408
|
+
this.viewer = new DmnViewer({
|
|
409
|
+
container: '#canvas',
|
|
410
|
+
});
|
|
411
|
+
this.decisionId = this.route.snapshot.paramMap.get('id');
|
|
412
|
+
this.loadDecisionXml();
|
|
413
|
+
}
|
|
414
|
+
loadDecisionXml() {
|
|
415
|
+
this.decisionService.getDecisionXml(this.decisionId).subscribe((decision) => {
|
|
416
|
+
this.viewer.importXML(decision.dmnXml, error => {
|
|
417
|
+
if (error) {
|
|
418
|
+
this.migrateAndLoadDecisionXml(decision);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
this.decisionXml = decision.dmnXml;
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
async migrateAndLoadDecisionXml(decision) {
|
|
425
|
+
const decisionXml = await migrateDiagram(decision.dmnXml);
|
|
426
|
+
if (decisionXml) {
|
|
427
|
+
this.viewer.importXML(decisionXml, error => {
|
|
428
|
+
if (error) {
|
|
429
|
+
console.error('Error importing migrated XML', error);
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
this.decisionXml = decisionXml;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
download() {
|
|
436
|
+
const file = new Blob([this.decisionXml], { type: 'text/xml' });
|
|
437
|
+
const link = document.createElement('a');
|
|
438
|
+
link.download = `decision_table_${this.decisionId}.dmn`;
|
|
439
|
+
link.href = window.URL.createObjectURL(file);
|
|
440
|
+
link.click();
|
|
441
|
+
window.URL.revokeObjectURL(link.href);
|
|
442
|
+
link.remove();
|
|
443
|
+
}
|
|
444
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionDisplayComponent, deps: [{ token: DecisionService }, { token: i2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
445
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", 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> \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 }); }
|
|
446
|
+
}
|
|
447
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionDisplayComponent, decorators: [{
|
|
448
|
+
type: Component,
|
|
449
|
+
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> \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"] }]
|
|
450
|
+
}], ctorParameters: () => [{ type: DecisionService }, { type: i2.ActivatedRoute }] });
|
|
451
|
+
|
|
452
|
+
/*
|
|
453
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
454
|
+
*
|
|
455
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
456
|
+
* you may not use this file except in compliance with the License.
|
|
457
|
+
* You may obtain a copy of the License at
|
|
458
|
+
*
|
|
459
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
460
|
+
*
|
|
461
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
462
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
463
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
464
|
+
* See the License for the specific language governing permissions and
|
|
465
|
+
* limitations under the License.
|
|
466
|
+
*/
|
|
467
|
+
class DecisionStateService {
|
|
468
|
+
constructor() {
|
|
469
|
+
this._refreshDecisions$ = new Subject();
|
|
470
|
+
}
|
|
471
|
+
get refreshDecisions$() {
|
|
472
|
+
return this._refreshDecisions$.asObservable().pipe(startWith(null));
|
|
473
|
+
}
|
|
474
|
+
refreshDecisions() {
|
|
475
|
+
this._refreshDecisions$.next(null);
|
|
476
|
+
}
|
|
477
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
478
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionStateService, providedIn: 'root' }); }
|
|
479
|
+
}
|
|
480
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionStateService, decorators: [{
|
|
481
|
+
type: Injectable,
|
|
482
|
+
args: [{
|
|
483
|
+
providedIn: 'root',
|
|
484
|
+
}]
|
|
485
|
+
}] });
|
|
486
|
+
|
|
487
|
+
/*
|
|
488
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
489
|
+
*
|
|
490
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
491
|
+
* you may not use this file except in compliance with the License.
|
|
492
|
+
* You may obtain a copy of the License at
|
|
493
|
+
*
|
|
494
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
495
|
+
*
|
|
496
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
497
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
498
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
499
|
+
* See the License for the specific language governing permissions and
|
|
500
|
+
* limitations under the License.
|
|
501
|
+
*/
|
|
502
|
+
|
|
503
|
+
/*
|
|
504
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
505
|
+
*
|
|
506
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
507
|
+
* you may not use this file except in compliance with the License.
|
|
508
|
+
* You may obtain a copy of the License at
|
|
509
|
+
*
|
|
510
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
511
|
+
*
|
|
512
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
513
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
514
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
515
|
+
* See the License for the specific language governing permissions and
|
|
516
|
+
* limitations under the License.
|
|
517
|
+
*/
|
|
518
|
+
class DecisionDeployComponent {
|
|
519
|
+
constructor(decisionService, stateService, route, formBuilder) {
|
|
520
|
+
this.decisionService = decisionService;
|
|
521
|
+
this.stateService = stateService;
|
|
522
|
+
this.route = route;
|
|
523
|
+
this.formBuilder = formBuilder;
|
|
524
|
+
this.deploySuccessful = new EventEmitter();
|
|
525
|
+
this.dmn = null;
|
|
526
|
+
this.modalOpen$ = new BehaviorSubject(false);
|
|
527
|
+
this.caseManagementRouteParams$ = getCaseManagementRouteParams(this.route);
|
|
528
|
+
this.context$ = getContextObservable(this.route);
|
|
529
|
+
this.ACCEPTED_FILES = ['dmn'];
|
|
530
|
+
this.form = this.formBuilder.group({
|
|
531
|
+
file: this.formBuilder.control(new Set(), [Validators.required]),
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
get selectedDmnFile() {
|
|
535
|
+
const fileSet = this.form.value?.file;
|
|
536
|
+
return fileSet?.size ? fileSet.values().next().value?.file || null : null;
|
|
537
|
+
}
|
|
538
|
+
onChange(files) {
|
|
539
|
+
this.dmn = files.item(0);
|
|
540
|
+
}
|
|
541
|
+
deployDmn() {
|
|
542
|
+
const dmnFile = this.selectedDmnFile;
|
|
543
|
+
if (!dmnFile)
|
|
544
|
+
return;
|
|
545
|
+
combineLatest([this.caseManagementRouteParams$, this.context$])
|
|
546
|
+
.pipe(take(1), switchMap(([params, context]) => context === 'case'
|
|
547
|
+
? this.decisionService.deployCaseDecisionDefinition(params.caseDefinitionKey, params.caseDefinitionVersionTag, dmnFile)
|
|
548
|
+
: this.decisionService.deployDmn(dmnFile)))
|
|
549
|
+
.subscribe(() => {
|
|
550
|
+
this.closeModal();
|
|
551
|
+
this.deploySuccessful.emit();
|
|
552
|
+
this.stateService.refreshDecisions();
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
openModal() {
|
|
556
|
+
this.modalOpen$.next(true);
|
|
557
|
+
}
|
|
558
|
+
closeModal() {
|
|
559
|
+
this.modalOpen$.next(false);
|
|
560
|
+
}
|
|
561
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionDeployComponent, deps: [{ token: DecisionService }, { token: DecisionStateService }, { token: i2.ActivatedRoute }, { token: i3$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
562
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", 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=\"ghost\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button cdsButton=\"primary\" [disabled]=\"!selectedDmnFile\" (click)=\"deployDmn()\">\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"] }] }); }
|
|
563
|
+
}
|
|
564
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionDeployComponent, decorators: [{
|
|
565
|
+
type: Component,
|
|
566
|
+
args: [{ selector: 'valtimo-decision-deploy', standalone: true, imports: [
|
|
567
|
+
CommonModule,
|
|
568
|
+
FormsModule,
|
|
569
|
+
TranslateModule,
|
|
570
|
+
ModalModule,
|
|
571
|
+
ButtonModule,
|
|
572
|
+
LayerModule,
|
|
573
|
+
FileUploaderModule,
|
|
574
|
+
ReactiveFormsModule,
|
|
575
|
+
], 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=\"ghost\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button cdsButton=\"primary\" [disabled]=\"!selectedDmnFile\" (click)=\"deployDmn()\">\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"] }]
|
|
576
|
+
}], ctorParameters: () => [{ type: DecisionService }, { type: DecisionStateService }, { type: i2.ActivatedRoute }, { type: i3$1.FormBuilder }], propDecorators: { deploySuccessful: [{
|
|
577
|
+
type: Output
|
|
578
|
+
}] } });
|
|
579
|
+
|
|
580
|
+
/*
|
|
581
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
582
|
+
*
|
|
583
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
584
|
+
* you may not use this file except in compliance with the License.
|
|
585
|
+
* You may obtain a copy of the License at
|
|
586
|
+
*
|
|
587
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
588
|
+
*
|
|
589
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
590
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
591
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
592
|
+
* See the License for the specific language governing permissions and
|
|
593
|
+
* limitations under the License.
|
|
594
|
+
*/
|
|
595
|
+
class DecisionListComponent {
|
|
596
|
+
constructor(decisionService, iconService, router, configService, stateService, route, cdr, editPermissionsService) {
|
|
597
|
+
this.decisionService = decisionService;
|
|
598
|
+
this.iconService = iconService;
|
|
599
|
+
this.router = router;
|
|
600
|
+
this.configService = configService;
|
|
601
|
+
this.stateService = stateService;
|
|
602
|
+
this.route = route;
|
|
603
|
+
this.cdr = cdr;
|
|
604
|
+
this.editPermissionsService = editPermissionsService;
|
|
605
|
+
this.fields = [
|
|
606
|
+
{ key: 'key', label: 'Key' },
|
|
607
|
+
{ key: 'name', label: 'Name' },
|
|
608
|
+
{ key: 'version', label: 'Version' },
|
|
609
|
+
];
|
|
610
|
+
this.loading$ = new BehaviorSubject(true);
|
|
611
|
+
this.caseManagementRouteParams$ = getCaseManagementRouteParams(this.route);
|
|
612
|
+
this.context$ = getContextObservable(this.route);
|
|
613
|
+
this.decisionsLatestVersions$ = this.stateService.refreshDecisions$.pipe(switchMap(() => this.context$), switchMap(context => context === 'case'
|
|
614
|
+
? this.caseManagementRouteParams$.pipe(switchMap(params => this.decisionService.listCaseDecisionDefinitions(params.caseDefinitionKey, params.caseDefinitionVersionTag)))
|
|
615
|
+
: this.decisionService.getDecisions()), map(decisions => decisions.reduce((acc, curr) => {
|
|
616
|
+
const existing = acc.find(d => d.key === curr.key);
|
|
617
|
+
if (existing && existing.version > curr.version)
|
|
618
|
+
return acc;
|
|
619
|
+
if (existing && existing.version < curr.version)
|
|
620
|
+
return [...acc.filter(d => d.key !== curr.key), curr];
|
|
621
|
+
return [...acc, curr];
|
|
622
|
+
}, [])), tap(() => {
|
|
623
|
+
this.loading$.next(false);
|
|
624
|
+
this.cdr.detectChanges();
|
|
625
|
+
}));
|
|
626
|
+
this.hasEditPermissions$ = combineLatest([
|
|
627
|
+
this.caseManagementRouteParams$,
|
|
628
|
+
this.context$,
|
|
629
|
+
]).pipe(switchMap(([params, context]) => {
|
|
630
|
+
return this.editPermissionsService.hasPermissionsToEditBasedOnContext(params?.caseDefinitionKey, params?.caseDefinitionVersionTag, context);
|
|
631
|
+
}));
|
|
632
|
+
this.iconService.registerAll([Upload16]);
|
|
633
|
+
this.experimentalEditing = this.configService.config.featureToggles.experimentalDmnEditing;
|
|
634
|
+
}
|
|
635
|
+
viewDecisionTable(decision) {
|
|
636
|
+
this.context$.pipe(take(1)).subscribe(context => {
|
|
637
|
+
if (context === 'independent') {
|
|
638
|
+
const basePath = this.experimentalEditing ? '/decision-tables/edit/' : '/decision-tables/';
|
|
639
|
+
this.router.navigate([basePath + decision.id]);
|
|
640
|
+
}
|
|
641
|
+
else {
|
|
642
|
+
this.caseManagementRouteParams$.pipe(take(1)).subscribe(params => {
|
|
643
|
+
this.router.navigateByUrl(`case-management/case/${params.caseDefinitionKey}/version/${params.caseDefinitionVersionTag}/decisions/${decision.id}`);
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", 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 }); }
|
|
649
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", 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 >\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", "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"] }] }); }
|
|
650
|
+
}
|
|
651
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionListComponent, decorators: [{
|
|
652
|
+
type: Component,
|
|
653
|
+
args: [{ selector: 'valtimo-decision-list', standalone: true, imports: [
|
|
654
|
+
CommonModule,
|
|
655
|
+
RouterModule,
|
|
656
|
+
CarbonListModule,
|
|
657
|
+
IconModule,
|
|
658
|
+
WidgetModule,
|
|
659
|
+
DecisionDeployComponent,
|
|
660
|
+
TranslateModule,
|
|
661
|
+
ButtonModule,
|
|
662
|
+
], 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 >\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"] }]
|
|
663
|
+
}], 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: [{
|
|
664
|
+
type: ViewChild,
|
|
665
|
+
args: ['decisionDeploy']
|
|
666
|
+
}] } });
|
|
667
|
+
|
|
668
|
+
/*
|
|
669
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
670
|
+
*
|
|
671
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
672
|
+
* you may not use this file except in compliance with the License.
|
|
673
|
+
* You may obtain a copy of the License at
|
|
674
|
+
*
|
|
675
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
676
|
+
*
|
|
677
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
678
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
679
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
680
|
+
* See the License for the specific language governing permissions and
|
|
681
|
+
* limitations under the License.
|
|
682
|
+
*/
|
|
683
|
+
const routes = [
|
|
684
|
+
{
|
|
685
|
+
path: 'decision-tables',
|
|
686
|
+
component: DecisionListComponent,
|
|
687
|
+
canActivate: [AuthGuardService],
|
|
688
|
+
data: {
|
|
689
|
+
title: 'Decision tables',
|
|
690
|
+
roles: [ROLE_ADMIN],
|
|
691
|
+
context: 'independent',
|
|
692
|
+
},
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
path: 'decision-tables/:id',
|
|
696
|
+
component: DecisionDisplayComponent,
|
|
697
|
+
canActivate: [AuthGuardService],
|
|
698
|
+
data: {
|
|
699
|
+
title: 'Decision tables',
|
|
700
|
+
roles: [ROLE_ADMIN],
|
|
701
|
+
context: 'independent',
|
|
702
|
+
},
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
path: 'decision-tables/edit/:id',
|
|
706
|
+
component: DecisionModelerComponent,
|
|
707
|
+
canActivate: [AuthGuardService],
|
|
708
|
+
data: {
|
|
709
|
+
title: 'Edit decision table',
|
|
710
|
+
roles: [ROLE_ADMIN],
|
|
711
|
+
customPageTitle: true,
|
|
712
|
+
context: 'independent',
|
|
713
|
+
},
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
path: 'decision-tables/edit/create',
|
|
717
|
+
component: DecisionModelerComponent,
|
|
718
|
+
canActivate: [AuthGuardService],
|
|
719
|
+
data: {
|
|
720
|
+
title: 'Create decision table',
|
|
721
|
+
roles: [ROLE_ADMIN],
|
|
722
|
+
context: 'independent',
|
|
723
|
+
},
|
|
724
|
+
},
|
|
725
|
+
];
|
|
726
|
+
class DecisionRoutingModule {
|
|
727
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
728
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: DecisionRoutingModule, imports: [CommonModule, i2.RouterModule], exports: [RouterModule] }); }
|
|
729
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
|
|
730
|
+
}
|
|
731
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionRoutingModule, decorators: [{
|
|
732
|
+
type: NgModule,
|
|
733
|
+
args: [{
|
|
734
|
+
declarations: [],
|
|
735
|
+
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
736
|
+
exports: [RouterModule],
|
|
737
|
+
}]
|
|
738
|
+
}] });
|
|
739
|
+
|
|
740
|
+
/*
|
|
741
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
742
|
+
*
|
|
743
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
744
|
+
* you may not use this file except in compliance with the License.
|
|
745
|
+
* You may obtain a copy of the License at
|
|
746
|
+
*
|
|
747
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
748
|
+
*
|
|
749
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
750
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
751
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
752
|
+
* See the License for the specific language governing permissions and
|
|
753
|
+
* limitations under the License.
|
|
754
|
+
*/
|
|
755
|
+
class DecisionModule {
|
|
756
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
757
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: DecisionModule, imports: [DecisionRoutingModule,
|
|
758
|
+
WidgetModule,
|
|
759
|
+
TranslateModule,
|
|
760
|
+
ModalModule$1,
|
|
761
|
+
CommonModule,
|
|
762
|
+
FormsModule,
|
|
763
|
+
SelectModule$1,
|
|
764
|
+
SpinnerModule,
|
|
765
|
+
CarbonListModule,
|
|
766
|
+
ButtonModule,
|
|
767
|
+
IconModule,
|
|
768
|
+
DecisionDeployComponent,
|
|
769
|
+
DecisionModelerComponent,
|
|
770
|
+
DecisionListComponent,
|
|
771
|
+
DecisionDisplayComponent], exports: [DecisionModelerComponent] }); }
|
|
772
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionModule, imports: [DecisionRoutingModule,
|
|
773
|
+
WidgetModule,
|
|
774
|
+
TranslateModule,
|
|
775
|
+
ModalModule$1,
|
|
776
|
+
CommonModule,
|
|
777
|
+
FormsModule,
|
|
778
|
+
SelectModule$1,
|
|
779
|
+
SpinnerModule,
|
|
780
|
+
CarbonListModule,
|
|
781
|
+
ButtonModule,
|
|
782
|
+
IconModule,
|
|
783
|
+
DecisionDeployComponent,
|
|
784
|
+
DecisionModelerComponent,
|
|
785
|
+
DecisionListComponent,
|
|
786
|
+
DecisionDisplayComponent] }); }
|
|
787
|
+
}
|
|
788
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DecisionModule, decorators: [{
|
|
789
|
+
type: NgModule,
|
|
790
|
+
args: [{
|
|
791
|
+
imports: [
|
|
792
|
+
DecisionRoutingModule,
|
|
793
|
+
WidgetModule,
|
|
794
|
+
TranslateModule,
|
|
795
|
+
ModalModule$1,
|
|
796
|
+
CommonModule,
|
|
797
|
+
FormsModule,
|
|
798
|
+
SelectModule$1,
|
|
799
|
+
SpinnerModule,
|
|
800
|
+
CarbonListModule,
|
|
801
|
+
ButtonModule,
|
|
802
|
+
IconModule,
|
|
803
|
+
DecisionDeployComponent,
|
|
804
|
+
DecisionModelerComponent,
|
|
805
|
+
DecisionListComponent,
|
|
806
|
+
DecisionDisplayComponent,
|
|
807
|
+
],
|
|
808
|
+
exports: [DecisionModelerComponent],
|
|
809
|
+
}]
|
|
810
|
+
}] });
|
|
811
|
+
|
|
812
|
+
/*
|
|
813
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
814
|
+
*
|
|
815
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
816
|
+
* you may not use this file except in compliance with the License.
|
|
817
|
+
* You may obtain a copy of the License at
|
|
818
|
+
*
|
|
819
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
820
|
+
*
|
|
821
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
822
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
823
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
824
|
+
* See the License for the specific language governing permissions and
|
|
825
|
+
* limitations under the License.
|
|
826
|
+
*/
|
|
827
|
+
/*
|
|
828
|
+
* Public API Surface of decision
|
|
829
|
+
*/
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* Generated bundle index. Do not edit.
|
|
833
|
+
*/
|
|
834
|
+
|
|
835
|
+
export { DecisionDeployComponent, DecisionDisplayComponent, DecisionListComponent, DecisionModelerComponent, DecisionModule };
|
|
836
|
+
//# sourceMappingURL=valtimo-decision.mjs.map
|