@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,2157 +1,2160 @@
|
|
|
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 this._validatecontrol sap.rules.ui.
|
|
9
|
-
sap.ui.define([
|
|
10
|
-
"sap/base/Log",
|
|
11
|
-
"jquery.sap.global",
|
|
12
|
-
"./library",
|
|
13
|
-
"sap/rules/ui/DecisionTableCell",
|
|
14
|
-
"sap/rules/ui/RuleBase",
|
|
15
|
-
"sap/rules/ui/Utils",
|
|
16
|
-
"sap/ui/table/Table",
|
|
17
|
-
"sap/ui/table/Column",
|
|
18
|
-
"sap/m/OverflowToolbar",
|
|
19
|
-
"sap/m/Popover",
|
|
20
|
-
"sap/m/Menu",
|
|
21
|
-
"sap/m/Dialog",
|
|
22
|
-
"sap/m/MenuButton",
|
|
23
|
-
"sap/m/Button",
|
|
24
|
-
"sap/m/ToolbarSpacer",
|
|
25
|
-
"sap/m/Text",
|
|
26
|
-
"sap/m/Input",
|
|
27
|
-
"sap/m/ObjectIdentifier",
|
|
28
|
-
"sap/m/Link",
|
|
29
|
-
"sap/m/Label",
|
|
30
|
-
"sap/m/BusyIndicator",
|
|
31
|
-
"sap/m/DisplayListItem",
|
|
32
|
-
"sap/m/MenuItem",
|
|
33
|
-
"sap/m/FlexBox",
|
|
34
|
-
"sap/m/MessageStrip",
|
|
35
|
-
"sap/rules/ui/DecisionTableSettingsOld",
|
|
36
|
-
"sap/rules/ui/type/DecisionTableCell",
|
|
37
|
-
"sap/rules/ui/ast/constants/Constants",
|
|
38
|
-
"sap/rules/ui/services/AstExpressionLanguage",
|
|
39
|
-
"sap/rules/ui/ast/util/AstUtil",
|
|
40
|
-
"sap/rules/ui/Constants",
|
|
41
|
-
"sap/ui/core/LocaleData"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* @param {
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
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
|
-
var oErrorLabel = new
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
var
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
oRowData.Sequence
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
this.
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
this.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
var
|
|
207
|
-
var
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
updatedAstNode
|
|
211
|
-
updatedAstNode.
|
|
212
|
-
updatedAstNode.
|
|
213
|
-
updatedAstNode.
|
|
214
|
-
updatedAstNode.
|
|
215
|
-
updatedAstNode.
|
|
216
|
-
updatedAstNode.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
Output
|
|
226
|
-
Output.
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
oTable.
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
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
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
//
|
|
389
|
-
//
|
|
390
|
-
//
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
oToolbar.addContent(
|
|
394
|
-
oToolbar.addContent(
|
|
395
|
-
oToolbar.addContent(
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
oToolbar.
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
oToolbar.addContent(
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
oToolbar.addContent(
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
oToolbar.addContent(
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
oToolbar.addContent(
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
var
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
oTable.getBinding("columns").
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
oEventBus
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
var
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
oTable.getBinding("rows").
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
this.
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
this.getElementBinding().
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
var
|
|
493
|
-
var
|
|
494
|
-
var
|
|
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
|
-
* @param {string} [
|
|
528
|
-
* @param {string} [
|
|
529
|
-
* @param {string} [
|
|
530
|
-
* @param {
|
|
531
|
-
* @param {boolean} [
|
|
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
|
-
var
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
oText.
|
|
595
|
-
oText.
|
|
596
|
-
|
|
597
|
-
this._internalModel.setProperty("/
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
var
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
'
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
var
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
var
|
|
640
|
-
var
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
this.
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
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
|
-
var
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
this.
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
var
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
var
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
var
|
|
771
|
-
var
|
|
772
|
-
var
|
|
773
|
-
var
|
|
774
|
-
var
|
|
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
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
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
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
var
|
|
877
|
-
var
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
var
|
|
913
|
-
var
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
var
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
var
|
|
947
|
-
var
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
oDecisionTableSettings.setModel(
|
|
954
|
-
oDecisionTableSettings.
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
var
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
this.
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
this.
|
|
990
|
-
this.
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
this.
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
this.
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
var
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
this.
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
//this
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
oText.
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
*
|
|
1095
|
-
*
|
|
1096
|
-
*
|
|
1097
|
-
* @
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
var
|
|
1102
|
-
var
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
cellArr
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
var
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
oSpaceTextContent
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
var
|
|
1224
|
-
var
|
|
1225
|
-
var
|
|
1226
|
-
var
|
|
1227
|
-
var
|
|
1228
|
-
var
|
|
1229
|
-
var
|
|
1230
|
-
var
|
|
1231
|
-
|
|
1232
|
-
var
|
|
1233
|
-
|
|
1234
|
-
var
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
var
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
var
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
termsArray = displayExpression.
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
len
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
var
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
var
|
|
1382
|
-
var
|
|
1383
|
-
var
|
|
1384
|
-
dtData
|
|
1385
|
-
dtData.
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
//
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
this.
|
|
1410
|
-
this.
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
this.dataBucket.
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
var
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
this.
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
var
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
this.
|
|
1524
|
-
this.
|
|
1525
|
-
this.
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
data
|
|
1531
|
-
data.
|
|
1532
|
-
data.
|
|
1533
|
-
data.
|
|
1534
|
-
data.
|
|
1535
|
-
data.
|
|
1536
|
-
data.
|
|
1537
|
-
data.
|
|
1538
|
-
data.
|
|
1539
|
-
data.
|
|
1540
|
-
data.
|
|
1541
|
-
data.
|
|
1542
|
-
data.
|
|
1543
|
-
data.
|
|
1544
|
-
data.
|
|
1545
|
-
data.
|
|
1546
|
-
|
|
1547
|
-
this.
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
var
|
|
1558
|
-
var
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
var
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
var
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
oCells[i].
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
oCells[i].
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
var
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
oDialog.
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
this.
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
* @
|
|
1610
|
-
* @param {
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
var
|
|
1617
|
-
var
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
this._internalModel.setProperty("/
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
this.
|
|
1647
|
-
|
|
1648
|
-
this.
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
var
|
|
1660
|
-
var
|
|
1661
|
-
var
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
var
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
oEventBus
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
var
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
this._internalModel.setProperty("/
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
var
|
|
1730
|
-
var
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
var
|
|
1753
|
-
var
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
oTable.
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
oTable.
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
var
|
|
1786
|
-
var
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
oCell.
|
|
1795
|
-
|
|
1796
|
-
var
|
|
1797
|
-
var
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
var
|
|
1802
|
-
var
|
|
1803
|
-
var
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
var
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
var
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
var
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
oCell.
|
|
1848
|
-
oCell.
|
|
1849
|
-
oCell.
|
|
1850
|
-
oCell.
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
var
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
oCell.
|
|
1868
|
-
oCell.
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
oCell.
|
|
1877
|
-
oCell.
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
this.
|
|
1902
|
-
this.
|
|
1903
|
-
this.
|
|
1904
|
-
this.
|
|
1905
|
-
this.
|
|
1906
|
-
this.
|
|
1907
|
-
this.
|
|
1908
|
-
this.
|
|
1909
|
-
this.
|
|
1910
|
-
this.
|
|
1911
|
-
this.
|
|
1912
|
-
this.
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
var
|
|
1922
|
-
var
|
|
1923
|
-
var
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
this.
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
this.
|
|
1957
|
-
this.
|
|
1958
|
-
this.
|
|
1959
|
-
this.
|
|
1960
|
-
this.
|
|
1961
|
-
this.
|
|
1962
|
-
|
|
1963
|
-
var
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
this.
|
|
1970
|
-
this.
|
|
1971
|
-
this.
|
|
1972
|
-
this.
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
this.
|
|
2008
|
-
this.
|
|
2009
|
-
this.
|
|
2010
|
-
this.
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
//
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
this.
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
this.
|
|
2038
|
-
this._internalModel.setProperty("/
|
|
2039
|
-
|
|
2040
|
-
var
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
this.
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
this.
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
this.
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
this.
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
var
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Provides this._validatecontrol sap.rules.ui.
|
|
9
|
+
sap.ui.define([
|
|
10
|
+
"sap/base/Log",
|
|
11
|
+
"jquery.sap.global",
|
|
12
|
+
"./library",
|
|
13
|
+
"sap/rules/ui/DecisionTableCell",
|
|
14
|
+
"sap/rules/ui/RuleBase",
|
|
15
|
+
"sap/rules/ui/Utils",
|
|
16
|
+
"sap/ui/table/Table",
|
|
17
|
+
"sap/ui/table/Column",
|
|
18
|
+
"sap/m/OverflowToolbar",
|
|
19
|
+
"sap/m/Popover",
|
|
20
|
+
"sap/m/Menu",
|
|
21
|
+
"sap/m/Dialog",
|
|
22
|
+
"sap/m/MenuButton",
|
|
23
|
+
"sap/m/Button",
|
|
24
|
+
"sap/m/ToolbarSpacer",
|
|
25
|
+
"sap/m/Text",
|
|
26
|
+
"sap/m/Input",
|
|
27
|
+
"sap/m/ObjectIdentifier",
|
|
28
|
+
"sap/m/Link",
|
|
29
|
+
"sap/m/Label",
|
|
30
|
+
"sap/m/BusyIndicator",
|
|
31
|
+
"sap/m/DisplayListItem",
|
|
32
|
+
"sap/m/MenuItem",
|
|
33
|
+
"sap/m/FlexBox",
|
|
34
|
+
"sap/m/MessageStrip",
|
|
35
|
+
"sap/rules/ui/DecisionTableSettingsOld",
|
|
36
|
+
"sap/rules/ui/type/DecisionTableCell",
|
|
37
|
+
"sap/rules/ui/ast/constants/Constants",
|
|
38
|
+
"sap/rules/ui/services/AstExpressionLanguage",
|
|
39
|
+
"sap/rules/ui/ast/util/AstUtil",
|
|
40
|
+
"sap/rules/ui/Constants",
|
|
41
|
+
"sap/ui/core/LocaleData",
|
|
42
|
+
"./DecisionTableRenderer"
|
|
43
|
+
|
|
44
|
+
], function (Log, jQuery, library, DecisionTableCell, RuleBase, Utils, Table, Column, OverflowToolbar, Popover, Menu, Dialog, MenuButton, Button,
|
|
45
|
+
ToolbarSpacer, Text, Input, ObjectIdentifier, Link, Label, BusyIndicator, DisplayListItem, MenuItem, FlexBox, MessageStrip,
|
|
46
|
+
DecisionTableSettingsOld, DecisionTableCellFormatter, ConstantUtils, AstExpressionLanguage, AstUtil, Constants, LocaleData, DecisionTableRenderer) {
|
|
47
|
+
|
|
48
|
+
"use strict";
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Constructor for a new DecisionTable Control.
|
|
52
|
+
*
|
|
53
|
+
* @param {string} [sId] id for the new control, generated automatically if no id is given
|
|
54
|
+
* @param {object} [mSettings] initial settings for the new control
|
|
55
|
+
*
|
|
56
|
+
* @class
|
|
57
|
+
* Some class description goes here.
|
|
58
|
+
* @extends Control
|
|
59
|
+
*
|
|
60
|
+
* @author SAP SE
|
|
61
|
+
* @version 1.108.0
|
|
62
|
+
*
|
|
63
|
+
* @constructor
|
|
64
|
+
* @private
|
|
65
|
+
* @alias sap.rules.ui.DecisionTable
|
|
66
|
+
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) design time meta model
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
var dataPartName = {
|
|
70
|
+
vocabulary: "vocabulary",
|
|
71
|
+
rule: "rule",
|
|
72
|
+
columns: "columns",
|
|
73
|
+
rows: "rows"
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
var emptyTable = 3;
|
|
77
|
+
|
|
78
|
+
var oDecisionTable = RuleBase.extend("sap.rules.ui.DecisionTable", {
|
|
79
|
+
metadata: {
|
|
80
|
+
properties: {
|
|
81
|
+
enableSettings: {
|
|
82
|
+
type: "boolean",
|
|
83
|
+
group: "Misc",
|
|
84
|
+
defaultValue: false
|
|
85
|
+
},
|
|
86
|
+
enableSettingResult: {
|
|
87
|
+
type: "boolean",
|
|
88
|
+
defaultValue: true
|
|
89
|
+
},
|
|
90
|
+
cellFormat: {
|
|
91
|
+
type: "sap.rules.ui.DecisionTableCellFormat",
|
|
92
|
+
defaultValue: sap.rules.ui.DecisionTableCellFormat.Both
|
|
93
|
+
},
|
|
94
|
+
hitPolicies: {
|
|
95
|
+
type: "sap.rules.ui.RuleHitPolicy[]",
|
|
96
|
+
defaultValue: [sap.rules.ui.RuleHitPolicy.FirstMatch, sap.rules.ui.RuleHitPolicy.AllMatch]
|
|
97
|
+
},
|
|
98
|
+
lineActionBuffer: {
|
|
99
|
+
type: "any",
|
|
100
|
+
defaultValue: {
|
|
101
|
+
rowPath: null,
|
|
102
|
+
operation: null
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
decisionTableFormat: {
|
|
106
|
+
type: "sap.rules.ui.DecisionTableFormat",
|
|
107
|
+
defaultValue: sap.rules.ui.DecisionTableFormat.CellFormat
|
|
108
|
+
},
|
|
109
|
+
threshold: {
|
|
110
|
+
type: "int",
|
|
111
|
+
defaultValue: 999
|
|
112
|
+
},
|
|
113
|
+
visibleRowCount: {
|
|
114
|
+
type: "int",
|
|
115
|
+
defaultValue: 999
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
aggregations: {
|
|
119
|
+
"_toolbar": {
|
|
120
|
+
type: "sap.m.OverflowToolbar",
|
|
121
|
+
multiple: false,
|
|
122
|
+
singularName: "_toolbar"
|
|
123
|
+
},
|
|
124
|
+
"_table": {
|
|
125
|
+
type: "sap.ui.core.Control",
|
|
126
|
+
multiple: false,
|
|
127
|
+
singularName: "_table"
|
|
128
|
+
},
|
|
129
|
+
"_errorsText": {
|
|
130
|
+
type: "sap.m.MessageStrip", //"sap.m.Text",
|
|
131
|
+
multiple: false,
|
|
132
|
+
singularName: "_errorsText"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
associations: {
|
|
136
|
+
/**
|
|
137
|
+
* Association to controls / IDs which label this control (see WAI-ARIA attribute <code>aria-labelledby</code>).
|
|
138
|
+
*/
|
|
139
|
+
ariaLabelledBy: {
|
|
140
|
+
type: "sap.ui.core.Control",
|
|
141
|
+
multiple: true,
|
|
142
|
+
singularName: "ariaLabelledBy"
|
|
143
|
+
},
|
|
144
|
+
ariaRoleDescription: {
|
|
145
|
+
type: "sap.ui.core.Control",
|
|
146
|
+
multiple: true,
|
|
147
|
+
singularName: "ariaRoleDescription"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
|
|
152
|
+
_addErrorLabel: function () {
|
|
153
|
+
//var oErrorLabel = new sap.m.Text().addStyleClass("sapThemeCriticalText").addStyleClass("sapUiSmallMargin");
|
|
154
|
+
var oErrorLabel = new MessageStrip({
|
|
155
|
+
showCloseButton: true,
|
|
156
|
+
showIcon: true,
|
|
157
|
+
type: sap.ui.core.MessageType.Error,
|
|
158
|
+
visible: false
|
|
159
|
+
}).addStyleClass("sapUiTinyMargin");
|
|
160
|
+
this.setAggregation("_errorsText", oErrorLabel, true);
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
_addNewRow: function (selectedRow, bFirst) {
|
|
164
|
+
var oMenu = this.oMenu;
|
|
165
|
+
if (oMenu) {
|
|
166
|
+
oMenu.close();
|
|
167
|
+
}
|
|
168
|
+
var oModel = this._getModel();
|
|
169
|
+
var columns = this.dataBucket.columns && this.dataBucket.columns.results;
|
|
170
|
+
if (!oModel || !columns) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
var oTable = this.getAggregation("_table"),
|
|
174
|
+
oContext = this.getBindingContext(),
|
|
175
|
+
sRuleId = oContext.getProperty("Id"),
|
|
176
|
+
sVersion = oContext.getProperty("Version");
|
|
177
|
+
var oRowData = {
|
|
178
|
+
RuleId: sRuleId,
|
|
179
|
+
Version: sVersion
|
|
180
|
+
};
|
|
181
|
+
selectedRow = selectedRow || 0;
|
|
182
|
+
var rowPath;
|
|
183
|
+
if (bFirst) {
|
|
184
|
+
oRowData.Sequence = 1;
|
|
185
|
+
} else {
|
|
186
|
+
rowPath = oTable.getContextByIndex(selectedRow).getPath();
|
|
187
|
+
oRowData.Sequence = oModel.getProperty(rowPath).Sequence;
|
|
188
|
+
oRowData.Sequence++;
|
|
189
|
+
}
|
|
190
|
+
oRowData.Id = this._calNextRowId();
|
|
191
|
+
// create row
|
|
192
|
+
oModel.createEntry("/DecisionTableRows", {
|
|
193
|
+
properties: oRowData
|
|
194
|
+
});
|
|
195
|
+
oTable.setSelectedIndex(oRowData.Sequence -1);
|
|
196
|
+
this._clearErrorMessages();
|
|
197
|
+
this._saveWorkAround([],this.oBundle.getText("addRowSuccess"));
|
|
198
|
+
},
|
|
199
|
+
|
|
200
|
+
_addNewRowWorkaround: function (bFirst) {
|
|
201
|
+
var selectedRow = this._internalModel.getProperty("/selectedRow");
|
|
202
|
+
this._addNewRow(selectedRow, bFirst);
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
_addNodeObject: function (astNode) {
|
|
206
|
+
var oNodeArray = [];
|
|
207
|
+
var oAstExpressionLanguage = sap.ui.getCore().byId(this.getAstExpressionLanguage());
|
|
208
|
+
var oAstUtil = oAstExpressionLanguage._astBunldeInstance.ASTUtil;
|
|
209
|
+
|
|
210
|
+
var updatedAstNode = [];
|
|
211
|
+
updatedAstNode.Root = astNode.Root;
|
|
212
|
+
updatedAstNode.SequenceNumber = astNode.Sequence;
|
|
213
|
+
updatedAstNode.ParentId = astNode.ParentId;
|
|
214
|
+
updatedAstNode.Reference = astNode.Reference;
|
|
215
|
+
updatedAstNode.Id = astNode.NodeId;
|
|
216
|
+
updatedAstNode.Type = astNode.Type;
|
|
217
|
+
updatedAstNode.Value = astNode.Value ? astNode.Value : "";
|
|
218
|
+
if (astNode.Type === "I") {
|
|
219
|
+
updatedAstNode.Value = astNode.IncompleteExpression;
|
|
220
|
+
}
|
|
221
|
+
if (astNode.Function) {
|
|
222
|
+
updatedAstNode.Function = astNode.Function;
|
|
223
|
+
}
|
|
224
|
+
if (astNode.Type !== "P" && astNode.Type !== "O" && !astNode.Function) {
|
|
225
|
+
var Output = [];
|
|
226
|
+
Output.BusinessDataType = astNode.Output ? astNode.Output.BusinessDataType : astNode.BusinessDataType;
|
|
227
|
+
Output.DataObjectType = astNode.Output ? astNode.Output.DataObjectType : astNode.DataObjectType;
|
|
228
|
+
updatedAstNode.Output = Output;
|
|
229
|
+
}
|
|
230
|
+
oAstUtil.createNode(updatedAstNode);
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
_addTable: function () {
|
|
234
|
+
var oTable = new Table({
|
|
235
|
+
visibleRowCount: this.VISIBLEROWCOUNT,
|
|
236
|
+
threshold: this.THRESHOLD,
|
|
237
|
+
visibleRowCountMode: sap.ui.table.VisibleRowCountMode.Fixed,
|
|
238
|
+
selectionMode: {
|
|
239
|
+
parts: [{
|
|
240
|
+
path: "dtModel>/editable"
|
|
241
|
+
}],
|
|
242
|
+
formatter: this._decideSelectionMode
|
|
243
|
+
},
|
|
244
|
+
rowSelectionChange: function () {
|
|
245
|
+
this.oParent._rowSelectionChange();
|
|
246
|
+
},
|
|
247
|
+
enableColumnReordering: false,
|
|
248
|
+
busy: "{dtModel>/busyTableState}"
|
|
249
|
+
});
|
|
250
|
+
oTable._updateTableCell = this._updateTableCell;
|
|
251
|
+
oTable.setBusyIndicatorDelay(0);
|
|
252
|
+
this.setAggregation("_table", oTable, true);
|
|
253
|
+
},
|
|
254
|
+
|
|
255
|
+
/*
|
|
256
|
+
* @private
|
|
257
|
+
*/
|
|
258
|
+
_addToolBar: function () {
|
|
259
|
+
var oToolbar = new OverflowToolbar({
|
|
260
|
+
design: "Transparent",
|
|
261
|
+
enabled: "{dtModel>/editable}"
|
|
262
|
+
});
|
|
263
|
+
var oTitle = new sap.m.Title({
|
|
264
|
+
text: this.oBundle.getText("decisionTable"),
|
|
265
|
+
tooltip:this.oBundle.getText("decisionTable")
|
|
266
|
+
});
|
|
267
|
+
var oAddLink = new MenuButton({
|
|
268
|
+
text: this.oBundle.getText("addRow"),
|
|
269
|
+
visible: "{dtModel>/editable}",
|
|
270
|
+
enabled: {
|
|
271
|
+
parts: [{
|
|
272
|
+
path: "dtModel>/newTable"
|
|
273
|
+
}],
|
|
274
|
+
formatter: this._decideAddRowEnablement
|
|
275
|
+
},
|
|
276
|
+
menu: new Menu({
|
|
277
|
+
items: this._getMenuItems()
|
|
278
|
+
})
|
|
279
|
+
}).setTooltip(this.oBundle.getText("addRow"));
|
|
280
|
+
|
|
281
|
+
var oDeleteLink = new Button({
|
|
282
|
+
text: this.oBundle.getText("deleteRow"),
|
|
283
|
+
press: [this._deleteRowWorkaround, this],
|
|
284
|
+
visible: "{dtModel>/editable}",
|
|
285
|
+
type: sap.m.ButtonType.Transparent,
|
|
286
|
+
enabled: {
|
|
287
|
+
parts: [{
|
|
288
|
+
path: "dtModel>/newTable"
|
|
289
|
+
}, {
|
|
290
|
+
path: "dtModel>/isAtLeastOneRowSelected"
|
|
291
|
+
}],
|
|
292
|
+
formatter: this._decideDeleteRowEnablement
|
|
293
|
+
}
|
|
294
|
+
}).setTooltip(this.oBundle.getText("deleteRow"));
|
|
295
|
+
|
|
296
|
+
var oCopyLink = new Button({
|
|
297
|
+
text: this.oBundle.getText("copyRow"),
|
|
298
|
+
press: [this._copyRow, this],
|
|
299
|
+
type: sap.m.ButtonType.Transparent,
|
|
300
|
+
visible: {
|
|
301
|
+
parts: [{
|
|
302
|
+
path: "dtModel>/editable"
|
|
303
|
+
}, {
|
|
304
|
+
path: "dtModel>/sequenceExist"
|
|
305
|
+
}],
|
|
306
|
+
formatter: this._decideLineActionVisibility
|
|
307
|
+
},
|
|
308
|
+
enabled: {
|
|
309
|
+
parts: [{
|
|
310
|
+
path: "dtModel>/newTable"
|
|
311
|
+
}, {
|
|
312
|
+
path: "dtModel>/isExactlyOneRowSelected"
|
|
313
|
+
}],
|
|
314
|
+
formatter: this._decideCopyRowEnablement
|
|
315
|
+
}
|
|
316
|
+
}).setTooltip(this.oBundle.getText("copyRow"));
|
|
317
|
+
|
|
318
|
+
var oCutLink = new Button({
|
|
319
|
+
text: this.oBundle.getText("cutRow"),
|
|
320
|
+
type: sap.m.ButtonType.Transparent,
|
|
321
|
+
press: [this._cutRow, this],
|
|
322
|
+
visible: {
|
|
323
|
+
parts: [{
|
|
324
|
+
path: "dtModel>/editable"
|
|
325
|
+
}, {
|
|
326
|
+
path: "dtModel>/sequenceExist"
|
|
327
|
+
}],
|
|
328
|
+
formatter: this._decideLineActionVisibility
|
|
329
|
+
},
|
|
330
|
+
enabled: {
|
|
331
|
+
parts: [{
|
|
332
|
+
path: "dtModel>/newTable"
|
|
333
|
+
}, {
|
|
334
|
+
path: "dtModel>/isExactlyOneRowSelected"
|
|
335
|
+
}],
|
|
336
|
+
formatter: this._decideCopyRowEnablement
|
|
337
|
+
}
|
|
338
|
+
}).setTooltip(this.oBundle.getText("cutRow"));
|
|
339
|
+
|
|
340
|
+
var oPasteLink = new MenuButton({
|
|
341
|
+
text: this.oBundle.getText("pasteRow"),
|
|
342
|
+
type: sap.m.ButtonType.Transparent,
|
|
343
|
+
visible: {
|
|
344
|
+
parts: [{
|
|
345
|
+
path: "dtModel>/editable"
|
|
346
|
+
}, {
|
|
347
|
+
path: "dtModel>/sequenceExist"
|
|
348
|
+
}],
|
|
349
|
+
formatter: this._decideLineActionVisibility
|
|
350
|
+
},
|
|
351
|
+
enabled: {
|
|
352
|
+
parts: [{
|
|
353
|
+
path: "dtModel>/newTable"
|
|
354
|
+
}, {
|
|
355
|
+
path: "dtModel>/isExactlyOneRowSelected"
|
|
356
|
+
}, {
|
|
357
|
+
path: "dtModel>/isSelection"
|
|
358
|
+
}],
|
|
359
|
+
formatter: this._decidePasteRowEnablement
|
|
360
|
+
},
|
|
361
|
+
menu: new Menu({
|
|
362
|
+
items: this._getPasteMenuItems()
|
|
363
|
+
})
|
|
364
|
+
}).setTooltip(this.oBundle.getText("pasteRow"));
|
|
365
|
+
|
|
366
|
+
var oSettingsButton = new Button({
|
|
367
|
+
text: "",
|
|
368
|
+
press: this._openTableSettings.bind(this),
|
|
369
|
+
visible: {
|
|
370
|
+
parts: [{
|
|
371
|
+
path: "dtModel>/enableSettings"
|
|
372
|
+
}, {
|
|
373
|
+
path: "dtModel>/editable"
|
|
374
|
+
}],
|
|
375
|
+
formatter: this._decideSettingsEnablement
|
|
376
|
+
},
|
|
377
|
+
enabled: {
|
|
378
|
+
parts: [{
|
|
379
|
+
path: "dtModel>/enableSettings"
|
|
380
|
+
}, {
|
|
381
|
+
path: "dtModel>/editable"
|
|
382
|
+
}],
|
|
383
|
+
formatter: this._decideSettingsEnablement
|
|
384
|
+
}
|
|
385
|
+
}).setTooltip(this.oBundle.getText("tableSettings"));
|
|
386
|
+
oSettingsButton.setIcon("sap-icon://action-settings");
|
|
387
|
+
|
|
388
|
+
// Remove space in order to align DT title to left
|
|
389
|
+
// oToolbar.addContent(new ToolbarSpacer({
|
|
390
|
+
// width: "1em"
|
|
391
|
+
// }));
|
|
392
|
+
|
|
393
|
+
oToolbar.addContent(oTitle);
|
|
394
|
+
oToolbar.addContent(new ToolbarSpacer({}));
|
|
395
|
+
oToolbar.addContent(oAddLink);
|
|
396
|
+
oToolbar.addContent(new ToolbarSpacer({
|
|
397
|
+
width: "1em"
|
|
398
|
+
}));
|
|
399
|
+
oToolbar.addContent(oDeleteLink);
|
|
400
|
+
oToolbar._delete = oDeleteLink;
|
|
401
|
+
|
|
402
|
+
oToolbar.addContent(new ToolbarSpacer({
|
|
403
|
+
width: "1em"
|
|
404
|
+
}));
|
|
405
|
+
oToolbar.addContent(oCopyLink);
|
|
406
|
+
oToolbar.addContent(new ToolbarSpacer({
|
|
407
|
+
width: "1em"
|
|
408
|
+
}));
|
|
409
|
+
oToolbar.addContent(oCutLink);
|
|
410
|
+
oToolbar.addContent(new ToolbarSpacer({
|
|
411
|
+
width: "1em"
|
|
412
|
+
}));
|
|
413
|
+
oToolbar.addContent(oPasteLink);
|
|
414
|
+
oToolbar.addContent(new ToolbarSpacer({
|
|
415
|
+
width: "1em"
|
|
416
|
+
}));
|
|
417
|
+
|
|
418
|
+
oToolbar.addContent(oSettingsButton);
|
|
419
|
+
oToolbar.addContent(new ToolbarSpacer({
|
|
420
|
+
width: "1em"
|
|
421
|
+
}));
|
|
422
|
+
|
|
423
|
+
this.setAggregation("_toolbar", oToolbar, true);
|
|
424
|
+
},
|
|
425
|
+
|
|
426
|
+
_bindColumns: function () {
|
|
427
|
+
var oTable = this.getAggregation("_table");
|
|
428
|
+
var bindingPath = [this._getBindModelName(), this.getBindingContextPath(), "/DecisionTable/DecisionTableColumns"].join("");
|
|
429
|
+
var expandPath = "Condition,Result";
|
|
430
|
+
if(this.getAstExpressionLanguage()){
|
|
431
|
+
expandPath = "Condition/DecisionTableColumnConditionASTs,Result/DecisionTableColumnResultASTs";
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
oTable.bindColumns({
|
|
435
|
+
path: bindingPath,
|
|
436
|
+
parameters: {
|
|
437
|
+
expand: expandPath
|
|
438
|
+
},
|
|
439
|
+
factory: this._columnFactory.bind(this)
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
oTable.getBinding("columns").attachDataRequested(this._handleColumnsDataRequested, this);
|
|
443
|
+
oTable.getBinding("columns").attachDataReceived(this._handleColumnsDataReceived, this);
|
|
444
|
+
oTable.attachColumnResize(oTable, this._onColumnResize, this);
|
|
445
|
+
},
|
|
446
|
+
|
|
447
|
+
_onColumnResize: function () {
|
|
448
|
+
this.columnResized = true;
|
|
449
|
+
var obj = { "colResize" : true };
|
|
450
|
+
var oEventBus = sap.ui.getCore().getEventBus();
|
|
451
|
+
oEventBus.publish("sap.ui.rules","_onColumnResized", obj);
|
|
452
|
+
},
|
|
453
|
+
|
|
454
|
+
_bindRows: function () {
|
|
455
|
+
var oTable = this.getAggregation("_table");
|
|
456
|
+
var bindingPath = [this._getBindModelName(), this.getBindingContextPath(), "/DecisionTable/DecisionTableRows"].join("");
|
|
457
|
+
var expandPath = "Cells";
|
|
458
|
+
if(this.getAstExpressionLanguage()){
|
|
459
|
+
expandPath = "Cells/DecisionTableRowCellASTs";
|
|
460
|
+
}
|
|
461
|
+
var oSorter = new sap.ui.model.Sorter("Sequence");
|
|
462
|
+
|
|
463
|
+
oTable.bindRows({
|
|
464
|
+
path: bindingPath,
|
|
465
|
+
parameters: {
|
|
466
|
+
expand: expandPath
|
|
467
|
+
},
|
|
468
|
+
sorter: oSorter
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
oTable.getBinding("rows").attachDataRequested(this._handleRowsDataRequested, this);
|
|
472
|
+
oTable.getBinding("rows").attachDataReceived(this._handleRowsDataReceived, this);
|
|
473
|
+
},
|
|
474
|
+
|
|
475
|
+
_bindRule: function () {
|
|
476
|
+
var bindingPath = [this._getBindModelName(), this.getBindingContextPath()].join("");
|
|
477
|
+
this.bindElement({
|
|
478
|
+
path: bindingPath,
|
|
479
|
+
parameters: {
|
|
480
|
+
expand: "DecisionTable"
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
this.getElementBinding().attachDataRequested(this._handleRuleDataRequested, this);
|
|
485
|
+
this.getElementBinding().attachDataReceived(this._handleRuleDataReceived, this);
|
|
486
|
+
|
|
487
|
+
// force data load (otherwise if data exists there is no data fetch)
|
|
488
|
+
this.getElementBinding().refresh();
|
|
489
|
+
},
|
|
490
|
+
|
|
491
|
+
_buildMessagesStructure: function (validateResults, columnErrorsMap, headerErrorArray) {
|
|
492
|
+
var detail;
|
|
493
|
+
var additionalInfo;
|
|
494
|
+
var description;
|
|
495
|
+
var errorKey;
|
|
496
|
+
if (!validateResults.details) {
|
|
497
|
+
return columnErrorsMap;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
for (var w = 0; w < validateResults.details.length; w++) {
|
|
501
|
+
detail = validateResults.details[w];
|
|
502
|
+
if (!detail.messages) {
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
for (var i = 0; i < detail.messages.length; i++) {
|
|
506
|
+
description = detail.messages[i].description;
|
|
507
|
+
additionalInfo = detail.messages[i].additionalInfo;
|
|
508
|
+
if (additionalInfo.type === "ruleResult") {
|
|
509
|
+
headerErrorArray.push(description);
|
|
510
|
+
errorKey = "genericError";
|
|
511
|
+
columnErrorsMap[errorKey] = headerErrorArray;
|
|
512
|
+
} else if (additionalInfo.type === "column") {
|
|
513
|
+
errorKey = "errorInColumnHeader";
|
|
514
|
+
columnErrorsMap[errorKey] = true;
|
|
515
|
+
} else if (additionalInfo.type === "cell") {
|
|
516
|
+
errorKey = "RowId=" + additionalInfo.rowId + ",ColId=" + additionalInfo.colId;
|
|
517
|
+
columnErrorsMap[errorKey] = description;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
return columnErrorsMap;
|
|
522
|
+
},
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Copy a row from the buffer after a copy/cut line action using a function import
|
|
526
|
+
* /sap/opu/odata/SAP/RULE_SRV/CopyRuleRow?RuleId='xxx'&SourceRowId='yyy'&TargetRowSeq='zzz'
|
|
527
|
+
* @param {string} [sRuleId] The current rule ID
|
|
528
|
+
* @param {string} [sVersion] The current rule version
|
|
529
|
+
* @param {string} [sSourceRowId] The copied row stable ID
|
|
530
|
+
* @param {string} [sTargetRowSeq] A sequence for paste/insert the row
|
|
531
|
+
* @param {boolean} [shouldCut] A flag indicating if we cut or copy
|
|
532
|
+
* @param {boolean} [sOverrideInd] A flag indicating if we paste
|
|
533
|
+
* @private
|
|
534
|
+
**/
|
|
535
|
+
_callCopyRuleRow: function (sRuleId, sVersion, sSourceRowId, sTargetRowSeq, shouldCut, sOverrideInd) {
|
|
536
|
+
var changesGroupID = {
|
|
537
|
+
groupId: "changes"
|
|
538
|
+
};
|
|
539
|
+
this._getModel().setDeferredGroups([changesGroupID.groupId]);
|
|
540
|
+
var submitSuccess = function (response) {
|
|
541
|
+
this.resetControl();
|
|
542
|
+
this._internalModel.setProperty("/busyState", false);
|
|
543
|
+
}.bind(this);
|
|
544
|
+
|
|
545
|
+
var submitError = function (e) {
|
|
546
|
+
sap.m.MessageToast.show(e);
|
|
547
|
+
}.bind(this);
|
|
548
|
+
|
|
549
|
+
var callFunctionSuccess = function (response) {
|
|
550
|
+
this._getModel().callFunction("/CopyRuleRow", {
|
|
551
|
+
method: "POST",
|
|
552
|
+
groupId: changesGroupID.groupId,
|
|
553
|
+
urlParameters: {
|
|
554
|
+
RuleId: sRuleId,
|
|
555
|
+
SourceRowId: sSourceRowId,
|
|
556
|
+
TargetRowSeq: sTargetRowSeq,
|
|
557
|
+
DeleteSourceRow: shouldCut,
|
|
558
|
+
OverrideTargetRow: sOverrideInd
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
this._getModel().submitChanges({
|
|
562
|
+
groupId: changesGroupID.groupId,
|
|
563
|
+
success: submitSuccess,
|
|
564
|
+
error: submitError
|
|
565
|
+
});
|
|
566
|
+
}.bind(this);
|
|
567
|
+
|
|
568
|
+
if (this._getModel().hasPendingChanges()) {
|
|
569
|
+
this._getModel().submitChanges({
|
|
570
|
+
groupId: changesGroupID.groupId,
|
|
571
|
+
success: callFunctionSuccess,
|
|
572
|
+
error: submitError
|
|
573
|
+
});
|
|
574
|
+
} else {
|
|
575
|
+
callFunctionSuccess();
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
|
|
579
|
+
_calNextRowId: function () {
|
|
580
|
+
var rows = this.dataBucket.rows.results;
|
|
581
|
+
var maxRowId = 0;
|
|
582
|
+
//Calc max "Id"
|
|
583
|
+
for (var i = 0; i < rows.length; i++) {
|
|
584
|
+
if (rows[i].Id > maxRowId) {
|
|
585
|
+
maxRowId = rows[i].Id;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
var nextId = maxRowId + 1;
|
|
589
|
+
return nextId;
|
|
590
|
+
},
|
|
591
|
+
|
|
592
|
+
_clearErrorMessages: function () {
|
|
593
|
+
//Clear header message
|
|
594
|
+
var oText = this.getAggregation("_errorsText");
|
|
595
|
+
oText.setText("");
|
|
596
|
+
oText.setVisible(false);
|
|
597
|
+
this._internalModel.setProperty("/validationStatus", {}, null, true);
|
|
598
|
+
this._internalModel.setProperty("/valueState", {}, null, true);
|
|
599
|
+
},
|
|
600
|
+
|
|
601
|
+
//Closes cell popover
|
|
602
|
+
_closePopover: function () {
|
|
603
|
+
var pop = sap.ui.getCore().byId("popover");
|
|
604
|
+
if (pop) {
|
|
605
|
+
pop.close();
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
|
|
609
|
+
_collectColIdAndExpressionDetails: function (columns) {
|
|
610
|
+
var columnCount = columns.length;
|
|
611
|
+
var resultExpressionArray = [];
|
|
612
|
+
for (var columnIndex = 0; columnIndex < columnCount; columnIndex++) {
|
|
613
|
+
if (columns[columnIndex].Result && columns[columnIndex].Result.Expression) {
|
|
614
|
+
var oResult = {
|
|
615
|
+
'columnID': columns[columnIndex].Result.Id,
|
|
616
|
+
'expressionContent': columns[columnIndex].Result.Expression
|
|
617
|
+
};
|
|
618
|
+
resultExpressionArray.push(oResult);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
return resultExpressionArray;
|
|
622
|
+
},
|
|
623
|
+
|
|
624
|
+
_columnFactory: function (sId, oContext) {
|
|
625
|
+
var that = this;
|
|
626
|
+
if (this.multiHeaderFlag) {
|
|
627
|
+
this.multiHeaderFlag = false;
|
|
628
|
+
}
|
|
629
|
+
var relativePath = this._getBindModelName();
|
|
630
|
+
var columnType = oContext.getProperty("Type"),
|
|
631
|
+
coId = oContext.getProperty("Id"),
|
|
632
|
+
ruleId = oContext.getProperty("RuleId"),
|
|
633
|
+
version = oContext.getProperty("Version");
|
|
634
|
+
var oHeaderKey = {
|
|
635
|
+
RuleId: ruleId,
|
|
636
|
+
Id: coId,
|
|
637
|
+
Version: version
|
|
638
|
+
};
|
|
639
|
+
var headPath = relativePath + oContext.getModel().createKey("/DecisionTableColumnResults", oHeaderKey);
|
|
640
|
+
var contextModel = oContext.getModel();
|
|
641
|
+
var bindingInfo = contextModel.aBindings;
|
|
642
|
+
this.columnWidth = "auto";
|
|
643
|
+
|
|
644
|
+
var column = new Column(sId, {
|
|
645
|
+
width: this.columnWidth,
|
|
646
|
+
minWidth : 128,
|
|
647
|
+
multiLabels: [
|
|
648
|
+
this._createColIfThenHeader(oContext), // The order of the labels is important!
|
|
649
|
+
this._createColDescriptionHeader(oContext, this)
|
|
650
|
+
],
|
|
651
|
+
template: this._createCell(oContext) //, headerSpan: columnType === sap.rules.ui.DecisionTableColumn.Condition ? [this.iNumOfCondition, 1] : [this.iNumOfResults, 1]
|
|
652
|
+
});
|
|
653
|
+
|
|
654
|
+
relativePath = this._getBindModelName();
|
|
655
|
+
this.firstResultColumnBound = oContext.getProperty(relativePath + "Type") === sap.rules.ui.DecisionTableColumn.Result;
|
|
656
|
+
if (columnType === sap.rules.ui.DecisionTableColumn.Result) {
|
|
657
|
+
|
|
658
|
+
if (this.getAstExpressionLanguage()) {
|
|
659
|
+
column.bindProperty("visible", {
|
|
660
|
+
parts: [{
|
|
661
|
+
path: headPath + "/AccessMode"
|
|
662
|
+
}],
|
|
663
|
+
formatter: this._columnVisibility
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
if (this.getExpressionLanguage()) {
|
|
667
|
+
|
|
668
|
+
column.bindProperty("visible", {
|
|
669
|
+
parts: [{
|
|
670
|
+
path: headPath + "/AccessMode"
|
|
671
|
+
}],
|
|
672
|
+
formatter: function() {
|
|
673
|
+
var type = that.getModel() && headPath!== "" ? that.getModel().getObject(headPath).BusinessDataType : "";
|
|
674
|
+
if (type === Constants.DATE_BUSINESS_TYPE || type === Constants.TIMESTAMP_BUSINESS_TYPE || type === Constants.NUMBER || type ===
|
|
675
|
+
Constants.STRING || type === Constants.BOOLEAN_BUSINESS_TYPE || type === Constants.BOOLEAN_ENHANCED_BUSINESS_TYPE) {
|
|
676
|
+
var accessMode = that.getModel().getObject(headPath).AccessMode;
|
|
677
|
+
return that._columnVisibility(accessMode);
|
|
678
|
+
} else {
|
|
679
|
+
return false;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
return column;
|
|
687
|
+
},
|
|
688
|
+
|
|
689
|
+
_columnVisibility: function (accessMode) {
|
|
690
|
+
if (accessMode === "Hidden" || accessMode === "HIDDEN") {
|
|
691
|
+
return false;
|
|
692
|
+
} else {
|
|
693
|
+
return true;
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
|
|
697
|
+
_concatinateColumnsHeaderErrors: function (columnErrorsMap) {
|
|
698
|
+
var errorMessage = "";
|
|
699
|
+
for (var column in columnErrorsMap) {
|
|
700
|
+
if (columnErrorsMap.hasOwnProperty(column)) {
|
|
701
|
+
if (columnErrorsMap[column].header) {
|
|
702
|
+
errorMessage += "In Col: " + column + " - " + columnErrorsMap[column].header + "\n";
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
return errorMessage;
|
|
707
|
+
},
|
|
708
|
+
|
|
709
|
+
_concatinateHeaderErrors: function (headerErrorsArray) {
|
|
710
|
+
var errorMessage = "";
|
|
711
|
+
for (var i = 0; i < headerErrorsArray.length; i++) {
|
|
712
|
+
errorMessage += "\n" + headerErrorsArray[i];
|
|
713
|
+
}
|
|
714
|
+
return errorMessage;
|
|
715
|
+
},
|
|
716
|
+
|
|
717
|
+
_convertAndValidate: function () {
|
|
718
|
+
var ruleData = this._getRuleData();
|
|
719
|
+
var oExpressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
720
|
+
if (oExpressionLanguage) {
|
|
721
|
+
var validateResults = {};
|
|
722
|
+
if (oExpressionLanguage && ruleData) {
|
|
723
|
+
validateResults = oExpressionLanguage.convertRuleToDisplayValues(ruleData);
|
|
724
|
+
if (validateResults.deferredResult) {
|
|
725
|
+
validateResults.deferredResult.done(this._processValidationResults.bind(this));
|
|
726
|
+
} else {
|
|
727
|
+
this._processValidationResults(validateResults, ruleData);
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
} else {
|
|
731
|
+
this._displayModel.setData(ruleData);
|
|
732
|
+
this._settingsModel.setData(ruleData);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
},
|
|
736
|
+
|
|
737
|
+
_copyRow: function () {
|
|
738
|
+
this._cutCopyRow("copy");
|
|
739
|
+
},
|
|
740
|
+
|
|
741
|
+
_createCell: function (oContext) {
|
|
742
|
+
var colID = oContext.getProperty("Id");
|
|
743
|
+
var colType = oContext.getProperty("Type");
|
|
744
|
+
|
|
745
|
+
var oCell = new DecisionTableCell({
|
|
746
|
+
editable: "{dtModel>/editable}",
|
|
747
|
+
displayModelName: "displayModel",
|
|
748
|
+
decisionTableCellType: this._decisionTableCellFormatter
|
|
749
|
+
// type: sap.rules.ui.ExpressionType.BooleanEnhanced
|
|
750
|
+
}).data({
|
|
751
|
+
colId: colID,
|
|
752
|
+
colType: colType,
|
|
753
|
+
table: this.getAggregation("_table")
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
if (this.getAstExpressionLanguage()) {
|
|
757
|
+
oCell.setAstExpressionLanguage(this.getAstExpressionLanguage());
|
|
758
|
+
} else {
|
|
759
|
+
oCell.setExpressionLanguage(this.getExpressionLanguage());
|
|
760
|
+
}
|
|
761
|
+
return oCell;
|
|
762
|
+
},
|
|
763
|
+
|
|
764
|
+
_createColDescriptionHeader: function (oContext, oDtControl) {
|
|
765
|
+
var that = this;
|
|
766
|
+
var columnType = oContext.getProperty("Type"),
|
|
767
|
+
coId = oContext.getProperty("Id"),
|
|
768
|
+
ruleId = oContext.getProperty("RuleId"),
|
|
769
|
+
version = oContext.getProperty("Version");
|
|
770
|
+
var relativePath = "";
|
|
771
|
+
var headerPath;
|
|
772
|
+
var sPath;
|
|
773
|
+
var oAstContext;
|
|
774
|
+
var displayExpression;
|
|
775
|
+
var oHeaderKey = {
|
|
776
|
+
RuleId: ruleId,
|
|
777
|
+
Id: coId,
|
|
778
|
+
Version: version
|
|
779
|
+
};
|
|
780
|
+
var sDTColPath;
|
|
781
|
+
|
|
782
|
+
//For rel
|
|
783
|
+
if (this.getExpressionLanguage()) {
|
|
784
|
+
relativePath = "displayModel>";
|
|
785
|
+
}
|
|
786
|
+
var numOfLines = document.getElementsByClassName("sapUiSizeCozy").length > 0 ? 3 : 1;
|
|
787
|
+
|
|
788
|
+
var oText = new Text({
|
|
789
|
+
maxLines: numOfLines
|
|
790
|
+
}).addStyleClass("sapRULDecisionTableColumnHeaderLabel");
|
|
791
|
+
|
|
792
|
+
//Condition header text
|
|
793
|
+
if (columnType === sap.rules.ui.DecisionTableColumn.Condition) {
|
|
794
|
+
sPath = oContext.getModel().createKey("/DecisionTableColumnConditions", oHeaderKey);
|
|
795
|
+
sDTColPath = oContext.getModel().createKey("/DecisionTableColumns", oHeaderKey);
|
|
796
|
+
oAstContext = new sap.ui.model.Context(oContext.getModel(), sPath);
|
|
797
|
+
if (this.getAstExpressionLanguage()) {
|
|
798
|
+
displayExpression = oDtControl._getExpressionFromAstNodes(oAstContext);
|
|
799
|
+
}
|
|
800
|
+
headerPath = relativePath + sPath;
|
|
801
|
+
oText.bindText({
|
|
802
|
+
parts: [{
|
|
803
|
+
path: headerPath + "/Expression"
|
|
804
|
+
}, {
|
|
805
|
+
path: sDTColPath + "/Label"
|
|
806
|
+
}, {
|
|
807
|
+
path: headerPath + "/FixedOperator"
|
|
808
|
+
}],
|
|
809
|
+
formatter: function (sExpression, sLabel, sFixedOperator) {
|
|
810
|
+
//bug RULES-5278
|
|
811
|
+
var titleText = "";
|
|
812
|
+
if(that.getAstExpressionLanguage()){
|
|
813
|
+
titleText = !sLabel ? displayExpression : sLabel;
|
|
814
|
+
} else {
|
|
815
|
+
titleText = !sLabel ? sExpression : sLabel;
|
|
816
|
+
}
|
|
817
|
+
if (sFixedOperator) {
|
|
818
|
+
var sOperator = that.getAstExpressionLanguage() ? that.astUtil._getCapitalOperatorName(sFixedOperator) : sFixedOperator;
|
|
819
|
+
titleText += " " + sOperator;
|
|
820
|
+
}
|
|
821
|
+
return titleText;
|
|
822
|
+
}
|
|
823
|
+
});
|
|
824
|
+
|
|
825
|
+
oText.bindProperty("tooltip", {
|
|
826
|
+
parts: [{
|
|
827
|
+
path: headerPath + "/Expression"
|
|
828
|
+
}, {
|
|
829
|
+
path: headerPath + "/FixedOperator"
|
|
830
|
+
}],
|
|
831
|
+
formatter: function (sExpression, sFixedOperator) {
|
|
832
|
+
var titleText = "";
|
|
833
|
+
if(that.getAstExpressionLanguage()){
|
|
834
|
+
titleText = displayExpression ? displayExpression : "";
|
|
835
|
+
} else {
|
|
836
|
+
titleText = sExpression;
|
|
837
|
+
}
|
|
838
|
+
if (sFixedOperator) {
|
|
839
|
+
var sOperator = that.getAstExpressionLanguage() ? that.astUtil._getCapitalOperatorName(sFixedOperator) : sFixedOperator;
|
|
840
|
+
titleText += " " + sOperator;
|
|
841
|
+
}
|
|
842
|
+
return titleText;
|
|
843
|
+
}
|
|
844
|
+
});
|
|
845
|
+
|
|
846
|
+
//Result header text
|
|
847
|
+
} else if (columnType === sap.rules.ui.DecisionTableColumn.Result) {
|
|
848
|
+
var sResultPath = oContext.getModel().createKey("/DecisionTableColumnResults", oHeaderKey);
|
|
849
|
+
headerPath = relativePath + sResultPath;
|
|
850
|
+
oText.bindText({
|
|
851
|
+
parts: [{
|
|
852
|
+
path: headerPath + "/DataObjectAttributeName"
|
|
853
|
+
}, {
|
|
854
|
+
path: headerPath + "/DataObjectAttributeLabel"
|
|
855
|
+
}, {
|
|
856
|
+
path: "dtModel>/busyState"
|
|
857
|
+
}],
|
|
858
|
+
formatter: this._getOutputColumnDescription.bind(this)
|
|
859
|
+
});
|
|
860
|
+
|
|
861
|
+
oText.bindProperty("tooltip", {
|
|
862
|
+
parts: [{
|
|
863
|
+
path: headerPath + "/DataObjectAttributeName"
|
|
864
|
+
}, {
|
|
865
|
+
path: headerPath + "/DataObjectAttributeLabel"
|
|
866
|
+
}, {
|
|
867
|
+
path: "dtModel>/busyState"
|
|
868
|
+
}],
|
|
869
|
+
formatter: this._getOutputColumnDescription.bind(this)
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
return oText;
|
|
873
|
+
},
|
|
874
|
+
|
|
875
|
+
_createColIfThenHeader: function (oContext) {
|
|
876
|
+
//var model = oContext.getModel();
|
|
877
|
+
var relativePath = this._getBindModelName();
|
|
878
|
+
var oBundle = this.oBundle;
|
|
879
|
+
|
|
880
|
+
return new Label({
|
|
881
|
+
text: {
|
|
882
|
+
parts: [{
|
|
883
|
+
path: relativePath + "Type"
|
|
884
|
+
}, {
|
|
885
|
+
path: relativePath + "Sequence"
|
|
886
|
+
}],
|
|
887
|
+
formatter: function (sType, iSequence) {
|
|
888
|
+
if (iSequence === 1) {
|
|
889
|
+
return oBundle.getText("conditionIfColumn");
|
|
890
|
+
} else if (sType === sap.rules.ui.DecisionTableColumn.Result) {
|
|
891
|
+
return oBundle.getText("resultThenColumn");
|
|
892
|
+
} else {
|
|
893
|
+
return "";
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
},
|
|
897
|
+
design: "Bold"
|
|
898
|
+
});
|
|
899
|
+
},
|
|
900
|
+
|
|
901
|
+
_createDecisionTableSettings: function () {
|
|
902
|
+
var oDecisionTableSettings;
|
|
903
|
+
if (this.isSequenceExistsInOdataMetadata()) {
|
|
904
|
+
oDecisionTableSettings = this._createNewDecisionTableSettings();
|
|
905
|
+
} else {
|
|
906
|
+
oDecisionTableSettings = this._createOldDecisionTableSettings();
|
|
907
|
+
}
|
|
908
|
+
return oDecisionTableSettings;
|
|
909
|
+
},
|
|
910
|
+
|
|
911
|
+
_createNewDecisionTableSettings: function () {
|
|
912
|
+
var oModel = this._getModel();
|
|
913
|
+
var oContext = this.getBindingContext();
|
|
914
|
+
var oDecisionTableSettings = new sap.rules.ui.DecisionTableSettings({
|
|
915
|
+
hitPolicies: "{dtModel>/hitPolicies}",
|
|
916
|
+
newDecisionTable: this._internalModel.getProperty("/newTable"),
|
|
917
|
+
cellFormat: "{dtModel>/cellFormat}",
|
|
918
|
+
decisionTableFormat: this.getDecisionTableFormat(),
|
|
919
|
+
enableSettingResult: this.getEnableSettingResult()
|
|
920
|
+
});
|
|
921
|
+
if (this.getAstExpressionLanguage()) {
|
|
922
|
+
oDecisionTableSettings.setAstExpressionLanguage(this.getAstExpressionLanguage());
|
|
923
|
+
} else {
|
|
924
|
+
oDecisionTableSettings.setExpressionLanguage(this.getExpressionLanguage());
|
|
925
|
+
}
|
|
926
|
+
//Create a copy of the setting model.
|
|
927
|
+
var settingModelDataStr = JSON.stringify(this._settingsModel.getData());
|
|
928
|
+
var settingModelData = JSON.parse(settingModelDataStr);
|
|
929
|
+
|
|
930
|
+
var settingModel = new sap.ui.model.json.JSONModel(settingModelData);
|
|
931
|
+
|
|
932
|
+
oDecisionTableSettings.setModel(settingModel);
|
|
933
|
+
|
|
934
|
+
//Set configuration model
|
|
935
|
+
oDecisionTableSettings.setModel(this._internalModel, "dtModel");
|
|
936
|
+
|
|
937
|
+
//Set OdataModel + context (needed for apply button)
|
|
938
|
+
oDecisionTableSettings.setModel(oModel, "oDataModel");
|
|
939
|
+
|
|
940
|
+
oDecisionTableSettings.setBindingContext(oContext, "dummy");
|
|
941
|
+
|
|
942
|
+
return oDecisionTableSettings;
|
|
943
|
+
},
|
|
944
|
+
|
|
945
|
+
_createOldDecisionTableSettings: function () {
|
|
946
|
+
var oModel = this._getModel();
|
|
947
|
+
var oContext = this.getBindingContext();
|
|
948
|
+
var oDecisionTableSettings = new DecisionTableSettingsOld({
|
|
949
|
+
expressionLanguage: this.getExpressionLanguage(),
|
|
950
|
+
hitPolicies: "{dtModel>/hitPolicies}",
|
|
951
|
+
newDecisionTable: this._internalModel.getProperty("/newTable")
|
|
952
|
+
});
|
|
953
|
+
oDecisionTableSettings.setModel(oModel);
|
|
954
|
+
oDecisionTableSettings.setModel(this._internalModel, "dtModel");
|
|
955
|
+
oDecisionTableSettings.setBindingContext(oContext);
|
|
956
|
+
return oDecisionTableSettings;
|
|
957
|
+
},
|
|
958
|
+
|
|
959
|
+
_cutCopyRow: function (operation) {
|
|
960
|
+
var oModel = this._getModel();
|
|
961
|
+
if (!oModel) {
|
|
962
|
+
return;
|
|
963
|
+
}
|
|
964
|
+
var oTable = this.getAggregation("_table");
|
|
965
|
+
var oSelectedRows = [];
|
|
966
|
+
if (oTable) {
|
|
967
|
+
oSelectedRows = oTable.getSelectedIndices();
|
|
968
|
+
}
|
|
969
|
+
if (oSelectedRows.length !== 1) {
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
var rowPath = oTable.getContextByIndex(oSelectedRows[0]).getPath();
|
|
973
|
+
this._markSelection(false);
|
|
974
|
+
this.setLineActionBuffer({
|
|
975
|
+
rowPath: rowPath,
|
|
976
|
+
operation: operation
|
|
977
|
+
});
|
|
978
|
+
this._markSelection(true);
|
|
979
|
+
oTable.setSelectedIndex(-1);
|
|
980
|
+
sap.m.MessageToast.show(this.oBundle.getText(operation + "RowSuccess"));
|
|
981
|
+
},
|
|
982
|
+
|
|
983
|
+
_cutRow: function () {
|
|
984
|
+
this._cutCopyRow("cut");
|
|
985
|
+
},
|
|
986
|
+
|
|
987
|
+
// dataBucket
|
|
988
|
+
_dataPartRequested: function (partName) {
|
|
989
|
+
this.dataBucket.dataReceived[partName] = false;
|
|
990
|
+
this._setDataLoadedPromise();
|
|
991
|
+
this._updateBusyState();
|
|
992
|
+
},
|
|
993
|
+
|
|
994
|
+
_dataPartReceived: function (partName) {
|
|
995
|
+
this.dataBucket.dataReceived[partName] = true;
|
|
996
|
+
if (!this._isAllDataReceived()) {
|
|
997
|
+
return;
|
|
998
|
+
}
|
|
999
|
+
try {
|
|
1000
|
+
this._convertAndValidate();
|
|
1001
|
+
this.dataBucket.collectRowsMode = "replace";
|
|
1002
|
+
} catch (sError) {
|
|
1003
|
+
// show message Toast
|
|
1004
|
+
window.console.log(sError);
|
|
1005
|
+
}
|
|
1006
|
+
this._updateBusyState();
|
|
1007
|
+
this._dataLoaded.resolve();
|
|
1008
|
+
},
|
|
1009
|
+
|
|
1010
|
+
_decideAddRowEnablement: function (newTable) {
|
|
1011
|
+
return !newTable;
|
|
1012
|
+
},
|
|
1013
|
+
|
|
1014
|
+
_decideCopyRowEnablement: function (newTable, isExactlyOneRowSelected) {
|
|
1015
|
+
return newTable === false && isExactlyOneRowSelected;
|
|
1016
|
+
},
|
|
1017
|
+
|
|
1018
|
+
_decideDeleteRowEnablement: function (newTable, isAtLeastOneRowSelected) {
|
|
1019
|
+
return newTable === false && isAtLeastOneRowSelected;
|
|
1020
|
+
},
|
|
1021
|
+
|
|
1022
|
+
_decideLineActionVisibility: function (isEditable, isSequenceExist) {
|
|
1023
|
+
return isEditable === true && isSequenceExist;
|
|
1024
|
+
},
|
|
1025
|
+
|
|
1026
|
+
_decidePasteRowEnablement: function (newTable, isExactlyOneRowSelected, isSelection) {
|
|
1027
|
+
return newTable === false && isExactlyOneRowSelected && isSelection;
|
|
1028
|
+
},
|
|
1029
|
+
|
|
1030
|
+
_decideSelectionMode: function (editable) {
|
|
1031
|
+
return editable ? sap.ui.table.SelectionMode.MultiToggle : sap.ui.table.SelectionMode.None;
|
|
1032
|
+
},
|
|
1033
|
+
|
|
1034
|
+
_decideSettingsEnablement: function (enableSettings, editable) {
|
|
1035
|
+
return enableSettings && editable;
|
|
1036
|
+
},
|
|
1037
|
+
|
|
1038
|
+
_deleteRow: function () {
|
|
1039
|
+
var oModel = this._getModel();
|
|
1040
|
+
if (!oModel) {
|
|
1041
|
+
return;
|
|
1042
|
+
}
|
|
1043
|
+
var oTable = this.getAggregation("_table");
|
|
1044
|
+
var oSelectedRows = [];
|
|
1045
|
+
if (oTable) {
|
|
1046
|
+
oSelectedRows = oTable.getSelectedIndices();
|
|
1047
|
+
}
|
|
1048
|
+
if (oSelectedRows.length === 0) {
|
|
1049
|
+
return;
|
|
1050
|
+
}
|
|
1051
|
+
var rowsLength = oSelectedRows.length;
|
|
1052
|
+
for (var i = 0; i < rowsLength; i++) {
|
|
1053
|
+
var rowPath = oTable.getContextByIndex(oSelectedRows[i]).getPath();
|
|
1054
|
+
// remove row
|
|
1055
|
+
oModel.remove(rowPath);
|
|
1056
|
+
}
|
|
1057
|
+
oTable.setSelectedIndex(-1);
|
|
1058
|
+
this._clearErrorMessages();
|
|
1059
|
+
this.setLineActionBuffer({
|
|
1060
|
+
rowPath: null,
|
|
1061
|
+
operation: null
|
|
1062
|
+
});
|
|
1063
|
+
sap.m.MessageToast.show(this.oBundle.getText("deleteRowSuccess"));
|
|
1064
|
+
},
|
|
1065
|
+
|
|
1066
|
+
_deleteRowWorkaround: function () {
|
|
1067
|
+
var oModel = this._getModel();
|
|
1068
|
+
if (oModel.hasPendingChanges()) {
|
|
1069
|
+
// save all model's changes before row removal
|
|
1070
|
+
this._saveWorkAround({
|
|
1071
|
+
success: function () {
|
|
1072
|
+
this._deleteRow();
|
|
1073
|
+
}.bind(this)
|
|
1074
|
+
});
|
|
1075
|
+
} else {
|
|
1076
|
+
this._deleteRow();
|
|
1077
|
+
}
|
|
1078
|
+
},
|
|
1079
|
+
|
|
1080
|
+
_displayErrorMessages: function (headerErrorsArray, columnErrorsMap) {
|
|
1081
|
+
// I commnted this call in order to remove the header error message, next we'll add here a different errors control
|
|
1082
|
+
//this._displayHeaderErrorMessages(headerErrorsArray, columnErrorsMap);
|
|
1083
|
+
},
|
|
1084
|
+
|
|
1085
|
+
_displayHeaderErrorMessages: function (headerErrorsArray, columnErrorsMap) {
|
|
1086
|
+
var oText = this.getAggregation("_errorsText");
|
|
1087
|
+
this.oBundle = sap.ui.getCore().getLibraryResourceBundle("sap.rules.ui.i18n");
|
|
1088
|
+
var errorHeaderMessage = this._concatinateHeaderErrors(headerErrorsArray);
|
|
1089
|
+
oText.setText(this.oBundle.getText("errorInTableHeader") + errorHeaderMessage); // + "\n" + errorColumnsHeaderMessage);
|
|
1090
|
+
oText.setVisible(true);
|
|
1091
|
+
},
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* @private
|
|
1095
|
+
* Gets a rule in deep format (as returned from the parser), and flats the rule to the format of the oDataModel.
|
|
1096
|
+
* e.g. DecisionTableRowCell(RuleId='0050569181751ED683EFEEC6AA2B73C5', Version='000001', RowId='1', ColId='1')
|
|
1097
|
+
* @param {oRule} oRule in deep format
|
|
1098
|
+
* @returns {object} rule in oDataModel flatted format
|
|
1099
|
+
*/
|
|
1100
|
+
_flatRule: function (oRule) {
|
|
1101
|
+
var oModel = this._getModel();
|
|
1102
|
+
var oRuleFlat = {};
|
|
1103
|
+
var createEntry = function (oData, entryName, properties) {
|
|
1104
|
+
var key = oModel.createKey(entryName, properties);
|
|
1105
|
+
oData[key] = properties;
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
// Flat columns
|
|
1109
|
+
oRule.DecisionTable.DecisionTableColumns.results.forEach(function (col, index) {
|
|
1110
|
+
if (col.Type === "CONDITION") {
|
|
1111
|
+
var condition = col.Condition;
|
|
1112
|
+
if (condition.parserResults && condition.parserResults.status === "Success") {
|
|
1113
|
+
condition.Expression = condition.parserResults.converted.Expression;
|
|
1114
|
+
if (condition.parserResults.converted.FixedOperator || condition.parserResults.converted.FixedOperator === "") {
|
|
1115
|
+
condition.FixedOperator = condition.parserResults.converted.FixedOperator;
|
|
1116
|
+
} else {
|
|
1117
|
+
condition.FixedOperator = condition.FixedOperator;
|
|
1118
|
+
}
|
|
1119
|
+
} else {
|
|
1120
|
+
try {
|
|
1121
|
+
condition.Expression = JSON.parse(condition.Expression).text;
|
|
1122
|
+
} catch (err) {
|
|
1123
|
+
condition.Expression = condition.Expression;
|
|
1124
|
+
}
|
|
1125
|
+
try {
|
|
1126
|
+
condition.FixedOperator = JSON.parse(condition.FixedOperator).text;
|
|
1127
|
+
} catch (err) {
|
|
1128
|
+
condition.Expression = condition.Expression;
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
delete condition.parserResults;
|
|
1132
|
+
createEntry(oRuleFlat, "DecisionTableColumnConditions", condition);
|
|
1133
|
+
} else if (col.Type === "RESULT") {
|
|
1134
|
+
var result = col.Result;
|
|
1135
|
+
createEntry(oRuleFlat, "DecisionTableColumnResults", result);
|
|
1136
|
+
}
|
|
1137
|
+
});
|
|
1138
|
+
|
|
1139
|
+
// Flat cells
|
|
1140
|
+
oRule.DecisionTable.DecisionTableRows.results.forEach(function (row) {
|
|
1141
|
+
var cellArr = row.Cells;
|
|
1142
|
+
cellArr.results.forEach(function (cell) {
|
|
1143
|
+
if (cell.parserResults && cell.parserResults.status === "Success") {
|
|
1144
|
+
if(cell.parserResults.converted.Content){
|
|
1145
|
+
cell.Content = cell.parserResults.converted.Content;
|
|
1146
|
+
}else{
|
|
1147
|
+
cell.Content = cell.Content;
|
|
1148
|
+
}
|
|
1149
|
+
} else if (cell.parserResults && cell.parserResults.status === "Error") {
|
|
1150
|
+
try {
|
|
1151
|
+
if (cell.Content === Object) {
|
|
1152
|
+
cell.Content = JSON.parse(cell.Content).text;
|
|
1153
|
+
} else {
|
|
1154
|
+
cell.Content = cell.Content;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
} catch (err) {
|
|
1158
|
+
cell.Content = "";
|
|
1159
|
+
Log.error("failed to pars AST cell in ColId " + cell.ColId + " RowId " + cell.RowId +
|
|
1160
|
+
" set cell content to empty");
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
delete cell.parserResults;
|
|
1164
|
+
createEntry(oRuleFlat, "DecisionTableRowCells", cell);
|
|
1165
|
+
});
|
|
1166
|
+
});
|
|
1167
|
+
|
|
1168
|
+
return oRuleFlat;
|
|
1169
|
+
},
|
|
1170
|
+
|
|
1171
|
+
_getBindModelName: function () {
|
|
1172
|
+
var path = "";
|
|
1173
|
+
var modelName = this.getModelName();
|
|
1174
|
+
if (modelName) {
|
|
1175
|
+
path = modelName + ">";
|
|
1176
|
+
}
|
|
1177
|
+
return path;
|
|
1178
|
+
},
|
|
1179
|
+
|
|
1180
|
+
_getBlankContent: function () {
|
|
1181
|
+
var oLabelContent = new Label({
|
|
1182
|
+
text: this.oBundle.getText("start")
|
|
1183
|
+
});
|
|
1184
|
+
var oSpaceTextContent = new Text();
|
|
1185
|
+
oSpaceTextContent.setText("\u00a0");
|
|
1186
|
+
var oLinkToSettingsFromBlank = new Link({
|
|
1187
|
+
enabled: {
|
|
1188
|
+
parts: [{
|
|
1189
|
+
path: "dtModel>/enableSettings"
|
|
1190
|
+
}, {
|
|
1191
|
+
path: "dtModel>/editable"
|
|
1192
|
+
}],
|
|
1193
|
+
formatter: this._decideSettingsEnablement
|
|
1194
|
+
},
|
|
1195
|
+
text: " " + this.oBundle.getText("settings"),
|
|
1196
|
+
press: [this._openTableSettings, this]
|
|
1197
|
+
}).addStyleClass("sapRULDecisionTableLink");
|
|
1198
|
+
|
|
1199
|
+
var oFlexBox = new FlexBox({
|
|
1200
|
+
justifyContent: "Center",
|
|
1201
|
+
items: [oLabelContent, oSpaceTextContent, oLinkToSettingsFromBlank],
|
|
1202
|
+
visible: {
|
|
1203
|
+
parts: [{
|
|
1204
|
+
path: "dtModel>/enableSettings"
|
|
1205
|
+
}, {
|
|
1206
|
+
path: "dtModel>/editable"
|
|
1207
|
+
}],
|
|
1208
|
+
formatter: this._decideSettingsEnablement
|
|
1209
|
+
}
|
|
1210
|
+
}).addStyleClass("sapUiMediumMargin");
|
|
1211
|
+
|
|
1212
|
+
return oFlexBox;
|
|
1213
|
+
},
|
|
1214
|
+
|
|
1215
|
+
_getDataLoadedPromise: function () {
|
|
1216
|
+
if (!this._dataLoaded) {
|
|
1217
|
+
this._setDataLoadedPromise();
|
|
1218
|
+
}
|
|
1219
|
+
return this._dataLoaded.promise();
|
|
1220
|
+
},
|
|
1221
|
+
|
|
1222
|
+
_getExpressionFromAstNodes: function (oContext) {
|
|
1223
|
+
var that = this;
|
|
1224
|
+
var oAstExpressionLanguage = sap.ui.getCore().byId(this.getAstExpressionLanguage());
|
|
1225
|
+
var termsProvider = oAstExpressionLanguage._astBunldeInstance.TermsProvider.TermsProvider;
|
|
1226
|
+
var displayExpression = "";
|
|
1227
|
+
var displayTermExpression = "";
|
|
1228
|
+
var sPath = oContext.getPath();
|
|
1229
|
+
var oData = oContext.getObject(sPath);
|
|
1230
|
+
var astList = oData.DecisionTableColumnConditionASTs;
|
|
1231
|
+
var oAstUtil = oAstExpressionLanguage._astBunldeInstance.ASTUtil;
|
|
1232
|
+
var columnArray = this._internalModel.getProperty("/conditionCellAstValues");
|
|
1233
|
+
var len = 0;
|
|
1234
|
+
var jsonLength = 0;
|
|
1235
|
+
var aFunction = [ConstantUtils.AVG, ConstantUtils.SUM, ConstantUtils.COUNT, ConstantUtils.COUNTDISTINCT, ConstantUtils.DISTINCT,
|
|
1236
|
+
ConstantUtils.MIN, ConstantUtils.MAX, ConstantUtils.FILTER, ConstantUtils.TOP, ConstantUtils.BOTTOM, ConstantUtils.FIRST, ConstantUtils.SELECT, ConstantUtils.SORTASC, ConstantUtils.SORTDESC];
|
|
1237
|
+
oAstUtil.clearNodes();
|
|
1238
|
+
astList = astList.__list;
|
|
1239
|
+
if (astList && astList.length > 0) {
|
|
1240
|
+
for (var entry in astList) {
|
|
1241
|
+
var path = astList[entry];
|
|
1242
|
+
that._addNodeObject(oContext.getObject("/" + path));
|
|
1243
|
+
}
|
|
1244
|
+
var astNodes = oAstUtil.getNodes();
|
|
1245
|
+
//displayExpression = oAstUtil.toAstExpressionString(astNodes);
|
|
1246
|
+
var dateFormat = that._getDateFormatter();
|
|
1247
|
+
var timeFormat = that._getDateTimeFormatter();
|
|
1248
|
+
displayExpression = oAstUtil.toAstExpressionStringForDt(astNodes, dateFormat, timeFormat);
|
|
1249
|
+
jsonLength = displayExpression.JSON.length;
|
|
1250
|
+
var fixedOperator = oContext.getObject(oContext.getPath()).FixedOperator;
|
|
1251
|
+
var sOperator = that.astUtil._getCapitalOperatorName(fixedOperator);
|
|
1252
|
+
if(displayExpression && displayExpression.relString) {
|
|
1253
|
+
displayExpression.relString = displayExpression.relString.replace(/\\/g,"\\\\").replace(/{/g, "\\{").replace(/}/g, "\\}");
|
|
1254
|
+
}
|
|
1255
|
+
columnArray[oContext.getPath()] = {
|
|
1256
|
+
"headerValue": displayExpression.relString + " " + sOperator
|
|
1257
|
+
};
|
|
1258
|
+
var termsArray = displayExpression.shortRELString ? displayExpression.shortRELString.split(" ") : [];
|
|
1259
|
+
termsArray = displayExpression.displayString ? displayExpression.displayString.split(" ") : [];
|
|
1260
|
+
for (var term in termsArray) {
|
|
1261
|
+
var referenceExpression = "";
|
|
1262
|
+
if (termsArray[term].startsWith("./") || termsArray[term].startsWith("/")) {
|
|
1263
|
+
referenceExpression = termsProvider.getTermNameFromASTNodeReference(termsArray[term]);
|
|
1264
|
+
}
|
|
1265
|
+
if (referenceExpression !== "") {
|
|
1266
|
+
displayTermExpression = displayTermExpression + " " + referenceExpression;
|
|
1267
|
+
} else {
|
|
1268
|
+
var splitArray = termsArray[term].split("(");
|
|
1269
|
+
if(that.includes(aFunction,splitArray[0]) && len < jsonLength){
|
|
1270
|
+
termsArray[term] = termsArray[term].replace(displayExpression.JSON[len].dataObject,
|
|
1271
|
+
termsProvider.getTermNameFromASTNodeReference(displayExpression.JSON[len].dataObject));
|
|
1272
|
+
len++;
|
|
1273
|
+
}
|
|
1274
|
+
displayTermExpression = displayTermExpression + " " + termsArray[term];
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
if (displayTermExpression != "") {
|
|
1278
|
+
displayExpression = displayTermExpression;
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
if (!columnArray[oContext.getPath()]) {
|
|
1282
|
+
columnArray[oContext.getPath()] = {
|
|
1283
|
+
"headerValue": ""
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
this._internalModel.setProperty("/conditionCellAstValues", columnArray);
|
|
1287
|
+
return (displayExpression instanceof Object ? displayExpression.shortRELString : displayExpression.trim());
|
|
1288
|
+
},
|
|
1289
|
+
|
|
1290
|
+
_getMenuItems: function () {
|
|
1291
|
+
var oMenuItems = [
|
|
1292
|
+
new MenuItem({
|
|
1293
|
+
text: this.oBundle.getText("insertFirst"),
|
|
1294
|
+
enabled: true,
|
|
1295
|
+
press: this._addNewRowWorkaround.bind(this, true)
|
|
1296
|
+
}),
|
|
1297
|
+
new MenuItem({
|
|
1298
|
+
text: this.oBundle.getText("insertAfter"),
|
|
1299
|
+
enabled: {
|
|
1300
|
+
parts: [{
|
|
1301
|
+
path: "dtModel>/newTable"
|
|
1302
|
+
}, {
|
|
1303
|
+
path: "dtModel>/isExactlyOneRowSelected"
|
|
1304
|
+
}],
|
|
1305
|
+
formatter: this._decideCopyRowEnablement
|
|
1306
|
+
},
|
|
1307
|
+
// select: this._addNewRow.bind(this, oSelectedRows[0], false)
|
|
1308
|
+
press: this._addNewRowWorkaround.bind(this, false)
|
|
1309
|
+
})
|
|
1310
|
+
];
|
|
1311
|
+
return oMenuItems;
|
|
1312
|
+
},
|
|
1313
|
+
|
|
1314
|
+
_getModel: function () {
|
|
1315
|
+
var modelName = this.getModelName();
|
|
1316
|
+
if (modelName) {
|
|
1317
|
+
return this.getModel(modelName);
|
|
1318
|
+
}
|
|
1319
|
+
return this.getModel();
|
|
1320
|
+
},
|
|
1321
|
+
|
|
1322
|
+
_getOutputColumnDescription: function (oName, oLabel) {
|
|
1323
|
+
var expLanguage;
|
|
1324
|
+
if (this.getExpressionLanguage()) {
|
|
1325
|
+
expLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
1326
|
+
if (expLanguage && expLanguage._isDataExist()) {
|
|
1327
|
+
var ResultID = this.getBindingContext().getProperty("ResultDataObjectId");
|
|
1328
|
+
var desc = expLanguage.getResultColumnDescription(oName, ResultID, oLabel);
|
|
1329
|
+
return desc;
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
return (oLabel ? oLabel : oName);
|
|
1333
|
+
},
|
|
1334
|
+
|
|
1335
|
+
_getPasteMenuItems: function () {
|
|
1336
|
+
var oMenuItems = [
|
|
1337
|
+
new MenuItem({
|
|
1338
|
+
text: this.oBundle.getText("pasteRowAction"),
|
|
1339
|
+
enabled: {
|
|
1340
|
+
parts: [{
|
|
1341
|
+
path: "dtModel>/newTable"
|
|
1342
|
+
}, {
|
|
1343
|
+
path: "dtModel>/isExactlyOneRowSelected"
|
|
1344
|
+
}],
|
|
1345
|
+
formatter: this._decideCopyRowEnablement
|
|
1346
|
+
},
|
|
1347
|
+
// select: this._addNewRow.bind(this, oSelectedRows[0], true)
|
|
1348
|
+
press: this._rowAction.bind(this, "paste")
|
|
1349
|
+
}),
|
|
1350
|
+
new MenuItem({
|
|
1351
|
+
text: this.oBundle.getText("insertBeforeRowAction"),
|
|
1352
|
+
enabled: {
|
|
1353
|
+
parts: [{
|
|
1354
|
+
path: "dtModel>/newTable"
|
|
1355
|
+
}, {
|
|
1356
|
+
path: "dtModel>/isExactlyOneRowSelected"
|
|
1357
|
+
}],
|
|
1358
|
+
formatter: this._decideCopyRowEnablement
|
|
1359
|
+
},
|
|
1360
|
+
// select: this._addNewRow.bind(this, oSelectedRows[0], false)
|
|
1361
|
+
press: this._rowAction.bind(this, "insertBefore")
|
|
1362
|
+
}),
|
|
1363
|
+
new MenuItem({
|
|
1364
|
+
text: this.oBundle.getText("insertAfterRowAction"),
|
|
1365
|
+
enabled: {
|
|
1366
|
+
parts: [{
|
|
1367
|
+
path: "dtModel>/newTable"
|
|
1368
|
+
}, {
|
|
1369
|
+
path: "dtModel>/isExactlyOneRowSelected"
|
|
1370
|
+
}],
|
|
1371
|
+
formatter: this._decideCopyRowEnablement
|
|
1372
|
+
},
|
|
1373
|
+
// select: this._addNewRow.bind(this, oSelectedRows[0], false)
|
|
1374
|
+
press: this._rowAction.bind(this, "insertAfter")
|
|
1375
|
+
})
|
|
1376
|
+
];
|
|
1377
|
+
return oMenuItems;
|
|
1378
|
+
},
|
|
1379
|
+
|
|
1380
|
+
_getRuleData: function () {
|
|
1381
|
+
var contextPath = this.getBindingContextPath();
|
|
1382
|
+
var oModel = this._getModel();
|
|
1383
|
+
var ruleData = jQuery.extend({}, true, oModel.getProperty(contextPath, null, true));
|
|
1384
|
+
var dtData = ruleData.DecisionTable;
|
|
1385
|
+
dtData.DecisionTableColumns = this.dataBucket.columns;
|
|
1386
|
+
dtData.DecisionTableRows = this.dataBucket.rows;
|
|
1387
|
+
return ruleData;
|
|
1388
|
+
},
|
|
1389
|
+
|
|
1390
|
+
// cols
|
|
1391
|
+
_handleColumnsDataReceived: function (oEvent) {
|
|
1392
|
+
var data = oEvent.getParameter("data");
|
|
1393
|
+
if (!data) {
|
|
1394
|
+
return;
|
|
1395
|
+
}
|
|
1396
|
+
// change newTable flag
|
|
1397
|
+
// set table.noData according to newTable flag
|
|
1398
|
+
var oTable = this.getAggregation("_table");
|
|
1399
|
+
if (data.results && data.results.length > 0) {
|
|
1400
|
+
this._internalModel.setProperty("/newTable", false);
|
|
1401
|
+
oTable.setNoData(null);
|
|
1402
|
+
this._setExpressionLanguageVersionOnoData(false);
|
|
1403
|
+
} else {
|
|
1404
|
+
this._internalModel.setProperty("/newTable", true);
|
|
1405
|
+
var blankContent = this._getBlankContent();
|
|
1406
|
+
oTable.setNoData(blankContent);
|
|
1407
|
+
this._setExpressionLanguageVersionOnoData(true);
|
|
1408
|
+
}
|
|
1409
|
+
this.dataBucket[dataPartName.columns] = data;
|
|
1410
|
+
this._dataPartReceived(dataPartName.columns);
|
|
1411
|
+
this._handleHeaderSpan();
|
|
1412
|
+
},
|
|
1413
|
+
|
|
1414
|
+
_handleColumnsDataRequested: function (oEvent) {
|
|
1415
|
+
this._dataPartRequested(dataPartName.columns);
|
|
1416
|
+
},
|
|
1417
|
+
|
|
1418
|
+
// rows
|
|
1419
|
+
_handleRowsDataReceived: function (oEvent) {
|
|
1420
|
+
var data = oEvent.getParameter("data");
|
|
1421
|
+
if (data) {
|
|
1422
|
+
if (this.dataBucket.collectRowsMode === "replace") {
|
|
1423
|
+
this.dataBucket[dataPartName.rows] = data;
|
|
1424
|
+
this.dataBucket.collectRowsMode = "append";
|
|
1425
|
+
} else {
|
|
1426
|
+
// "append"
|
|
1427
|
+
var previousData = this.dataBucket[dataPartName.rows];
|
|
1428
|
+
var newData = {
|
|
1429
|
+
results: (previousData.results) ? previousData.results.concat(data.results) : data.results
|
|
1430
|
+
};
|
|
1431
|
+
this.dataBucket[dataPartName.rows] = newData;
|
|
1432
|
+
}
|
|
1433
|
+
this._dataPartReceived(dataPartName.rows);
|
|
1434
|
+
}
|
|
1435
|
+
this._setTableRows();
|
|
1436
|
+
},
|
|
1437
|
+
|
|
1438
|
+
_handleRowsDataRequested: function (oEvent) {
|
|
1439
|
+
this._dataPartRequested(dataPartName.rows);
|
|
1440
|
+
},
|
|
1441
|
+
|
|
1442
|
+
// rule
|
|
1443
|
+
_handleRuleDataReceived: function (data) {
|
|
1444
|
+
if (data) {
|
|
1445
|
+
this._dataPartReceived(dataPartName.rule);
|
|
1446
|
+
}
|
|
1447
|
+
},
|
|
1448
|
+
|
|
1449
|
+
_handleRuleDataRequested: function () {
|
|
1450
|
+
this._dataPartRequested(dataPartName.rule);
|
|
1451
|
+
},
|
|
1452
|
+
|
|
1453
|
+
// vocabulary
|
|
1454
|
+
_handleVocabularyDataChanged: function (oEvent) {
|
|
1455
|
+
var data = oEvent.getParameter("data");
|
|
1456
|
+
if (data) {
|
|
1457
|
+
this._handleVocabularyDataReceived(data);
|
|
1458
|
+
} else {
|
|
1459
|
+
this._handleVocabularyDataRequested();
|
|
1460
|
+
}
|
|
1461
|
+
},
|
|
1462
|
+
|
|
1463
|
+
_handleVocabularyDataReceived: function (data) {
|
|
1464
|
+
if (data) {
|
|
1465
|
+
this._dataPartReceived(dataPartName.vocabulary);
|
|
1466
|
+
}
|
|
1467
|
+
},
|
|
1468
|
+
|
|
1469
|
+
_handleVocabularyDataRequested: function () {
|
|
1470
|
+
this._dataPartRequested(dataPartName.vocabulary);
|
|
1471
|
+
},
|
|
1472
|
+
|
|
1473
|
+
_handleHeaderSpan: function () {
|
|
1474
|
+
if (!this.multiHeaderFlag) {
|
|
1475
|
+
var i;
|
|
1476
|
+
this.multiHeaderFlag = true;
|
|
1477
|
+
var aColumns = this.dataBucket.columns.results;
|
|
1478
|
+
this.iNumOfCondition = 0;
|
|
1479
|
+
this.iNumOfResults = 0;
|
|
1480
|
+
for (i = 0; i < aColumns.length; i++) {
|
|
1481
|
+
if (aColumns[i].Type === sap.rules.ui.DecisionTableColumn.Condition) {
|
|
1482
|
+
this.iNumOfCondition++;
|
|
1483
|
+
} else if (aColumns[i].Type === sap.rules.ui.DecisionTableColumn.Result) {
|
|
1484
|
+
this.iNumOfResults++;
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
var oTable = this.getAggregation('_table');
|
|
1488
|
+
aColumns = oTable.getAggregation('columns');
|
|
1489
|
+
for (i = 0; i < this.iNumOfCondition; i++) {
|
|
1490
|
+
aColumns[i].setHeaderSpan([this.iNumOfCondition, 1]);
|
|
1491
|
+
}
|
|
1492
|
+
for (; i < aColumns.length; i++) {
|
|
1493
|
+
aColumns[i].setHeaderSpan([this.iNumOfResults, 1]);
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
},
|
|
1497
|
+
|
|
1498
|
+
_initDataBucket: function () {
|
|
1499
|
+
var vocaDataReceived = false;
|
|
1500
|
+
var oEL;
|
|
1501
|
+
if (this.getAstExpressionLanguage()) {
|
|
1502
|
+
oEL = sap.ui.getCore().byId(this.getAstExpressionLanguage());
|
|
1503
|
+
} else {
|
|
1504
|
+
oEL = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
1505
|
+
}
|
|
1506
|
+
if (oEL && oEL._isDataExist()) {
|
|
1507
|
+
vocaDataReceived = true;
|
|
1508
|
+
}
|
|
1509
|
+
this.dataBucket = {
|
|
1510
|
+
dataReceived: {
|
|
1511
|
+
vocabulary: vocaDataReceived,
|
|
1512
|
+
rule: false,
|
|
1513
|
+
rows: false,
|
|
1514
|
+
columns: false
|
|
1515
|
+
},
|
|
1516
|
+
rows: {},
|
|
1517
|
+
columns: {},
|
|
1518
|
+
collectRowsMode: "replace" // "append"
|
|
1519
|
+
};
|
|
1520
|
+
},
|
|
1521
|
+
|
|
1522
|
+
_initDisplayModel: function () {
|
|
1523
|
+
this._displayModel = new sap.ui.model.json.JSONModel();
|
|
1524
|
+
this.setModel(this._displayModel, "displayModel");
|
|
1525
|
+
this._settingsModel = new sap.ui.model.json.JSONModel();
|
|
1526
|
+
this.setModel(this._settingsModel, "settingModel");
|
|
1527
|
+
},
|
|
1528
|
+
|
|
1529
|
+
_initInternalModel: function () {
|
|
1530
|
+
var data = {};
|
|
1531
|
+
data.editable = this.getEditable();
|
|
1532
|
+
data.newTable = true;
|
|
1533
|
+
data.sequenceExist = true;
|
|
1534
|
+
data.busyState = true;
|
|
1535
|
+
data.busyTableState = true;
|
|
1536
|
+
data.cellFormat = this.getCellFormat();
|
|
1537
|
+
data.hitPolicies = this.getHitPolicies();
|
|
1538
|
+
data.enableSettings = this.getEnableSettings();
|
|
1539
|
+
data.isAtLeastOneRowSelected = false;
|
|
1540
|
+
data.isExactlyOneRowSelected = false;
|
|
1541
|
+
data.isSelection = false;
|
|
1542
|
+
data.validationStatus = {};
|
|
1543
|
+
data.valueState = {};
|
|
1544
|
+
data.selectedRow = null;
|
|
1545
|
+
data.conditionCellAstValues = [];
|
|
1546
|
+
data.ruleBindingPath = "";
|
|
1547
|
+
this._internalModel = new sap.ui.model.json.JSONModel(data);
|
|
1548
|
+
this.setModel(this._internalModel, "dtModel");
|
|
1549
|
+
},
|
|
1550
|
+
|
|
1551
|
+
_isAllDataReceived: function () {
|
|
1552
|
+
var dataParts = this.dataBucket.dataReceived;
|
|
1553
|
+
return dataParts.rule && dataParts.rows && dataParts.columns && dataParts.vocabulary;
|
|
1554
|
+
},
|
|
1555
|
+
|
|
1556
|
+
_markSelection: function (bMarkSelection) {
|
|
1557
|
+
var rowPath = this.getLineActionBuffer().rowPath;
|
|
1558
|
+
var oTable = this.getAggregation("_table");
|
|
1559
|
+
var oModel = this._getModel();
|
|
1560
|
+
if (rowPath) {
|
|
1561
|
+
var firstVisibleRow = oTable.getFirstVisibleRow();
|
|
1562
|
+
var rowIndex = oModel.getProperty(rowPath).Sequence - 1;
|
|
1563
|
+
if ((rowIndex - firstVisibleRow > -1) && (rowIndex - firstVisibleRow < oTable.getVisibleRowCount())) {
|
|
1564
|
+
var oRow = oTable.getRows()[rowIndex - firstVisibleRow];
|
|
1565
|
+
var oCells = oRow.getCells();
|
|
1566
|
+
if (oCells) {
|
|
1567
|
+
for (var i = 0; i < oCells.length; i++) {
|
|
1568
|
+
if (bMarkSelection) {
|
|
1569
|
+
//jQuery(oCells[i].getDomRef()).parent().parent().parent().addClass("sapRULDecisionTableSCellMarked");
|
|
1570
|
+
oCells[i].addStyleClass("sapRULDecisionTableSCellMarked");
|
|
1571
|
+
} else {
|
|
1572
|
+
//jQuery(oCells[i].getDomRef()).parent().parent().parent().removeClass("sapRULDecisionTableSCellMarked");
|
|
1573
|
+
oCells[i].removeStyleClass("sapRULDecisionTableSCellMarked");
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
},
|
|
1580
|
+
|
|
1581
|
+
_openTableSettings: function () {
|
|
1582
|
+
//bug 5230 - after apply we call twice to validateRule - need to clear dataBucket.rows
|
|
1583
|
+
this.dataBucket.dataReceived.rows = false;
|
|
1584
|
+
var decisionTableSettings = this._createDecisionTableSettings();
|
|
1585
|
+
var oDialog = new Dialog({
|
|
1586
|
+
contentWidth: "70%",
|
|
1587
|
+
contentHeight: "490px",
|
|
1588
|
+
title: this.oBundle.getText("tableSettings")
|
|
1589
|
+
});
|
|
1590
|
+
oDialog.addContent(decisionTableSettings);
|
|
1591
|
+
var aButtons = decisionTableSettings.getButtons(oDialog);
|
|
1592
|
+
for (var i = 0; i < aButtons.length; i++) {
|
|
1593
|
+
oDialog.addButton(aButtons[i]);
|
|
1594
|
+
}
|
|
1595
|
+
oDialog.attachBeforeClose(function (oData) {
|
|
1596
|
+
var dialogState = oDialog.getState();
|
|
1597
|
+
oDialog.destroy();
|
|
1598
|
+
//User press on "Apply" (and not on "Cancel")
|
|
1599
|
+
if (dialogState === sap.ui.core.ValueState.Success) {
|
|
1600
|
+
this._initDisplayModel();
|
|
1601
|
+
this._refreshBinding();
|
|
1602
|
+
}
|
|
1603
|
+
}, this);
|
|
1604
|
+
this._closePopover();
|
|
1605
|
+
oDialog.open();
|
|
1606
|
+
},
|
|
1607
|
+
|
|
1608
|
+
/**
|
|
1609
|
+
* @private
|
|
1610
|
+
* @param {validateResults} validateResults -
|
|
1611
|
+
* @param {ruleData} ruleData -
|
|
1612
|
+
*/
|
|
1613
|
+
_processValidationResults: function (validateResults, ruleData) {
|
|
1614
|
+
if (validateResults && validateResults.output) {
|
|
1615
|
+
if (validateResults.output.status === "Error") {
|
|
1616
|
+
var headerErrorsArray = [];
|
|
1617
|
+
var columnErrorsMap = this._internalModel.getProperty("/validationStatus");
|
|
1618
|
+
var cellValueStateMap = {};
|
|
1619
|
+
columnErrorsMap = this._buildMessagesStructure(validateResults, columnErrorsMap, headerErrorsArray);
|
|
1620
|
+
for (var cell in columnErrorsMap) {
|
|
1621
|
+
if (columnErrorsMap.hasOwnProperty(cell) && (typeof columnErrorsMap[cell] === "string") && columnErrorsMap[cell] !== "null") {
|
|
1622
|
+
cellValueStateMap[cell] = sap.ui.core.ValueState.Error;
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
this._displayErrorMessages(headerErrorsArray, columnErrorsMap);
|
|
1626
|
+
|
|
1627
|
+
this._internalModel.setProperty("/validationStatus", columnErrorsMap, null, true);
|
|
1628
|
+
this._internalModel.setProperty("/valueState", cellValueStateMap, null, true);
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
var flatData = this._flatRule(validateResults.output.decisionTableData);
|
|
1632
|
+
//validateResults.output.decisionTableData.DecisionTable.DecisionTableRows = null;
|
|
1633
|
+
this._settingsModel.setData(validateResults.output.decisionTableData);
|
|
1634
|
+
if (this.dataBucket.rows.results) {
|
|
1635
|
+
this._settingsModel.rowLength = this.dataBucket.rows.results.length;
|
|
1636
|
+
}
|
|
1637
|
+
this._displayModel.setData(flatData, true);
|
|
1638
|
+
}
|
|
1639
|
+
},
|
|
1640
|
+
|
|
1641
|
+
_rowAction: function (operation) {
|
|
1642
|
+
this._rowActionWorkAround(operation);
|
|
1643
|
+
},
|
|
1644
|
+
|
|
1645
|
+
_rowActionWorkAround: function (operation) {
|
|
1646
|
+
var selectedRow = this._internalModel.getProperty("/selectedRow");
|
|
1647
|
+
this._markSelection(false);
|
|
1648
|
+
var buffer = this.getLineActionBuffer();
|
|
1649
|
+
this.setLineActionBuffer({
|
|
1650
|
+
rowPath: null,
|
|
1651
|
+
operation: null
|
|
1652
|
+
});
|
|
1653
|
+
var oTable = this.getAggregation("_table");
|
|
1654
|
+
|
|
1655
|
+
var sTargetRowSeq = selectedRow + 1;
|
|
1656
|
+
if (operation === "insertAfter") {
|
|
1657
|
+
sTargetRowSeq++;
|
|
1658
|
+
}
|
|
1659
|
+
var oModel = this._getModel();
|
|
1660
|
+
var sSourceRowId = oModel.getProperty(buffer.rowPath).Id;
|
|
1661
|
+
var sRuleId = oModel.getProperty(buffer.rowPath).RuleId;
|
|
1662
|
+
var sVersion = oModel.getProperty(buffer.rowPath).Version;
|
|
1663
|
+
this._internalModel.setProperty("/busyState", true);
|
|
1664
|
+
var isCut = (buffer.operation === "cut");
|
|
1665
|
+
if (operation === "paste") {
|
|
1666
|
+
this._callCopyRuleRow(sRuleId, sVersion, sSourceRowId, sTargetRowSeq, isCut, true);
|
|
1667
|
+
} else {
|
|
1668
|
+
this._callCopyRuleRow(sRuleId, sVersion, sSourceRowId, sTargetRowSeq, isCut, false);
|
|
1669
|
+
}
|
|
1670
|
+
oTable.setSelectedIndex(-1);
|
|
1671
|
+
if (operation === "insertBefore" || operation === "insertAfter") {
|
|
1672
|
+
sap.m.MessageToast.show(this.oBundle.getText("addRowSuccess"));
|
|
1673
|
+
}
|
|
1674
|
+
if (operation === "paste") {
|
|
1675
|
+
sap.m.MessageToast.show(this.oBundle.getText("pasteSuccess"));
|
|
1676
|
+
}
|
|
1677
|
+
},
|
|
1678
|
+
|
|
1679
|
+
_refreshBinding: function () {
|
|
1680
|
+
var oTable = this.getAggregation("_table");
|
|
1681
|
+
var ruleBinding = this.getElementBinding();
|
|
1682
|
+
if (ruleBinding) {
|
|
1683
|
+
ruleBinding.refresh();
|
|
1684
|
+
}
|
|
1685
|
+
var columnBinding = oTable.getBinding("columns");
|
|
1686
|
+
if (columnBinding) {
|
|
1687
|
+
columnBinding.refresh();
|
|
1688
|
+
}
|
|
1689
|
+
var rowBinding = oTable.getBinding("rows");
|
|
1690
|
+
if (rowBinding) {
|
|
1691
|
+
rowBinding.refresh();
|
|
1692
|
+
}
|
|
1693
|
+
var oEventBus = sap.ui.getCore().getEventBus();
|
|
1694
|
+
oEventBus.publish("sap.ui.rules", "refreshDTRuleModel");
|
|
1695
|
+
},
|
|
1696
|
+
|
|
1697
|
+
_rowSelectionChange: function () {
|
|
1698
|
+
var oTable = this.getAggregation("_table");
|
|
1699
|
+
var oSelectedRows = [];
|
|
1700
|
+
if (oTable) {
|
|
1701
|
+
oSelectedRows = oTable.getSelectedIndices();
|
|
1702
|
+
}
|
|
1703
|
+
if (oSelectedRows.length > 0) {
|
|
1704
|
+
this._internalModel.setProperty("/isAtLeastOneRowSelected", true);
|
|
1705
|
+
this._internalModel.setProperty("/selectedRow", oSelectedRows[0]);
|
|
1706
|
+
} else {
|
|
1707
|
+
this._internalModel.setProperty("/isAtLeastOneRowSelected", false);
|
|
1708
|
+
}
|
|
1709
|
+
if (oSelectedRows.length == 1) {
|
|
1710
|
+
this._internalModel.setProperty("/isExactlyOneRowSelected", true);
|
|
1711
|
+
} else {
|
|
1712
|
+
this._internalModel.setProperty("/isExactlyOneRowSelected", false);
|
|
1713
|
+
}
|
|
1714
|
+
if (this.getLineActionBuffer().rowPath) {
|
|
1715
|
+
this._internalModel.setProperty("/isSelection", true);
|
|
1716
|
+
} else {
|
|
1717
|
+
this._internalModel.setProperty("/isSelection", false);
|
|
1718
|
+
}
|
|
1719
|
+
},
|
|
1720
|
+
|
|
1721
|
+
_setDataLoadedPromise: function () {
|
|
1722
|
+
if (!this._dataLoaded || this._dataLoaded.state() !== "pending") {
|
|
1723
|
+
this._dataLoaded = new jQuery.Deferred();
|
|
1724
|
+
}
|
|
1725
|
+
},
|
|
1726
|
+
|
|
1727
|
+
// set the ExpressionLanguageVersion for new rule on oData model according to the parser version, for old rule without ExpressionLanguageVersion we set old parser version on type and not on the model.
|
|
1728
|
+
_setExpressionLanguageVersionOnoData: function (bNewRule) {
|
|
1729
|
+
var oModel = this._getModel();
|
|
1730
|
+
var oContext = this.getBindingContext();
|
|
1731
|
+
var sVersion = "1.0.0";
|
|
1732
|
+
if (bNewRule) {
|
|
1733
|
+
var oEL;
|
|
1734
|
+
if (this.getAstExpressionLanguage()) {
|
|
1735
|
+
oEL = sap.ui.getCore().byId(this.getAstExpressionLanguage());
|
|
1736
|
+
sVersion = "2.0.0";
|
|
1737
|
+
} else {
|
|
1738
|
+
oEL = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
1739
|
+
sVersion = oEL.getExpressionLanguageVersion();
|
|
1740
|
+
}
|
|
1741
|
+
oModel.setProperty("ExpressionLanguageVersion", sVersion, oContext, true);
|
|
1742
|
+
} else {
|
|
1743
|
+
sVersion = oModel.getProperty(this.getBindingContextPath() + '/ExpressionLanguageVersion');
|
|
1744
|
+
if (!sVersion) {
|
|
1745
|
+
sVersion = "1.0.0";
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
this._decisionTableCellFormatter.setExpressionLanguageVersion(sVersion);
|
|
1749
|
+
},
|
|
1750
|
+
|
|
1751
|
+
_setTableRows: function () {
|
|
1752
|
+
var oTable = this.getAggregation("_table");
|
|
1753
|
+
var oRowBinding = oTable.getBinding("rows");
|
|
1754
|
+
var iVisibleRowCount = emptyTable;
|
|
1755
|
+
if (oRowBinding && oRowBinding.getLength()) {
|
|
1756
|
+
iVisibleRowCount = Math.min(oRowBinding.getLength(), this.VISIBLEROWCOUNT);
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
var currVisibleRowCount = oTable.getVisibleRowCount();
|
|
1760
|
+
if (currVisibleRowCount !== iVisibleRowCount) {
|
|
1761
|
+
oTable.setVisibleRowCount(iVisibleRowCount);
|
|
1762
|
+
}
|
|
1763
|
+
if ((this.dataBucket && this.dataBucket.rows && this.dataBucket.rows.results.length === 0) || !this.getEditable()) {
|
|
1764
|
+
oTable.setSelectionMode(sap.ui.table.SelectionMode.None);
|
|
1765
|
+
} else {
|
|
1766
|
+
oTable.setSelectionMode(sap.ui.table.SelectionMode.MultiToggle);
|
|
1767
|
+
}
|
|
1768
|
+
},
|
|
1769
|
+
|
|
1770
|
+
_unbindColumns: function () {
|
|
1771
|
+
var oTable = this.getAggregation("_table");
|
|
1772
|
+
oTable.unbindColumns();
|
|
1773
|
+
},
|
|
1774
|
+
|
|
1775
|
+
_unbindRows: function () {
|
|
1776
|
+
var oTable = this.getAggregation("_table");
|
|
1777
|
+
oTable.unbindRows();
|
|
1778
|
+
},
|
|
1779
|
+
|
|
1780
|
+
_unbindRule: function () {
|
|
1781
|
+
this.unbindElement();
|
|
1782
|
+
},
|
|
1783
|
+
|
|
1784
|
+
_updateBusyState: function () {
|
|
1785
|
+
var dataParts = this.dataBucket.dataReceived;
|
|
1786
|
+
var dataReceived = dataParts.rule && dataParts.columns && dataParts.vocabulary;
|
|
1787
|
+
var isBusy = !dataReceived;
|
|
1788
|
+
this._internalModel.setProperty("/busyState", isBusy);
|
|
1789
|
+
var tableIsBusy = !dataParts.rows;
|
|
1790
|
+
this._internalModel.setProperty("/busyTableState", tableIsBusy);
|
|
1791
|
+
},
|
|
1792
|
+
|
|
1793
|
+
_updateTableCell: function (oCell, oRowContext, dtDomElement, rowIndex) {
|
|
1794
|
+
//jQuery(oCell.getDomRef()).parent().parent().parent().removeClass("sapRULDecisionTableSCellMarked");
|
|
1795
|
+
oCell.removeStyleClass("sapRULDecisionTableSCellMarked");
|
|
1796
|
+
var path = "null";
|
|
1797
|
+
var that = this;
|
|
1798
|
+
var oParent = this.getParent();
|
|
1799
|
+
|
|
1800
|
+
if (oRowContext) {
|
|
1801
|
+
var colId = oCell.data("colId");
|
|
1802
|
+
var rowId = oRowContext.getProperty("Id");
|
|
1803
|
+
var ruleId = oRowContext.getProperty("RuleId");
|
|
1804
|
+
var version = oRowContext.getProperty("Version");
|
|
1805
|
+
var oModel = oRowContext.getModel();
|
|
1806
|
+
|
|
1807
|
+
var headerPath = '';
|
|
1808
|
+
var rulePath = '';
|
|
1809
|
+
// NOTE: we assume that colId represents also the order of Columns and starts from 1
|
|
1810
|
+
var oCellProperties = {
|
|
1811
|
+
RuleId :ruleId,
|
|
1812
|
+
ColId: colId,
|
|
1813
|
+
RowId: rowId,
|
|
1814
|
+
Version: version
|
|
1815
|
+
};
|
|
1816
|
+
var cellBindingPath = oModel.createKey("/DecisionTableRowCells", oCellProperties);
|
|
1817
|
+
var oCellContext = new sap.ui.model.Context(oModel, cellBindingPath);
|
|
1818
|
+
|
|
1819
|
+
//Condition path from model
|
|
1820
|
+
var oProperties = {
|
|
1821
|
+
RuleId: ruleId,
|
|
1822
|
+
Id: colId,
|
|
1823
|
+
Version: version
|
|
1824
|
+
};
|
|
1825
|
+
var sConditionPath = oModel.createKey("/DecisionTableColumnConditions", oProperties);
|
|
1826
|
+
var columnArray = oParent.getModel("dtModel").getData().conditionCellAstValues;
|
|
1827
|
+
|
|
1828
|
+
//var bindModelName = oCell.data("bindModelName");
|
|
1829
|
+
|
|
1830
|
+
var cellKeyProperties = {
|
|
1831
|
+
RuleId: ruleId,
|
|
1832
|
+
Id: colId,
|
|
1833
|
+
Version: version
|
|
1834
|
+
};
|
|
1835
|
+
|
|
1836
|
+
var ruleKeyProperties = {
|
|
1837
|
+
Id: ruleId,
|
|
1838
|
+
Version: version
|
|
1839
|
+
};
|
|
1840
|
+
|
|
1841
|
+
path = cellBindingPath + "/Content";
|
|
1842
|
+
|
|
1843
|
+
switch (oCell.data("colType")) {
|
|
1844
|
+
case "CONDITION":
|
|
1845
|
+
headerPath = "/" + oModel.createKey("DecisionTableColumnConditions", cellKeyProperties);
|
|
1846
|
+
rulePath = "/" + oModel.createKey("Rules", ruleKeyProperties);
|
|
1847
|
+
oCell.setHeaderValuePath(headerPath + '/Expression');
|
|
1848
|
+
oCell.setFixedOperatorPath(headerPath + '/FixedOperator');
|
|
1849
|
+
oCell.setRuleFormatPath(rulePath + '/RuleFormat');
|
|
1850
|
+
oCell.setDecisionTableFormat(that.getParent().getDecisionTableFormat());
|
|
1851
|
+
oCell.setValueOnlyPath(headerPath + '/ValueOnly');
|
|
1852
|
+
if (columnArray[sConditionPath]) {
|
|
1853
|
+
oCell.setHeaderInfo(columnArray[sConditionPath]);
|
|
1854
|
+
}
|
|
1855
|
+
break;
|
|
1856
|
+
case "RESULT":
|
|
1857
|
+
headerPath = "/" + oModel.createKey("DecisionTableColumnResults", cellKeyProperties);
|
|
1858
|
+
rulePath = "/" + oModel.createKey("Rules", ruleKeyProperties);
|
|
1859
|
+
oCell.setTypePath(headerPath + '/BusinessDataType');
|
|
1860
|
+
if (sap.ui.getCore().byId(oParent.getAstExpressionLanguage())) {
|
|
1861
|
+
var sResultDataObjectId = oParent.getModel("settingModel").getData().ResultDataObjectId;
|
|
1862
|
+
var sAttributeId = oModel.getProperty(headerPath + '/DataObjectAttributeId');
|
|
1863
|
+
oCell.setAttributeInfoPath("/" + sResultDataObjectId + "/" + that.getParent()._formatAttributeId(sAttributeId));
|
|
1864
|
+
} else {
|
|
1865
|
+
oCell.setAttributeInfoPath(headerPath + '/DataObjectAttributeId');
|
|
1866
|
+
}
|
|
1867
|
+
oCell.setAttributeNamePath(headerPath + '/DataObjectAttributeName');
|
|
1868
|
+
oCell.setRuleFormatPath(rulePath + '/RuleFormat');
|
|
1869
|
+
oCell.setDecisionTableFormat(that.getParent().getDecisionTableFormat());
|
|
1870
|
+
break;
|
|
1871
|
+
|
|
1872
|
+
default:
|
|
1873
|
+
break;
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
oCell.setKeyProperties(oCellProperties);
|
|
1877
|
+
oCell.setValueStateTextPath("dtModel>/validationStatus/" + "RowId=" + rowId + ",ColId=" + colId);
|
|
1878
|
+
oCell.setValueStatePath("dtModel>/valueState/" + "RowId=" + rowId + ",ColId=" + colId);
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
oCell.setValuePath(path);
|
|
1882
|
+
},
|
|
1883
|
+
|
|
1884
|
+
//In case of reference object we will have attribues with ":" which should be replace by /
|
|
1885
|
+
_formatAttributeId: function (attributeId) {
|
|
1886
|
+
var formattedAttributeId = attributeId;
|
|
1887
|
+
if(formattedAttributeId && formattedAttributeId.indexOf(":") > -1) {
|
|
1888
|
+
formattedAttributeId = formattedAttributeId.replace(/:/g, "/");
|
|
1889
|
+
}
|
|
1890
|
+
return formattedAttributeId
|
|
1891
|
+
},
|
|
1892
|
+
|
|
1893
|
+
exit: function () {
|
|
1894
|
+
var oMenu = this.oMenu;
|
|
1895
|
+
if (oMenu) {
|
|
1896
|
+
oMenu.destroy();
|
|
1897
|
+
}
|
|
1898
|
+
},
|
|
1899
|
+
|
|
1900
|
+
init: function () {
|
|
1901
|
+
this.multiHeaderFlag = false; //flag for calculate only once header span for multi header in columnFactory function
|
|
1902
|
+
this.resetContent = true;
|
|
1903
|
+
this.astUtil = new AstUtil();
|
|
1904
|
+
this._initInternalModel();
|
|
1905
|
+
this._initDisplayModel();
|
|
1906
|
+
this._initDataBucket();
|
|
1907
|
+
this.bindProperty("busy", "dtModel>/busyState");
|
|
1908
|
+
this.oBundle = sap.ui.getCore().getLibraryResourceBundle("sap.rules.ui.i18n");
|
|
1909
|
+
this._addToolBar();
|
|
1910
|
+
this._addTable();
|
|
1911
|
+
this._addErrorLabel();
|
|
1912
|
+
this._decisionTableCellFormatter = new DecisionTableCellFormatter();
|
|
1913
|
+
this.setBusyIndicatorDelay(0);
|
|
1914
|
+
},
|
|
1915
|
+
|
|
1916
|
+
isSequenceExistsInOdataMetadata: function () {
|
|
1917
|
+
var model = this.getModel();
|
|
1918
|
+
if (model) {
|
|
1919
|
+
var serviceMetadata = model.getServiceMetadata();
|
|
1920
|
+
if (serviceMetadata) {
|
|
1921
|
+
var aEntities = serviceMetadata.dataServices.schema[0].entityType;
|
|
1922
|
+
var entity;
|
|
1923
|
+
var aProperties;
|
|
1924
|
+
var property;
|
|
1925
|
+
|
|
1926
|
+
for (var i = 0; i < aEntities.length; i++) {
|
|
1927
|
+
entity = aEntities[i];
|
|
1928
|
+
|
|
1929
|
+
if (entity.name !== "DecisionTableColumn") {
|
|
1930
|
+
continue;
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
aProperties = entity.property;
|
|
1934
|
+
|
|
1935
|
+
for (var j = 0; j < aProperties.length; j++) {
|
|
1936
|
+
property = aProperties[j];
|
|
1937
|
+
|
|
1938
|
+
if (property.name === "Sequence") {
|
|
1939
|
+
return true;
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
return false;
|
|
1946
|
+
},
|
|
1947
|
+
|
|
1948
|
+
onBeforeRendering: function () {
|
|
1949
|
+
if (this.resetContent) {
|
|
1950
|
+
this.resetControl();
|
|
1951
|
+
this.resetContent = false;
|
|
1952
|
+
}
|
|
1953
|
+
},
|
|
1954
|
+
|
|
1955
|
+
resetControl: function () {
|
|
1956
|
+
this._unbindRule();
|
|
1957
|
+
this._unbindRows();
|
|
1958
|
+
this._unbindColumns();
|
|
1959
|
+
this._clearErrorMessages();
|
|
1960
|
+
this._initDataBucket();
|
|
1961
|
+
this._initDisplayModel();
|
|
1962
|
+
this._updateBusyState();
|
|
1963
|
+
var oModel = this._getModel();
|
|
1964
|
+
var bindingContextPath = this.getBindingContextPath();
|
|
1965
|
+
if (!bindingContextPath || !oModel) {
|
|
1966
|
+
return;
|
|
1967
|
+
}
|
|
1968
|
+
var oContext = new sap.ui.model.Context(oModel, bindingContextPath);
|
|
1969
|
+
this._internalModel.setProperty("/ruleBindingPath", bindingContextPath);
|
|
1970
|
+
this.setBindingContext(oContext);
|
|
1971
|
+
this._bindRule();
|
|
1972
|
+
this._bindRows();
|
|
1973
|
+
this._bindColumns();
|
|
1974
|
+
},
|
|
1975
|
+
|
|
1976
|
+
/** Control's properties getters/setters */
|
|
1977
|
+
setAstExpressionLanguage: function (value) {
|
|
1978
|
+
this.setAssociation("astExpressionLanguage", value, true);
|
|
1979
|
+
var astExpressionLanguage = (value instanceof Object) ? value : sap.ui.getCore().byId(value);
|
|
1980
|
+
if (!astExpressionLanguage) {
|
|
1981
|
+
return this;
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
// if table has been built already - refresh it
|
|
1985
|
+
var oTable = this.getAggregation("_table");
|
|
1986
|
+
if (oTable) {
|
|
1987
|
+
var columnBinding = oTable.getBinding("columns");
|
|
1988
|
+
if (columnBinding) {
|
|
1989
|
+
columnBinding.refresh();
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
if (astExpressionLanguage._isDataExist()) {
|
|
1994
|
+
var oEvent = new sap.ui.base.Event("", "", {
|
|
1995
|
+
data: true
|
|
1996
|
+
});
|
|
1997
|
+
this._handleVocabularyDataChanged(oEvent);
|
|
1998
|
+
}
|
|
1999
|
+
astExpressionLanguage.attachDataChange(this._handleVocabularyDataChanged.bind(this));
|
|
2000
|
+
|
|
2001
|
+
return this;
|
|
2002
|
+
},
|
|
2003
|
+
|
|
2004
|
+
setBindingContextPath: function (value) {
|
|
2005
|
+
var oldValue = this.getBindingContextPath();
|
|
2006
|
+
if (value && (oldValue !== value)) {
|
|
2007
|
+
this._unbindRule();
|
|
2008
|
+
this._unbindRows();
|
|
2009
|
+
this._unbindColumns();
|
|
2010
|
+
this.setProperty("bindingContextPath", value);
|
|
2011
|
+
this.resetContent = true;
|
|
2012
|
+
|
|
2013
|
+
// reset dataBucket now (don't wait for onBeforeRendering),
|
|
2014
|
+
// attemption for preventing possible convertAndFormat with wrong data
|
|
2015
|
+
this._initDataBucket();
|
|
2016
|
+
var oModel = this.getModel()
|
|
2017
|
+
if (!oModel.isMetadataLoadingFailed()) {
|
|
2018
|
+
if (oModel.getServiceMetadata()) {
|
|
2019
|
+
this._internalModel.setProperty("/sequenceExist", this.isSequenceExistsInOdataMetadata());
|
|
2020
|
+
} else {
|
|
2021
|
+
oModel.attachMetadataLoaded(function () {
|
|
2022
|
+
this._internalModel.setProperty("/sequenceExist", this.isSequenceExistsInOdataMetadata());
|
|
2023
|
+
}.bind(this));
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
return this;
|
|
2028
|
+
},
|
|
2029
|
+
|
|
2030
|
+
setCellFormat: function (value) {
|
|
2031
|
+
this.setProperty("cellFormat", value, true);
|
|
2032
|
+
this._internalModel.setProperty("/cellFormat", value);
|
|
2033
|
+
return this;
|
|
2034
|
+
},
|
|
2035
|
+
|
|
2036
|
+
setEditable: function (value) {
|
|
2037
|
+
this.setProperty("editable", value, true);
|
|
2038
|
+
this._internalModel.setProperty("/editable", value);
|
|
2039
|
+
this._internalModel.setProperty("/sequenceExist", this.isSequenceExistsInOdataMetadata());
|
|
2040
|
+
var oTable = this.getAggregation("_table");
|
|
2041
|
+
var oToolbar = this.getAggregation("_toolbar");
|
|
2042
|
+
if (value === false) {
|
|
2043
|
+
oTable.addStyleClass("sapRULDecisionTableEdit");
|
|
2044
|
+
oToolbar.removeStyleClass("sapRULDecisionTableToolBar");
|
|
2045
|
+
} else {
|
|
2046
|
+
oTable.removeStyleClass("sapRULDecisionTableEdit");
|
|
2047
|
+
oToolbar.addStyleClass("sapRULDecisionTableToolBar");
|
|
2048
|
+
}
|
|
2049
|
+
if (value === false) {
|
|
2050
|
+
this._clearErrorMessages();
|
|
2051
|
+
}
|
|
2052
|
+
return this;
|
|
2053
|
+
},
|
|
2054
|
+
|
|
2055
|
+
setEnableSettings: function (value) {
|
|
2056
|
+
this.setProperty("enableSettings", value, true);
|
|
2057
|
+
this._internalModel.setProperty("/enableSettings", value);
|
|
2058
|
+
return this;
|
|
2059
|
+
},
|
|
2060
|
+
|
|
2061
|
+
setEnableSettingResult: function (value) {
|
|
2062
|
+
this.setProperty("enableSettingResult", value, true);
|
|
2063
|
+
return this;
|
|
2064
|
+
},
|
|
2065
|
+
|
|
2066
|
+
setExpressionLanguage: function (value) {
|
|
2067
|
+
this.setAssociation("expressionLanguage", value, true);
|
|
2068
|
+
this._decisionTableCellFormatter.setExpressionLanguage(this.getExpressionLanguage());
|
|
2069
|
+
var expressionLanguage = (value instanceof Object) ? value : sap.ui.getCore().byId(value);
|
|
2070
|
+
if (!expressionLanguage) {
|
|
2071
|
+
return this;
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
// if table has been built already - refresh it
|
|
2075
|
+
var oTable = this.getAggregation("_table");
|
|
2076
|
+
if (oTable) {
|
|
2077
|
+
var columnBinding = oTable.getBinding("columns");
|
|
2078
|
+
if (columnBinding) {
|
|
2079
|
+
columnBinding.refresh();
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
if (expressionLanguage._isDataExist()) {
|
|
2084
|
+
var oEvent = new sap.ui.base.Event("", "", {
|
|
2085
|
+
data: true
|
|
2086
|
+
});
|
|
2087
|
+
this._handleVocabularyDataChanged(oEvent);
|
|
2088
|
+
}
|
|
2089
|
+
expressionLanguage.attachDataChange(this._handleVocabularyDataChanged.bind(this));
|
|
2090
|
+
|
|
2091
|
+
return this;
|
|
2092
|
+
},
|
|
2093
|
+
|
|
2094
|
+
setHitPolicies: function (value) {
|
|
2095
|
+
this.setProperty("hitPolicies", value, true);
|
|
2096
|
+
this._internalModel.setProperty("/hitPolicies", value);
|
|
2097
|
+
return this;
|
|
2098
|
+
},
|
|
2099
|
+
|
|
2100
|
+
setModelName: function (value) {
|
|
2101
|
+
this.setProperty("modelName", value);
|
|
2102
|
+
this.resetContent = true;
|
|
2103
|
+
return this;
|
|
2104
|
+
},
|
|
2105
|
+
|
|
2106
|
+
renderer: DecisionTableRenderer
|
|
2107
|
+
|
|
2108
|
+
});
|
|
2109
|
+
|
|
2110
|
+
/**
|
|
2111
|
+
* @private
|
|
2112
|
+
* @param {map} mParameters? -
|
|
2113
|
+
*/
|
|
2114
|
+
sap.rules.ui.DecisionTable.prototype._saveWorkAround = function (mParameters, toastMessage) {
|
|
2115
|
+
var oModel = this._getModel();
|
|
2116
|
+
oModel.submitChanges(mParameters);
|
|
2117
|
+
sap.m.MessageToast.show(toastMessage);
|
|
2118
|
+
};
|
|
2119
|
+
|
|
2120
|
+
sap.rules.ui.DecisionTable.prototype.includes = function (parent, str) {
|
|
2121
|
+
var returnValue = false;
|
|
2122
|
+
|
|
2123
|
+
if (parent.indexOf(str) !== -1) {
|
|
2124
|
+
returnValue = true;
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
return returnValue;
|
|
2128
|
+
};
|
|
2129
|
+
|
|
2130
|
+
sap.rules.ui.DecisionTable.prototype._getLocaleData = function () {
|
|
2131
|
+
var oLocale = sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale();
|
|
2132
|
+
return LocaleData.getInstance(oLocale);
|
|
2133
|
+
};
|
|
2134
|
+
|
|
2135
|
+
sap.rules.ui.DecisionTable.prototype._getDateFormatter = function () {
|
|
2136
|
+
var oLocaleData = this._getLocaleData();
|
|
2137
|
+
var datePattern = oLocaleData.getDatePattern('medium');
|
|
2138
|
+
var dateFormatter = sap.ui.core.format.DateFormat.getDateInstance({
|
|
2139
|
+
pattern: datePattern
|
|
2140
|
+
});
|
|
2141
|
+
return dateFormatter;
|
|
2142
|
+
};
|
|
2143
|
+
|
|
2144
|
+
sap.rules.ui.DecisionTable.prototype._getDateTimeFormatter = function () {
|
|
2145
|
+
var oLocaleData = this._getLocaleData();
|
|
2146
|
+
var datePattern = oLocaleData.getDatePattern('medium');
|
|
2147
|
+
var timePattern = oLocaleData.getTimePattern('medium');
|
|
2148
|
+
var dateTimeFormatter = sap.ui.core.format.DateFormat.getDateTimeInstance({
|
|
2149
|
+
pattern: datePattern + " " + timePattern
|
|
2150
|
+
});
|
|
2151
|
+
return dateTimeFormatter;
|
|
2152
|
+
};
|
|
2153
|
+
|
|
2154
|
+
sap.rules.ui.DecisionTable.prototype.VISIBLEROWCOUNT = 30;
|
|
2155
|
+
|
|
2156
|
+
sap.rules.ui.DecisionTable.prototype.THRESHOLD = 30;
|
|
2157
|
+
|
|
2158
|
+
return oDecisionTable;
|
|
2159
|
+
|
|
2160
|
+
}, /* bExport= */ true);
|