@sapui5/sap.rules.ui 1.106.0 → 1.108.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/package.json +1 -1
- package/src/sap/rules/ui/.library +1 -1
- package/src/sap/rules/ui/AstExpressionBasic.js +27 -6
- package/src/sap/rules/ui/AstExpressionBasicRenderer.js +71 -55
- package/src/sap/rules/ui/AutoCompleteSuggestionContent.js +5 -3
- package/src/sap/rules/ui/AutoCompleteSuggestionContentRenderer.js +39 -40
- package/src/sap/rules/ui/BindingSpy.js +1 -1
- package/src/sap/rules/ui/DecisionTable.js +2157 -2154
- package/src/sap/rules/ui/DecisionTableCell.js +7 -4
- package/src/sap/rules/ui/DecisionTableCellAstExpressionBasic.js +7 -4
- package/src/sap/rules/ui/DecisionTableCellAstExpressionBasicRenderer.js +5 -3
- package/src/sap/rules/ui/DecisionTableCellExpressionAdvanced.js +238 -236
- package/src/sap/rules/ui/DecisionTableCellExpressionAdvancedRenderer.js +6 -4
- package/src/sap/rules/ui/DecisionTableCellExpressionBasic.js +7 -4
- package/src/sap/rules/ui/DecisionTableCellExpressionBasicRenderer.js +6 -4
- package/src/sap/rules/ui/DecisionTableCellRenderer.js +10 -10
- package/src/sap/rules/ui/DecisionTableConfiguration.js +1 -1
- package/src/sap/rules/ui/DecisionTableRenderer.js +163 -161
- package/src/sap/rules/ui/DecisionTableSettings.js +6 -4
- package/src/sap/rules/ui/DecisionTableSettingsOld.js +963 -961
- package/src/sap/rules/ui/DecisionTableSettingsOldRenderer.js +9 -10
- package/src/sap/rules/ui/DecisionTableSettingsRenderer.js +9 -10
- package/src/sap/rules/ui/ExpressionAdvanced.js +1726 -1724
- package/src/sap/rules/ui/ExpressionAdvancedRenderer.js +8 -8
- package/src/sap/rules/ui/ExpressionBase.js +1 -1
- package/src/sap/rules/ui/ExpressionBasic.js +7 -4
- package/src/sap/rules/ui/ExpressionBasicRenderer.js +8 -7
- package/src/sap/rules/ui/InstructionRenderer.js +73 -33
- package/src/sap/rules/ui/RuleBase.js +1 -1
- package/src/sap/rules/ui/RuleBuilder.js +433 -430
- package/src/sap/rules/ui/RuleBuilderRenderer.js +8 -9
- package/src/sap/rules/ui/TextRule.js +7 -4
- package/src/sap/rules/ui/TextRuleConfiguration.js +1 -1
- package/src/sap/rules/ui/TextRuleRenderer.js +45 -44
- package/src/sap/rules/ui/TextRuleSettings.js +6 -4
- package/src/sap/rules/ui/TextRuleSettingsRenderer.js +9 -9
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAdvancedFunctionPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAdvancedFunctionPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAggregateFunctionPanel.js +100 -98
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAggregateFunctionPanelRenderer.js +9 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionArrayOperatorPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionArrayOperatorPanelRenderer.js +10 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionComparisionOperatorPanel.js +109 -107
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionComparisionOperatorPanelRenderer.js +39 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionDateAndTimePanel.js +5 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionDateAndTimePanelRenderer.js +10 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFixedValuePanel.js +840 -838
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFixedValuePanelRenderer.js +40 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFunctionalOperatorPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFunctionalOperatorPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLogicalOperatorPanel.js +112 -110
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLogicalOperatorPanelRenderer.js +39 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLoopFunctionPanel.js +100 -98
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLoopFunctionPanelRenderer.js +9 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMathematicalOperatorPanel.js +122 -119
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMathematicalOperatorPanelRenderer.js +39 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMiscellaneousOperatorPanel.js +5 -2
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMiscellaneousOperatorPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionOperationsPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionOperationsPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionRangeOperatorPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionRangeOperatorPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionSelectFunctionPanel.js +108 -106
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionSelectFunctionPanelRenderer.js +40 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionTimeAndDurationFunctionPanel.js +254 -252
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionTimeAndDurationFunctionPanelRenderer.js +40 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionVocabularyPanel.js +631 -629
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionVocabularyPanelRenderer.js +40 -40
- package/src/sap/rules/ui/library.js +31 -10
- package/src/sap/rules/ui/type/ExpressionAbs.js +1 -1
|
@@ -1,965 +1,967 @@
|
|
|
1
|
-
/*!
|
|
1
|
+
/*!
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
3
|
|
|
4
4
|
(c) Copyright 2009-2016 SAP SE. All rights reserved
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// Provides control sap.rules.ui.
|
|
9
|
-
sap.ui.define([
|
|
10
|
-
"jquery.sap.global",
|
|
11
|
-
"sap/rules/ui/library",
|
|
12
|
-
"sap/ui/core/Control",
|
|
13
|
-
"sap/ui/layout/form/SimpleForm",
|
|
14
|
-
"sap/m/Label",
|
|
15
|
-
"sap/m/Switch",
|
|
16
|
-
"sap/m/Select",
|
|
17
|
-
"sap/m/Table",
|
|
18
|
-
"sap/m/Text",
|
|
19
|
-
"sap/m/CheckBox",
|
|
20
|
-
"sap/m/Input",
|
|
21
|
-
"sap/m/Button",
|
|
22
|
-
"sap/rules/ui/ExpressionAdvanced",
|
|
23
|
-
"sap/ui/layout/VerticalLayout",
|
|
24
|
-
"sap/rules/ui/type/Expression"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @param {
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* @
|
|
44
|
-
* @
|
|
45
|
-
* @
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this.
|
|
92
|
-
|
|
93
|
-
this.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
this.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
//
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
*
|
|
186
|
-
* @param {
|
|
187
|
-
* @param {string}
|
|
188
|
-
* @param {
|
|
189
|
-
* @param {
|
|
190
|
-
* @
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
var
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
*
|
|
218
|
-
* @param {
|
|
219
|
-
* @param {
|
|
220
|
-
* @param {string}
|
|
221
|
-
* @param {
|
|
222
|
-
* @param {
|
|
223
|
-
* @
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
*
|
|
246
|
-
* @param {
|
|
247
|
-
* @param {string} oData.
|
|
248
|
-
* @param {
|
|
249
|
-
* @param {string}
|
|
250
|
-
* @param {
|
|
251
|
-
* @param {
|
|
252
|
-
* @
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
var
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
*
|
|
288
|
-
* @param {
|
|
289
|
-
* @param {
|
|
290
|
-
* @param {
|
|
291
|
-
* @param {
|
|
292
|
-
* @param {
|
|
293
|
-
* @
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
var
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
var
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
*
|
|
324
|
-
* @param {
|
|
325
|
-
* @param {
|
|
326
|
-
* @param {
|
|
327
|
-
* @param {
|
|
328
|
-
* @param {
|
|
329
|
-
* @param {
|
|
330
|
-
* @
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
*
|
|
356
|
-
* @param {
|
|
357
|
-
* @param {
|
|
358
|
-
* @param {
|
|
359
|
-
* @param {
|
|
360
|
-
* @param {
|
|
361
|
-
* @
|
|
362
|
-
* @
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
var
|
|
372
|
-
var
|
|
373
|
-
var
|
|
374
|
-
|
|
375
|
-
var
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
*
|
|
389
|
-
* @param {
|
|
390
|
-
* @param {
|
|
391
|
-
* @param {
|
|
392
|
-
* @param {
|
|
393
|
-
* @param {
|
|
394
|
-
* @param {
|
|
395
|
-
* @
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
var
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
*
|
|
433
|
-
* @param {
|
|
434
|
-
* @param {
|
|
435
|
-
* @param {
|
|
436
|
-
* @
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
var
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
//
|
|
448
|
-
|
|
449
|
-
//
|
|
450
|
-
//this.
|
|
451
|
-
|
|
452
|
-
this.
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
*
|
|
459
|
-
* @param {
|
|
460
|
-
* @param {
|
|
461
|
-
* @param {
|
|
462
|
-
* @param {
|
|
463
|
-
* @param {
|
|
464
|
-
* @
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
var
|
|
470
|
-
|
|
471
|
-
var
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
//
|
|
501
|
-
//
|
|
502
|
-
//
|
|
503
|
-
//
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
//
|
|
514
|
-
//
|
|
515
|
-
//
|
|
516
|
-
//
|
|
517
|
-
//
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
//
|
|
550
|
-
//
|
|
551
|
-
//
|
|
552
|
-
//
|
|
553
|
-
//
|
|
554
|
-
//
|
|
555
|
-
//
|
|
556
|
-
//
|
|
557
|
-
//
|
|
558
|
-
// }
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
this.
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
var
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
value =
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
var
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
if
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
var
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
//
|
|
679
|
-
// }
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
//
|
|
695
|
-
// }
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
*
|
|
746
|
-
* @
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
*
|
|
758
|
-
* @
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
initialData
|
|
808
|
-
|
|
809
|
-
initialData.
|
|
810
|
-
initialData.
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
mode = sap.rules.ui.RuleFormat.Advanced;
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
var
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
var
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
var
|
|
919
|
-
|
|
920
|
-
oRuleModel.
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
var
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
this
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
oDialog.
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Provides control sap.rules.ui.
|
|
9
|
+
sap.ui.define([
|
|
10
|
+
"jquery.sap.global",
|
|
11
|
+
"sap/rules/ui/library",
|
|
12
|
+
"sap/ui/core/Control",
|
|
13
|
+
"sap/ui/layout/form/SimpleForm",
|
|
14
|
+
"sap/m/Label",
|
|
15
|
+
"sap/m/Switch",
|
|
16
|
+
"sap/m/Select",
|
|
17
|
+
"sap/m/Table",
|
|
18
|
+
"sap/m/Text",
|
|
19
|
+
"sap/m/CheckBox",
|
|
20
|
+
"sap/m/Input",
|
|
21
|
+
"sap/m/Button",
|
|
22
|
+
"sap/rules/ui/ExpressionAdvanced",
|
|
23
|
+
"sap/ui/layout/VerticalLayout",
|
|
24
|
+
"sap/rules/ui/type/Expression",
|
|
25
|
+
"./DecisionTableSettingsOldRenderer"
|
|
26
|
+
],
|
|
27
|
+
function(jQuery, library, Control, SimpleForm, Label, Switch, Select, Table, Text, CheckBox, Input, Button, ExpressionAdvanced, VerticalLayout, ExpressionType, DecisionTableSettingsOldRenderer) {
|
|
28
|
+
"use strict";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Constructor for a new DecisionTableSettingsOld Control.
|
|
32
|
+
*
|
|
33
|
+
* @param {string} [sId] id for the new control, generated automatically if no id is given
|
|
34
|
+
* @param {object} [mSettings] initial settings for the new control
|
|
35
|
+
*
|
|
36
|
+
* @class
|
|
37
|
+
* Some class description goes here.
|
|
38
|
+
* @extends Control
|
|
39
|
+
*
|
|
40
|
+
* @author SAP SE
|
|
41
|
+
* @version 1.108.0
|
|
42
|
+
*
|
|
43
|
+
* @constructor
|
|
44
|
+
* @private
|
|
45
|
+
* @alias sap.rules.ui.DecisionTableSettingsOld
|
|
46
|
+
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
|
|
47
|
+
*/
|
|
48
|
+
var oDecisionTableSettingsOld = Control.extend("sap.rules.ui.DecisionTableSettingsOld", {
|
|
49
|
+
metadata: {
|
|
50
|
+
library: "sap.rules.ui",
|
|
51
|
+
properties: {
|
|
52
|
+
// ruleFormat: {
|
|
53
|
+
// type: "string",
|
|
54
|
+
// defaultValue: sap.rules.ui.RuleFormat.Advanced
|
|
55
|
+
// },
|
|
56
|
+
hitPolicies: {
|
|
57
|
+
type: "sap.rules.ui.RuleHitPolicy[]",
|
|
58
|
+
defaultValue: [sap.rules.ui.RuleHitPolicy.FirstMatch, sap.rules.ui.RuleHitPolicy.AllMatch]
|
|
59
|
+
},
|
|
60
|
+
modelName: {
|
|
61
|
+
type: "string",
|
|
62
|
+
defaultValue: ""
|
|
63
|
+
},
|
|
64
|
+
newDecisionTable: {
|
|
65
|
+
type: "boolean",
|
|
66
|
+
defaultValue: false
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
aggregations: {
|
|
70
|
+
mainLayout:{
|
|
71
|
+
type: "sap.ui.layout.form.SimpleForm",
|
|
72
|
+
multiple: false
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
defaultAggregation: "mainLayout",
|
|
76
|
+
associations: {
|
|
77
|
+
expressionLanguage: {
|
|
78
|
+
type: "sap.rules.ui.services.ExpressionLanguage",
|
|
79
|
+
multiple: false,
|
|
80
|
+
singularName: "expressionLanguage"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
events: {},
|
|
84
|
+
publicMethods: []
|
|
85
|
+
},
|
|
86
|
+
renderer: DecisionTableSettingsOldRenderer
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype.init = function() {
|
|
90
|
+
|
|
91
|
+
this.oBundle = sap.ui.getCore().getLibraryResourceBundle("sap.rules.ui.i18n");
|
|
92
|
+
this.needCreateLayout = true;
|
|
93
|
+
this.firstLoad = true;
|
|
94
|
+
|
|
95
|
+
this.onsapescape = function(oEvent) {
|
|
96
|
+
// oEvent.preventDefault();
|
|
97
|
+
oEvent.stopPropagation();
|
|
98
|
+
};
|
|
99
|
+
this._decisionTableHeaderSettingFormatter = new ExpressionType();
|
|
100
|
+
this.setBusyIndicatorDelay(0);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype.onBeforeRendering = function() {
|
|
104
|
+
|
|
105
|
+
if (this.firstLoad) {
|
|
106
|
+
this._initSettingsModel();
|
|
107
|
+
|
|
108
|
+
if (this.getProperty("newDecisionTable") === true) {
|
|
109
|
+
this._prepareNewRuleWorkaround();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
this.firstLoad = false;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (this.needCreateLayout) {
|
|
116
|
+
var layout = this.getAggregation("mainLayout");
|
|
117
|
+
if (layout) {
|
|
118
|
+
layout.destroy();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
layout = this._createLayout();
|
|
122
|
+
this.setAggregation("mainLayout", layout, true);
|
|
123
|
+
this.needCreateLayout = false;
|
|
124
|
+
|
|
125
|
+
this.conditionsTable.getBinding("items").attachDataRequested(function() {
|
|
126
|
+
this.setBusy(true);
|
|
127
|
+
}.bind(this));
|
|
128
|
+
|
|
129
|
+
this.conditionsTable.getBinding("items").attachDataReceived(function() {
|
|
130
|
+
this.setBusy(false);
|
|
131
|
+
}.bind(this));
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// sap.rules.ui.DecisionTableSettingsOld.prototype.exit = function() {
|
|
136
|
+
|
|
137
|
+
// };
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Create DecisionTable structure for new rule
|
|
141
|
+
* @private
|
|
142
|
+
*/
|
|
143
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._prepareNewRule = function() {
|
|
144
|
+
|
|
145
|
+
var oModel = this._getModel();
|
|
146
|
+
var oContext = this.getBindingContext();
|
|
147
|
+
|
|
148
|
+
// rule's data
|
|
149
|
+
var ruleFormat = sap.rules.ui.RuleFormat.Advanced; // TODO: take from configuration
|
|
150
|
+
oModel.setProperty("Type", sap.rules.ui.RuleType.DecisionTable, oContext, true);
|
|
151
|
+
oModel.setProperty("RuleFormat", ruleFormat, oContext, true);
|
|
152
|
+
var oExpressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
153
|
+
var sExpressionLanguageVersion = oExpressionLanguage.getExpressionLanguageVersion();
|
|
154
|
+
oModel.setProperty("ExpressionLanguageVersion", sExpressionLanguageVersion, oContext, true);
|
|
155
|
+
|
|
156
|
+
// NOTE: "oData" and "params" objects are changed during execution by _createXYZ functions
|
|
157
|
+
var oData = {
|
|
158
|
+
ruleId: oContext.getProperty("Id"),
|
|
159
|
+
version: oContext.getProperty("Version")
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
var params = {
|
|
163
|
+
//groupId: sap.rules.ui.ChangeId.DecisionTableColumns
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// create DecisionTable
|
|
167
|
+
this._createDecisionTable(oData, params);
|
|
168
|
+
|
|
169
|
+
// create Condition Column
|
|
170
|
+
oData.colId = 1;
|
|
171
|
+
oData.expression = "";
|
|
172
|
+
this._createCondition(oData, params);
|
|
173
|
+
|
|
174
|
+
// create Result Parameters Columns
|
|
175
|
+
oData.colId = 2;
|
|
176
|
+
var addedColumns = this._createResult(oData, params);
|
|
177
|
+
|
|
178
|
+
// create Decision Table Row
|
|
179
|
+
oData.rowId = 1;
|
|
180
|
+
oData.columnsNumber = 1 + addedColumns;
|
|
181
|
+
this._createRow(oData, params);
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Add Decision Table to Rule if doesn't exist.
|
|
186
|
+
* @param {object} oData - data for new DecisionTable
|
|
187
|
+
* @param {string} oData.ruleId - rule's Id
|
|
188
|
+
* @param {map} mParameters? - Optional parameter map containing any of the following properties:
|
|
189
|
+
* @param {string} mParameters.groupId? - groupId for changes on oDataModel
|
|
190
|
+
* @param {function} mParameters.success? - success handler
|
|
191
|
+
* @param {function} mParameters.error? - error handler
|
|
192
|
+
* @private
|
|
193
|
+
*/
|
|
194
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._createDecisionTable = function(oData, mParameters) {
|
|
195
|
+
var oModel = this._getModel();
|
|
196
|
+
var oContext = this.getBindingContext();
|
|
197
|
+
|
|
198
|
+
var hitPolicy = this.getHitPolicies()[0];
|
|
199
|
+
|
|
200
|
+
// if "DecisionTable" exists - update HitPolicy, otherwise create new DT entry
|
|
201
|
+
if (oContext.getProperty("DecisionTable")) {
|
|
202
|
+
oModel.setProperty("DecisionTable/HitPolicy", hitPolicy, oContext, true);
|
|
203
|
+
} else {
|
|
204
|
+
var oDecisionTableData = {
|
|
205
|
+
RuleId: oData.ruleId,
|
|
206
|
+
Version: oData.version,
|
|
207
|
+
HitPolicy: hitPolicy
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
mParameters = mParameters ? mParameters : {};
|
|
211
|
+
mParameters.properties = oDecisionTableData;
|
|
212
|
+
oModel.createEntry("/DecisionTables", mParameters);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Add new Row to Decision Table
|
|
218
|
+
* @param {object} oData - data for new row
|
|
219
|
+
* @param {string} oData.ruleId - rule's Id
|
|
220
|
+
* @param {string} oData.rowId - row's Id
|
|
221
|
+
* @param {map} mParameters? - Optional parameter map containing any of the following properties:
|
|
222
|
+
* @param {string} mParameters.groupId? - groupId for changes on oDataModel
|
|
223
|
+
* @param {function} mParameters.success? - success handler
|
|
224
|
+
* @param {function} mParameters.error? - error handler
|
|
225
|
+
* @private
|
|
226
|
+
*/
|
|
227
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._createRow = function(oData, mParameters) {
|
|
228
|
+
|
|
229
|
+
mParameters = mParameters ? mParameters : {};
|
|
230
|
+
|
|
231
|
+
var oModel = this._getModel();
|
|
232
|
+
var oRowData = {
|
|
233
|
+
RuleId: oData.ruleId,
|
|
234
|
+
Version: oData.version,
|
|
235
|
+
Id: oData.rowId
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
mParameters.properties = oRowData;
|
|
239
|
+
oModel.createEntry("/DecisionTableRows", mParameters);
|
|
240
|
+
|
|
241
|
+
this._createCellsForNewRow(oData, mParameters);
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Add new condition to Decision Table
|
|
246
|
+
* @param {object} oData - data for new column
|
|
247
|
+
* @param {string} oData.ruleId - rule's Id
|
|
248
|
+
* @param {int} oData.colId - column Id for new column
|
|
249
|
+
* @param {string} oData.expression - expression part for new column
|
|
250
|
+
* @param {map} mParameters? - Optional parameter map containing any of the following properties:
|
|
251
|
+
* @param {string} mParameters.groupId? - groupId for changes on oDataModel
|
|
252
|
+
* @param {function} mParameters.success? - success handler
|
|
253
|
+
* @param {function} mParameters.error? - error handler
|
|
254
|
+
* @private
|
|
255
|
+
*/
|
|
256
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._createCondition = function(oData, mParameters) {
|
|
257
|
+
|
|
258
|
+
mParameters = mParameters ? mParameters : {};
|
|
259
|
+
|
|
260
|
+
var oModel = this._getModel();
|
|
261
|
+
|
|
262
|
+
var oColumnData = {
|
|
263
|
+
RuleId: oData.ruleId,
|
|
264
|
+
Version: oData.version,
|
|
265
|
+
Id: oData.colId,
|
|
266
|
+
Type: sap.rules.ui.DecisionTableColumn.Condition
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
mParameters.properties = oColumnData;
|
|
270
|
+
oModel.createEntry("/DecisionTableColumns", mParameters);
|
|
271
|
+
|
|
272
|
+
var oConditionColumnData = {
|
|
273
|
+
RuleId: oData.ruleId,
|
|
274
|
+
Version: oData.version,
|
|
275
|
+
Id: oData.colId,
|
|
276
|
+
Expression: oData.expression,
|
|
277
|
+
ValueOnly: false, // TODO: take from configuration
|
|
278
|
+
FixedOperator: "",
|
|
279
|
+
Description: ""
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
mParameters.properties = oConditionColumnData;
|
|
283
|
+
oModel.createEntry("/DecisionTableColumnConditions", mParameters);
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Add cells to existing rows for new Column
|
|
288
|
+
* @param {object} oData - data for new column
|
|
289
|
+
* @param {string} oData.ruleId - rule's Id
|
|
290
|
+
* @param {int} oData.colId - column Id for new column
|
|
291
|
+
* @param {map} mParameters? - Optional parameter map containing any of the following properties:
|
|
292
|
+
* @param {string} mParameters.groupId? - groupId for changes on oDataModel
|
|
293
|
+
* @param {function} mParameters.success? - success handler
|
|
294
|
+
* @param {function} mParameters.error? - error handler
|
|
295
|
+
* @private
|
|
296
|
+
*/
|
|
297
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._createCellsForNewColumn = function(oData, mParameters) {
|
|
298
|
+
|
|
299
|
+
mParameters = mParameters ? mParameters : {};
|
|
300
|
+
|
|
301
|
+
var oModel = this._getModel();
|
|
302
|
+
var oContext = this.getBindingContext();
|
|
303
|
+
var rowKeys = oModel.getProperty("DecisionTable/DecisionTableRows", oContext);
|
|
304
|
+
|
|
305
|
+
for (var i = 0; i < rowKeys.length; i++) {
|
|
306
|
+
|
|
307
|
+
var rowId = oModel.getProperty("/" + rowKeys[i]).Id;
|
|
308
|
+
|
|
309
|
+
var oCellData = {
|
|
310
|
+
RuleId: oData.ruleId,
|
|
311
|
+
Version: oData.version,
|
|
312
|
+
RowId: rowId,
|
|
313
|
+
ColId: oData.colId,
|
|
314
|
+
Content: ""
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
mParameters.properties = oCellData;
|
|
318
|
+
oModel.createEntry("/DecisionTableRowCells", mParameters);
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Add cells for existing columns for new Row
|
|
324
|
+
* @param {object} oData - data for new column
|
|
325
|
+
* @param {string} oData.ruleId - rule's Id
|
|
326
|
+
* @param {int} oData.rowId - row Id of new row
|
|
327
|
+
* @param {int} oData.columnsNumber - number of columns in DecisionTable
|
|
328
|
+
* @param {map} mParameters? - Optional parameter map containing any of the following properties:
|
|
329
|
+
* @param {string} mParameters.groupId? - groupId for changes on oDataModel
|
|
330
|
+
* @param {function} mParameters.success? - success handler
|
|
331
|
+
* @param {function} mParameters.error? - error handler
|
|
332
|
+
* @private
|
|
333
|
+
*/
|
|
334
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._createCellsForNewRow = function(oData, mParameters) {
|
|
335
|
+
|
|
336
|
+
mParameters = mParameters ? mParameters : {};
|
|
337
|
+
|
|
338
|
+
var oModel = this._getModel();
|
|
339
|
+
|
|
340
|
+
for (var colId = 1; colId <= oData.columnsNumber; colId++) {
|
|
341
|
+
var oCellData = {
|
|
342
|
+
RuleId: oData.ruleId,
|
|
343
|
+
Version: oData.version,
|
|
344
|
+
RowId: oData.rowId,
|
|
345
|
+
ColId: colId,
|
|
346
|
+
Content: ""
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
mParameters.properties = oCellData;
|
|
350
|
+
oModel.createEntry("/DecisionTableRowCells", mParameters);
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Add new Result columns to Decision Table
|
|
356
|
+
* @param {object} oData - data for new column
|
|
357
|
+
* @param {string} oData.ruleId - rule's Id
|
|
358
|
+
* @param {int} oData.colId - column Id for new column
|
|
359
|
+
* @param {map} mParameters? - Optional parameter map containing any of the following properties:
|
|
360
|
+
* @param {string} mParameters.groupId? - groupId for changes on oDataModel
|
|
361
|
+
* @param {function} mParameters.success? - success handler
|
|
362
|
+
* @param {function} mParameters.error? - error handler
|
|
363
|
+
* @returns {int} number of added columns
|
|
364
|
+
* @private
|
|
365
|
+
*/
|
|
366
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._createResult = function(oData, mParameters) {
|
|
367
|
+
|
|
368
|
+
var oContext = this.getBindingContext();
|
|
369
|
+
|
|
370
|
+
// TODO: use ResultDataObjectId instead
|
|
371
|
+
var resultName = oContext.getProperty("ResultDataObjectName");
|
|
372
|
+
var oExpressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
373
|
+
var resultInfo = oExpressionLanguage.getResultInfo(resultName);
|
|
374
|
+
var resultParams = resultInfo ? resultInfo.requiredParams : [];
|
|
375
|
+
var resultLength = resultParams.length;
|
|
376
|
+
|
|
377
|
+
var colId = oData.colId;
|
|
378
|
+
for (var i = 0; i < resultLength; i++) {
|
|
379
|
+
oData.colId = colId + i;
|
|
380
|
+
oData.resultParameterData = resultParams[i];
|
|
381
|
+
this._createResultParameter(oData, mParameters);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
return resultLength;
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Add new Result Parameter column to Decision Table
|
|
389
|
+
* @param {object} oData - data for new column
|
|
390
|
+
* @param {string} oData.ruleId - rule's Id
|
|
391
|
+
* @param {int} oData.colId - column Id for new column
|
|
392
|
+
* @param {object} oData.resultParameterData - data for result parameter column
|
|
393
|
+
* @param {map} mParameters? - Optional parameter map containing any of the following properties:
|
|
394
|
+
* @param {string} mParameters.groupId? - groupId for changes on oDataModel
|
|
395
|
+
* @param {function} mParameters.success? - success handler
|
|
396
|
+
* @param {function} mParameters.error? - error handler
|
|
397
|
+
* @private
|
|
398
|
+
*/
|
|
399
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._createResultParameter = function(oData, mParameters) {
|
|
400
|
+
|
|
401
|
+
mParameters = mParameters ? mParameters : {};
|
|
402
|
+
|
|
403
|
+
var oModel = this._getModel();
|
|
404
|
+
|
|
405
|
+
var oColumnData = {
|
|
406
|
+
RuleId: oData.ruleId,
|
|
407
|
+
Version: oData.version,
|
|
408
|
+
Id: oData.colId,
|
|
409
|
+
Type: sap.rules.ui.DecisionTableColumn.Result
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
mParameters.properties = oColumnData;
|
|
413
|
+
oModel.createEntry("/DecisionTableColumns", mParameters);
|
|
414
|
+
|
|
415
|
+
var oResultColumnData = {
|
|
416
|
+
RuleId: oData.ruleId,
|
|
417
|
+
Version: oData.version,
|
|
418
|
+
Id: oData.colId,
|
|
419
|
+
DataObjectAttributeName: oData.resultParameterData.name,
|
|
420
|
+
// DataObjectAttributeId: oData.resultParameterData.id,
|
|
421
|
+
DataObjectAttributeId: oData.resultParameterData.paramId,
|
|
422
|
+
BusinessDataType: oData.resultParameterData.businessDataType
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
mParameters.properties = oResultColumnData;
|
|
426
|
+
oModel.createEntry("/DecisionTableColumnResults", mParameters);
|
|
427
|
+
|
|
428
|
+
//this._createCellsForNewColumn(ruleId, iColId, sChangeId);
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Remove column
|
|
433
|
+
* @param {object} oColumnContext - context of column to remove
|
|
434
|
+
* @param {map} mParameters? - Optional parameter map containing any of the following properties:
|
|
435
|
+
* @param {string} mParameters.groupId? - groupId for changes on oDataModel
|
|
436
|
+
* @param {function} mParameters.success? - success handler
|
|
437
|
+
* @param {function} mParameters.error? - error handler
|
|
438
|
+
* @private
|
|
439
|
+
*/
|
|
440
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._removeColumn = function(oColumnContext, mParameters) {
|
|
441
|
+
var oModel = this._getModel();
|
|
442
|
+
|
|
443
|
+
var columnPath = oColumnContext.getPath();
|
|
444
|
+
oModel.remove(columnPath, mParameters);
|
|
445
|
+
|
|
446
|
+
//var colId = oColumnContext.getProperty("Id");
|
|
447
|
+
// this._removeCellsForColumn(colId, sChangeId);
|
|
448
|
+
|
|
449
|
+
// remove fixedOperator data for deleted row (internal model)
|
|
450
|
+
//var tableData = this._internalModel.setProperty("/tableData", {}, true);
|
|
451
|
+
//delete tableData[colId];
|
|
452
|
+
//this._updateRemoveRowEnabled();
|
|
453
|
+
|
|
454
|
+
this._internalModel.setProperty("/tableData", {}, true);
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Remove cells from existing rows for deleted Column
|
|
459
|
+
* @param {object} oData - data for new column
|
|
460
|
+
* @param {string} oData.ruleId - rule's Id
|
|
461
|
+
* @param {int} oData.colId - column Id for new column
|
|
462
|
+
* @param {map} mParameters? - Optional parameter map containing any of the following properties:
|
|
463
|
+
* @param {string} mParameters.groupId? - groupId for changes on oDataModel
|
|
464
|
+
* @param {function} mParameters.success? - success handler
|
|
465
|
+
* @param {function} mParameters.error? - error handler
|
|
466
|
+
* @private
|
|
467
|
+
*/
|
|
468
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._removeCellsForColumn = function(oData, mParameters) {
|
|
469
|
+
var oModel = this._getModel();
|
|
470
|
+
var oContext = this.getBindingContext();
|
|
471
|
+
var rowKeys = oModel.getProperty("DecisionTable/DecisionTableRows", oContext);
|
|
472
|
+
|
|
473
|
+
var columnIndex = oData.colId - 1;
|
|
474
|
+
for (var i = 0; i < rowKeys.length; i++) {
|
|
475
|
+
|
|
476
|
+
var rowCells = oModel.getProperty("/" + rowKeys[i] + "/Cells");
|
|
477
|
+
var cellPath = "/" + rowCells[columnIndex];
|
|
478
|
+
|
|
479
|
+
oModel.remove(cellPath, mParameters);
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._createTable = function() {
|
|
484
|
+
|
|
485
|
+
this.conditionsTable = new Table({
|
|
486
|
+
backgroundDesign: sap.m.BackgroundDesign.Solid,
|
|
487
|
+
showSeparators: sap.m.ListSeparators.None,
|
|
488
|
+
fixedLayout: true,
|
|
489
|
+
layoutData: new sap.ui.layout.form.GridContainerData({
|
|
490
|
+
halfGrid: false
|
|
491
|
+
}),
|
|
492
|
+
columns: [
|
|
493
|
+
new sap.m.Column({
|
|
494
|
+
width: "50%",
|
|
495
|
+
header: new sap.m.Label({
|
|
496
|
+
text: this.oBundle.getText("colOfDecisionTable"),
|
|
497
|
+
design: sap.m.LabelDesign.Bold
|
|
498
|
+
}).setTooltip(this.oBundle.getText("colOfDecisionTable"))
|
|
499
|
+
}),
|
|
500
|
+
// new sap.m.Column({
|
|
501
|
+
// width: "25%",
|
|
502
|
+
// header: new sap.m.Label({
|
|
503
|
+
// text: this.oBundle.getText("displayName")
|
|
504
|
+
// }).setTooltip(this.oBundle.getText("displayName"))
|
|
505
|
+
// }),
|
|
506
|
+
new sap.m.Column({
|
|
507
|
+
width: "30%",
|
|
508
|
+
header: new sap.m.Label({
|
|
509
|
+
text: this.oBundle.getText("fixedOperator"),
|
|
510
|
+
design: sap.m.LabelDesign.Bold
|
|
511
|
+
}).setTooltip(this.oBundle.getText("fixedOperator"))
|
|
512
|
+
}),
|
|
513
|
+
// new sap.m.Column({
|
|
514
|
+
// width: "15%",
|
|
515
|
+
// header: new sap.m.Label({
|
|
516
|
+
// text: this.oBundle.getText("valueOnly"),
|
|
517
|
+
// design: sap.m.LabelDesign.Bold
|
|
518
|
+
// }).setTooltip(this.oBundle.getText("valueOnly"))
|
|
519
|
+
// }),
|
|
520
|
+
new sap.m.Column({
|
|
521
|
+
width: "20%"
|
|
522
|
+
})
|
|
523
|
+
]
|
|
524
|
+
}).data("hrf-id", "columnsTable", true);
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
this.conditionsTable.bindItems({
|
|
528
|
+
path: "DecisionTable/DecisionTableColumnsCondition",
|
|
529
|
+
factory: this._tableColumnsFactory.bind(this),
|
|
530
|
+
parameters: {
|
|
531
|
+
expand: "Condition"
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
this.conditionsTable.setBusyIndicatorDelay(0);
|
|
536
|
+
|
|
537
|
+
return this.conditionsTable;
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._createLayout = function() {
|
|
541
|
+
var oForm = new SimpleForm({
|
|
542
|
+
editable: true,
|
|
543
|
+
layout: "ResponsiveGridLayout",
|
|
544
|
+
maxContainerCols: 1,
|
|
545
|
+
columnsL: 1,
|
|
546
|
+
columnsM: 1,
|
|
547
|
+
labelSpanM: 1,
|
|
548
|
+
content: [
|
|
549
|
+
// new Label({
|
|
550
|
+
// text: this.oBundle.getText("advancedMode")
|
|
551
|
+
// }).setTooltip(this.oBundle.getText("advancedMode")),
|
|
552
|
+
// new CheckBox({
|
|
553
|
+
// selected: {
|
|
554
|
+
// path: "RuleFormat",
|
|
555
|
+
// formatter: Formatter.ruleFormatAsBoolean
|
|
556
|
+
// },
|
|
557
|
+
// enabled: "{maModel>/advancedMode/enabled}",
|
|
558
|
+
// visible: "{settingsModel>/advancedMode/visible}",
|
|
559
|
+
// select: this._setAdvancedMode.bind(this)
|
|
560
|
+
// }),
|
|
561
|
+
|
|
562
|
+
new Label({
|
|
563
|
+
text: this.oBundle.getText("hitPolicy")
|
|
564
|
+
}).setTooltip(this.oBundle.getText("hitPolicy")),
|
|
565
|
+
new Select({
|
|
566
|
+
width: "25%",
|
|
567
|
+
enabled: "{settingsModel>/hitPolicy/enabled}",
|
|
568
|
+
items: {
|
|
569
|
+
path: "settingsModel>/hitPolicy/hitPolicyEnumration",
|
|
570
|
+
template: new sap.ui.core.Item({
|
|
571
|
+
key: "{settingsModel>key}",
|
|
572
|
+
text: "{settingsModel>text}"
|
|
573
|
+
})
|
|
574
|
+
},
|
|
575
|
+
selectedKey: "{DecisionTable/HitPolicy}"
|
|
576
|
+
}),
|
|
577
|
+
|
|
578
|
+
new Label(),
|
|
579
|
+
this._createTable(),
|
|
580
|
+
|
|
581
|
+
new Label({
|
|
582
|
+
text: this.oBundle.getText("ouput")
|
|
583
|
+
}).setTooltip(this.oBundle.getText("ouput")),
|
|
584
|
+
new Text({
|
|
585
|
+
width: "25%",
|
|
586
|
+
text: "{ResultDataObjectName}"
|
|
587
|
+
})
|
|
588
|
+
]
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
return oForm;
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._setFixedOperatorOnExpressionChange = function(displayExpression, colId) {
|
|
595
|
+
var oFixedOperatorData = this._getFixedOperatorDataForExpression(displayExpression);
|
|
596
|
+
this._internalModel.setProperty("/tableData/" + colId, oFixedOperatorData, true);
|
|
597
|
+
this._updateRemoveRowEnabled();
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype.setExpressionLanguage = function (oExpressionLanguage){
|
|
601
|
+
this.setAssociation("expressionLanguage", oExpressionLanguage, true);
|
|
602
|
+
this._decisionTableHeaderSettingFormatter.setExpressionLanguage(oExpressionLanguage);
|
|
603
|
+
};
|
|
604
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._getColumnControlObject = function(oBindingContext) {
|
|
605
|
+
var mode = this._internalModel.getProperty("/advancedMode/current");
|
|
606
|
+
if (mode === sap.rules.ui.RuleFormat.Advanced) {
|
|
607
|
+
var oExpressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
608
|
+
|
|
609
|
+
return new ExpressionAdvanced({
|
|
610
|
+
expressionLanguage: oExpressionLanguage,
|
|
611
|
+
placeholder: this.oBundle.getText("expressionPlaceHolder"),
|
|
612
|
+
validateOnLoad: true,
|
|
613
|
+
type : sap.rules.ui.ExpressionType.NonComparison,
|
|
614
|
+
value: {
|
|
615
|
+
path: "Condition/Expression",
|
|
616
|
+
type: this._decisionTableHeaderSettingFormatter,
|
|
617
|
+
events: {
|
|
618
|
+
change: function(oEvent) {
|
|
619
|
+
var oSource = oEvent.getSource();
|
|
620
|
+
var oContext = oSource.getContext();
|
|
621
|
+
var colId = oContext.getProperty("Id");
|
|
622
|
+
|
|
623
|
+
//Workaround to fix RULES-4723
|
|
624
|
+
var result = oExpressionLanguage.convertDecisionTableExpressionToDisplayValue(oSource.getValue(), "", "", sap.rules.ui.ExpressionType.All);
|
|
625
|
+
var value;
|
|
626
|
+
if (result.output.status === "Success" && result.output.converted) {
|
|
627
|
+
value = result.output.converted.header;
|
|
628
|
+
} else {
|
|
629
|
+
value = oSource.getValue();
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
this._setFixedOperatorOnExpressionChange(value, colId);
|
|
633
|
+
}.bind(this)
|
|
634
|
+
}
|
|
635
|
+
},
|
|
636
|
+
enabled: true,
|
|
637
|
+
change: function(oEvent) {
|
|
638
|
+
var oSource = oEvent.getSource();
|
|
639
|
+
var oContext = oSource.getBindingContext();
|
|
640
|
+
var colId = oContext.getProperty("Id");
|
|
641
|
+
this._setFixedOperatorOnExpressionChange(oSource.getValue(), colId);
|
|
642
|
+
|
|
643
|
+
// clear previous fixed operator if expression is empty
|
|
644
|
+
var expression = oContext.getProperty("Condition/Expression");
|
|
645
|
+
if (!expression) {
|
|
646
|
+
var model = oContext.getModel();
|
|
647
|
+
model.setProperty(oContext.getPath() + "/Condition/FixedOperator", "");
|
|
648
|
+
}
|
|
649
|
+
}.bind(this)
|
|
650
|
+
});
|
|
651
|
+
} else {
|
|
652
|
+
return new Select({
|
|
653
|
+
width: "100%",
|
|
654
|
+
items: {
|
|
655
|
+
path: "",
|
|
656
|
+
template: new sap.ui.core.Item({
|
|
657
|
+
key: "",
|
|
658
|
+
text: ""
|
|
659
|
+
})
|
|
660
|
+
},
|
|
661
|
+
selectedKey: "{Condition/Expression}",
|
|
662
|
+
enabled: true,
|
|
663
|
+
change: function(oControlEvent) {
|
|
664
|
+
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._tableColumnsFactory = function(sId, oContext) {
|
|
671
|
+
var ruleId = oContext.getProperty("RuleId");
|
|
672
|
+
var version = oContext.getProperty("Version");
|
|
673
|
+
var colId = oContext.getProperty("Id");
|
|
674
|
+
|
|
675
|
+
return new sap.m.ColumnListItem({
|
|
676
|
+
cells: [
|
|
677
|
+
this._getColumnControlObject(oContext),
|
|
678
|
+
// new sap.m.Input({
|
|
679
|
+
// value: "{Condition/Description}",
|
|
680
|
+
// placeholder: this.oBundle.getText("displayNamePlaceHolder")
|
|
681
|
+
// }),
|
|
682
|
+
new sap.m.Select({
|
|
683
|
+
width: "100%",
|
|
684
|
+
items: {
|
|
685
|
+
path: "settingsModel>/tableData/" + colId + "/fixOperatorEnumration",
|
|
686
|
+
template: new sap.ui.core.Item({
|
|
687
|
+
key: "{settingsModel>key}",
|
|
688
|
+
text: "{settingsModel>value}"
|
|
689
|
+
})
|
|
690
|
+
},
|
|
691
|
+
selectedKey: "{Condition/FixedOperator}",
|
|
692
|
+
enabled: "{settingsModel>/tableData/" + colId + "/fixOperatorEnabled}"
|
|
693
|
+
}),
|
|
694
|
+
// new sap.m.Switch({
|
|
695
|
+
// state: "{Condition/ValueOnly}",
|
|
696
|
+
// enabled: false
|
|
697
|
+
// }),
|
|
698
|
+
new sap.ui.layout.HorizontalLayout({
|
|
699
|
+
content: [
|
|
700
|
+
new sap.m.Button({
|
|
701
|
+
type: sap.m.ButtonType.Transparent,
|
|
702
|
+
icon: sap.ui.core.IconPool.getIconURI("sys-cancel"),
|
|
703
|
+
visible: "{settingsModel>/removeRowEnabled}",
|
|
704
|
+
press: function(oEvent) {
|
|
705
|
+
var oColumnContext = oEvent.getSource().getBindingContext();
|
|
706
|
+
var params = {
|
|
707
|
+
//groupId: sap.rules.ui.ChangeId.DecisionTableColumns
|
|
708
|
+
};
|
|
709
|
+
this._removeColumnWorkaround(oColumnContext, params);
|
|
710
|
+
}.bind(this)
|
|
711
|
+
}).setTooltip(this.oBundle.getText("removeColumn")),
|
|
712
|
+
new sap.m.Button({
|
|
713
|
+
type: sap.m.ButtonType.Transparent,
|
|
714
|
+
icon: sap.ui.core.IconPool.getIconURI("add"),
|
|
715
|
+
press: function(oEvent) {
|
|
716
|
+
var oData = {
|
|
717
|
+
ruleId: ruleId,
|
|
718
|
+
version: version,
|
|
719
|
+
colId: colId + 1,
|
|
720
|
+
expression: ""
|
|
721
|
+
};
|
|
722
|
+
var params = {
|
|
723
|
+
//groupId: sap.rules.ui.ChangeId.DecisionTableColumns
|
|
724
|
+
};
|
|
725
|
+
this._addConditionWorkaround(oData, params);
|
|
726
|
+
}.bind(this)
|
|
727
|
+
}).setTooltip(this.oBundle.getText("addColumn"))
|
|
728
|
+
],
|
|
729
|
+
height: "1em"
|
|
730
|
+
})
|
|
731
|
+
]
|
|
732
|
+
});
|
|
733
|
+
};
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* Create DecisionTable structure for new rule
|
|
737
|
+
* @private
|
|
738
|
+
*/
|
|
739
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._prepareNewRuleWorkaround = function() {
|
|
740
|
+
this._prepareNewRule();
|
|
741
|
+
this._saveWorkaround();
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* Add new condition to Decision Table
|
|
746
|
+
* @param {object} oData - data for new column
|
|
747
|
+
* @param {map} mParameters? - Optional parameter map containing any of the following properties:
|
|
748
|
+
* @private
|
|
749
|
+
*/
|
|
750
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._addConditionWorkaround = function(oData, mParameters) {
|
|
751
|
+
|
|
752
|
+
this._createCondition(oData, mParameters);
|
|
753
|
+
this._saveWorkaround();
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* Remove column
|
|
758
|
+
* @param {object} oColumnContext - context of column to remove
|
|
759
|
+
* @param {map} mParameters? - Optional parameter map containing any of the following properties:
|
|
760
|
+
* @private
|
|
761
|
+
*/
|
|
762
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._removeColumnWorkaround = function(oColumnContext, mParameters) {
|
|
763
|
+
var oModel = this._getModel();
|
|
764
|
+
|
|
765
|
+
if (oModel.hasPendingChanges()) {
|
|
766
|
+
// save all model's changes before row removal
|
|
767
|
+
this._saveWorkaround({
|
|
768
|
+
success: function() {
|
|
769
|
+
this._removeColumn(oColumnContext, mParameters);
|
|
770
|
+
}.bind(this)
|
|
771
|
+
});
|
|
772
|
+
} else {
|
|
773
|
+
this._removeColumn(oColumnContext, mParameters);
|
|
774
|
+
}
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* @private
|
|
779
|
+
* @param {map} mParameters? - Optional parameter map containing any of the following properties:
|
|
780
|
+
*/
|
|
781
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._saveWorkaround = function(mParameters) {
|
|
782
|
+
var oModel = this._getModel();
|
|
783
|
+
oModel.submitChanges(mParameters);
|
|
784
|
+
};
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._getModel = function() {
|
|
788
|
+
var modelName = this.getModelName();
|
|
789
|
+
if (modelName) {
|
|
790
|
+
return this.getModel(modelName);
|
|
791
|
+
}
|
|
792
|
+
return this.getModel();
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._getBindModelName = function() {
|
|
796
|
+
var path = "";
|
|
797
|
+
var modelName = this.getModelName();
|
|
798
|
+
|
|
799
|
+
if (modelName) {
|
|
800
|
+
path = modelName + ">";
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
return path;
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._initSettingsModel = function() {
|
|
807
|
+
var initialData = {};
|
|
808
|
+
|
|
809
|
+
initialData.advancedMode = this._getAdvancedModeData();
|
|
810
|
+
initialData.hitPolicy = this._getHitPoliciesData();
|
|
811
|
+
initialData.tableData = {};
|
|
812
|
+
initialData.removeRowEnabled = false;
|
|
813
|
+
|
|
814
|
+
this._internalModel = new sap.ui.model.json.JSONModel(initialData);
|
|
815
|
+
this.setModel(this._internalModel, "settingsModel");
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._getAdvancedModeData = function() {
|
|
819
|
+
var mode;
|
|
820
|
+
var advancedModeData = {};
|
|
821
|
+
|
|
822
|
+
// Check rule's Format from rule's data - it is stronger then configuration property
|
|
823
|
+
var oContext = this.getBindingContext();
|
|
824
|
+
var ruleFormat = oContext.getProperty("RuleFormat");
|
|
825
|
+
|
|
826
|
+
if (ruleFormat === sap.rules.ui.RuleFormat.Advanced) {
|
|
827
|
+
mode = sap.rules.ui.RuleFormat.Advanced;
|
|
828
|
+
} else {
|
|
829
|
+
mode = sap.rules.ui.RuleFormat.Advanced; // TODO: should be: this.getRuleFormat();
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
switch (mode) {
|
|
833
|
+
case sap.rules.ui.RuleFormat.All:
|
|
834
|
+
advancedModeData = {
|
|
835
|
+
current: sap.rules.ui.RuleFormat.Basic,
|
|
836
|
+
enabled: true,
|
|
837
|
+
visible: true
|
|
838
|
+
};
|
|
839
|
+
break;
|
|
840
|
+
|
|
841
|
+
case sap.rules.ui.RuleFormat.Basic:
|
|
842
|
+
advancedModeData = {
|
|
843
|
+
current: sap.rules.ui.RuleFormat.Basic,
|
|
844
|
+
enabled: false,
|
|
845
|
+
visible: false
|
|
846
|
+
};
|
|
847
|
+
break;
|
|
848
|
+
|
|
849
|
+
case sap.rules.ui.RuleFormat.Advanced:
|
|
850
|
+
advancedModeData = {
|
|
851
|
+
current: sap.rules.ui.RuleFormat.Advanced,
|
|
852
|
+
enabled: false,
|
|
853
|
+
visible: true
|
|
854
|
+
};
|
|
855
|
+
|
|
856
|
+
break;
|
|
857
|
+
|
|
858
|
+
default:
|
|
859
|
+
}
|
|
860
|
+
return advancedModeData;
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._getHitPoliciesData = function() {
|
|
864
|
+
var hitPolicy = this.getProperty("hitPolicies");
|
|
865
|
+
var length = hitPolicy.length;
|
|
866
|
+
var oHitPolicyData = {
|
|
867
|
+
hitPolicyEnumration: []
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
for (var i = 0; i < length; i++) {
|
|
871
|
+
oHitPolicyData.hitPolicyEnumration.push({
|
|
872
|
+
key: hitPolicy[i],
|
|
873
|
+
text: this.oBundle.getText(hitPolicy[i])
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
oHitPolicyData.enabled = length > 1 ? true : false;
|
|
878
|
+
|
|
879
|
+
return oHitPolicyData;
|
|
880
|
+
};
|
|
881
|
+
|
|
882
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._getFixedOperatorDataForExpression = function(sExpression) {
|
|
883
|
+
var fixOperatorEnabled = sExpression ? true : false;
|
|
884
|
+
var fixedOperatiorData = {
|
|
885
|
+
fixOperatorEnumration: [{
|
|
886
|
+
key: "",
|
|
887
|
+
value: this.oBundle.getText("fixOperatorDefaultValue")
|
|
888
|
+
}],
|
|
889
|
+
fixOperatorEnabled: fixOperatorEnabled
|
|
890
|
+
};
|
|
891
|
+
|
|
892
|
+
if (fixOperatorEnabled) {
|
|
893
|
+
var oSuggestions = [];
|
|
894
|
+
var oExpressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
895
|
+
var oFilter = [{
|
|
896
|
+
tokenType: sap.rules.ui.ExpressionTokenType.reservedWord,
|
|
897
|
+
tokenCategory: sap.rules.ui.ExpressionCategory.comparisonOp
|
|
898
|
+
}, {
|
|
899
|
+
tokenType: sap.rules.ui.ExpressionTokenType.reservedWord,
|
|
900
|
+
tokenCategory: sap.rules.ui.ExpressionCategory.comparisonBetweenOp
|
|
901
|
+
}, {
|
|
902
|
+
tokenType: sap.rules.ui.ExpressionTokenType.reservedWord,
|
|
903
|
+
tokenCategory: sap.rules.ui.ExpressionCategory.comparisonExistOp
|
|
904
|
+
}];
|
|
905
|
+
oSuggestions = oExpressionLanguage.getSuggestionsByCategories(sExpression, oFilter);
|
|
906
|
+
for (var i = 0; i < oSuggestions.length; i++) {
|
|
907
|
+
fixedOperatiorData.fixOperatorEnumration.push({
|
|
908
|
+
key: oSuggestions[i].text,
|
|
909
|
+
value: oSuggestions[i].text
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
return fixedOperatiorData;
|
|
914
|
+
};
|
|
915
|
+
|
|
916
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._setAdvancedMode = function(oControlEvent) {
|
|
917
|
+
var bAdvancedModeStatus = oControlEvent.getParameter("selected");
|
|
918
|
+
var ruleFormat = bAdvancedModeStatus ? sap.rules.ui.RuleFormat.Advanced : sap.rules.ui.RuleFormat.Basic;
|
|
919
|
+
|
|
920
|
+
var oRuleModel = this._getModel();
|
|
921
|
+
var oContextPath = this.getBindingContext().getPath();
|
|
922
|
+
oRuleModel.setProperty(oContextPath + "/RuleFormat", ruleFormat);
|
|
923
|
+
|
|
924
|
+
this.needCreateLayout = true;
|
|
925
|
+
this.invalidate();
|
|
926
|
+
};
|
|
927
|
+
|
|
928
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype._updateRemoveRowEnabled = function() {
|
|
929
|
+
var tableData = this._internalModel.getProperty("/tableData");
|
|
930
|
+
var len = Object.keys(tableData).length;
|
|
931
|
+
var enabled = len > 1;
|
|
932
|
+
this._internalModel.setProperty("/removeRowEnabled", enabled, null, true);
|
|
933
|
+
};
|
|
934
|
+
|
|
935
|
+
sap.rules.ui.DecisionTableSettingsOld.prototype.getButtons = function(oDialog) {
|
|
936
|
+
|
|
937
|
+
var aButtons = [];
|
|
938
|
+
|
|
939
|
+
//Add apply button
|
|
940
|
+
var oApplyButton = new Button({
|
|
941
|
+
text: this.oBundle.getText("applyChangesBtn")
|
|
942
|
+
}).setTooltip(this.oBundle.getText("applyChangesBtn"));
|
|
943
|
+
|
|
944
|
+
oApplyButton.attachPress(function() {
|
|
945
|
+
|
|
946
|
+
//flag for calculate only once header span for multi header in columnFactory function
|
|
947
|
+
this.multiHeaderFlag = false;
|
|
948
|
+
|
|
949
|
+
// Workaround: we submit changes, because if we change a cell and then open this dialog and close it,
|
|
950
|
+
// the cell display value will not be the same as the cell value when in-focus
|
|
951
|
+
this.getModel().submitChanges();
|
|
952
|
+
|
|
953
|
+
//For attachBeforeClose in decisionTable file
|
|
954
|
+
oDialog.setState(sap.ui.core.ValueState.Success);
|
|
955
|
+
|
|
956
|
+
oDialog.close();
|
|
957
|
+
|
|
958
|
+
}, this);
|
|
959
|
+
|
|
960
|
+
aButtons.push(oApplyButton);
|
|
961
|
+
|
|
962
|
+
return aButtons;
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
return oDecisionTableSettingsOld;
|
|
966
|
+
|
|
965
967
|
}, /* bExport= */ true);
|