@magic-xpa/engine 4.1100.0-dev4110.24 → 4.1100.0-dev4110.241

Sign up to get free protection for your applications and to get access to all the features.
Files changed (516) hide show
  1. package/{esm2020 → esm2022}/index.mjs +188 -188
  2. package/{esm2020 → esm2022}/magic-xpa-engine.mjs +1 -1
  3. package/esm2022/src/AccessHelper.mjs +15 -0
  4. package/esm2022/src/ClientManager.mjs +416 -0
  5. package/esm2022/src/CommandsProcessorBase.mjs +56 -0
  6. package/esm2022/src/CommandsProcessorManager.mjs +26 -0
  7. package/esm2022/src/CommandsTable.mjs +162 -0
  8. package/esm2022/src/ConstInterface.mjs +517 -0
  9. package/{esm2020 → esm2022}/src/CurrentClientVersion.mjs +2 -2
  10. package/esm2022/src/FlowMonitorInterface.mjs +16 -0
  11. package/esm2022/src/GUIManager.mjs +62 -0
  12. package/esm2022/src/GlobalCommandsManager.mjs +34 -0
  13. package/esm2022/src/GuiEventsProcessor.mjs +156 -0
  14. package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
  15. package/esm2022/src/ServerConfig.mjs +122 -0
  16. package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
  17. package/esm2022/src/bridge/MagicBridge.mjs +41 -0
  18. package/esm2022/src/commands/ClientOriginatedCommandTaskTag.mjs +12 -0
  19. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserLocateDataViewCommand.mjs +8 -8
  20. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserRangeDataviewCommand.mjs +9 -9
  21. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserSortDataViewCommand.mjs +9 -9
  22. package/{esm2020 → esm2022}/src/commands/ClientToServer/BrowserEscEventCommand.mjs +23 -23
  23. package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
  24. package/esm2022/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +60 -0
  25. package/{esm2020 → esm2022}/src/commands/ClientToServer/ColumnSortEventCommand.mjs +26 -26
  26. package/esm2022/src/commands/ClientToServer/CommandFactory.mjs +260 -0
  27. package/esm2022/src/commands/ClientToServer/CommandSerializationHelper.mjs +67 -0
  28. package/{esm2020 → esm2022}/src/commands/ClientToServer/ComputeEventCommand.mjs +23 -23
  29. package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTerminationEventCommand.mjs +20 -20
  30. package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTimeoutResetCommand.mjs +19 -19
  31. package/{esm2020 → esm2022}/src/commands/ClientToServer/ControlItemsRefreshCommand.mjs +8 -8
  32. package/esm2022/src/commands/ClientToServer/DataViewOutputCommand.mjs +13 -0
  33. package/{esm2020 → esm2022}/src/commands/ClientToServer/DataviewCommand.mjs +44 -44
  34. package/esm2022/src/commands/ClientToServer/EvaluateCommand.mjs +37 -0
  35. package/esm2022/src/commands/ClientToServer/EventCommand.mjs +40 -0
  36. package/esm2022/src/commands/ClientToServer/ExecOperCommand.mjs +67 -0
  37. package/esm2022/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +22 -0
  38. package/{esm2020 → esm2022}/src/commands/ClientToServer/GlobalParamsQueryCommand.mjs +10 -10
  39. package/{esm2020 → esm2022}/src/commands/ClientToServer/ICommandTaskTag.mjs +1 -1
  40. package/{esm2020 → esm2022}/src/commands/ClientToServer/IndexChangeEventCommand.mjs +21 -21
  41. package/esm2022/src/commands/ClientToServer/IniputForceWriteCommand.mjs +23 -0
  42. package/{esm2020 → esm2022}/src/commands/ClientToServer/NonReversibleExitEventCommand.mjs +23 -23
  43. package/{esm2020 → esm2022}/src/commands/ClientToServer/QueryCommand.mjs +20 -20
  44. package/esm2022/src/commands/ClientToServer/RecomputeCommand.mjs +27 -0
  45. package/esm2022/src/commands/ClientToServer/RefreshEventCommand.mjs +27 -0
  46. package/esm2022/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +24 -0
  47. package/esm2022/src/commands/ClientToServer/RollbackEventCommand.mjs +40 -0
  48. package/{esm2020 → esm2022}/src/commands/ClientToServer/SelectProgramCommand.mjs +14 -14
  49. package/{esm2020 → esm2022}/src/commands/ClientToServer/SetTransactionStateDataviewCommand.mjs +9 -9
  50. package/{esm2020 → esm2022}/src/commands/ClientToServer/SubformOpenEventCommand.mjs +21 -21
  51. package/esm2022/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +24 -0
  52. package/esm2022/src/commands/ClientToServer/TransactionCommand.mjs +30 -0
  53. package/{esm2020 → esm2022}/src/commands/ClientToServer/UnloadCommand.mjs +14 -14
  54. package/esm2022/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +18 -0
  55. package/esm2022/src/commands/DataViewCommandBase.mjs +8 -0
  56. package/{esm2020 → esm2022}/src/commands/IClientCommand.mjs +1 -1
  57. package/esm2022/src/commands/IClientTargetedCommand.mjs +13 -0
  58. package/{esm2020 → esm2022}/src/commands/IClientToServerCommandInfo.mjs +1 -1
  59. package/esm2022/src/commands/ServerToClient/AbortCommand.mjs +65 -0
  60. package/{esm2020 → esm2022}/src/commands/ServerToClient/AddLocateCommand.mjs +21 -21
  61. package/esm2022/src/commands/ServerToClient/AddRangeCommand.mjs +62 -0
  62. package/esm2022/src/commands/ServerToClient/AddSortCommand.mjs +33 -0
  63. package/esm2022/src/commands/ServerToClient/ClientRefreshCommand.mjs +25 -0
  64. package/esm2022/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +24 -0
  65. package/esm2022/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +45 -0
  66. package/esm2022/src/commands/ServerToClient/OpenURLCommand.mjs +221 -0
  67. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetLocateCommand.mjs +14 -14
  68. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetRangeCommand.mjs +14 -14
  69. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetSortCommand.mjs +14 -14
  70. package/esm2022/src/commands/ServerToClient/ResultCommand.mjs +37 -0
  71. package/esm2022/src/commands/ServerToClient/VerifyCommand.mjs +83 -0
  72. package/esm2022/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +132 -0
  73. package/{esm2020 → esm2022}/src/communications/IConnectionStateManager.mjs +1 -1
  74. package/esm2022/src/communications/InteractiveCommunicationsFailureHandler.mjs +15 -0
  75. package/{esm2020 → esm2022}/src/data/DataSourceIdKey.mjs +2 -2
  76. package/esm2022/src/data/DataView.mjs +1613 -0
  77. package/{esm2020 → esm2022}/src/data/DataViewBase.mjs +3 -3
  78. package/esm2022/src/data/DataviewManager.mjs +28 -0
  79. package/esm2022/src/data/DataviewManagerBase.mjs +15 -0
  80. package/esm2022/src/data/DvCache.mjs +67 -0
  81. package/esm2022/src/data/Field.mjs +646 -0
  82. package/esm2022/src/data/FieldBase.mjs +15 -0
  83. package/esm2022/src/data/FieldsTable.mjs +103 -0
  84. package/{esm2020 → esm2022}/src/data/IRecordsTable.mjs +1 -1
  85. package/esm2022/src/data/Key.mjs +88 -0
  86. package/esm2022/src/data/Record.mjs +866 -0
  87. package/{esm2020 → esm2022}/src/data/RecordOutOfDataViewException.mjs +15 -15
  88. package/esm2022/src/data/RecordsTable.mjs +267 -0
  89. package/esm2022/src/data/TaskTransactionManager.mjs +103 -0
  90. package/esm2022/src/data/XMLBasedDcValuesBuilder.mjs +74 -0
  91. package/{esm2020 → esm2022}/src/enums.mjs +23 -23
  92. package/esm2022/src/env/EnvVariablesTable.mjs +340 -0
  93. package/esm2022/src/env/Environment.mjs +487 -0
  94. package/{esm2020 → esm2022}/src/env/ILanguageData.mjs +1 -1
  95. package/esm2022/src/env/LanguageData.mjs +227 -0
  96. package/esm2022/src/env/MirrorString.mjs +65 -0
  97. package/esm2022/src/event/ActionManager.mjs +91 -0
  98. package/esm2022/src/event/Event.mjs +1333 -0
  99. package/esm2022/src/event/EventHandler.mjs +766 -0
  100. package/esm2022/src/event/EventHandlerPosition.mjs +204 -0
  101. package/esm2022/src/event/EventsManager.mjs +2988 -0
  102. package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
  103. package/esm2022/src/event/RunTimeEvent.mjs +399 -0
  104. package/{esm2020 → esm2022}/src/event/RunTimeEventBase.mjs +3 -3
  105. package/esm2022/src/event/UserEventsTable.mjs +47 -0
  106. package/esm2022/src/exp/ExpTable.mjs +57 -0
  107. package/esm2022/src/exp/Expression.mjs +200 -0
  108. package/esm2022/src/exp/ExpressionDict.mjs +727 -0
  109. package/esm2022/src/exp/ExpressionEvaluator.mjs +4206 -0
  110. package/esm2022/src/exp/ExpressionLocalJpn.mjs +314 -0
  111. package/esm2022/src/exp/GlobalParamsTable.mjs +85 -0
  112. package/esm2022/src/exp/YesNoExp.mjs +36 -0
  113. package/esm2022/src/gui/CreatedFormVector.mjs +23 -0
  114. package/esm2022/src/gui/FormsTable.mjs +66 -0
  115. package/esm2022/src/gui/MgControl.mjs +363 -0
  116. package/esm2022/src/gui/MgForm.mjs +1224 -0
  117. package/esm2022/src/http/HttpManager.mjs +97 -0
  118. package/esm2022/src/http/client/HttpClientAsync.mjs +68 -0
  119. package/esm2022/src/http/client/HttpClientBase.mjs +132 -0
  120. package/esm2022/src/http/client/HttpClientEvents.mjs +39 -0
  121. package/esm2022/src/http/client/HttpClientSync.mjs +42 -0
  122. package/esm2022/src/http/client/HttpUtility.mjs +84 -0
  123. package/{esm2020 → esm2022}/src/http/client/ICommunicationsFailureHandler.mjs +1 -1
  124. package/esm2022/src/remote/AddUserLocateRemoteDataViewCommand.mjs +18 -0
  125. package/esm2022/src/remote/AddUserRangeRemoteDataViewCommand.mjs +18 -0
  126. package/esm2022/src/remote/AddUserSortRemoteDataViewCommand.mjs +18 -0
  127. package/esm2022/src/remote/RemoteCommandsProcessor.mjs +880 -0
  128. package/esm2022/src/remote/RemoteControlItemsRefreshCommand.mjs +25 -0
  129. package/esm2022/src/remote/RemoteDataViewCommandBase.mjs +24 -0
  130. package/esm2022/src/remote/RemoteDataViewCommandFactory.mjs +61 -0
  131. package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandUpdateNonModifiable.mjs +15 -15
  132. package/{esm2020 → esm2022}/src/remote/RemoteDataviewManager.mjs +17 -17
  133. package/{esm2020 → esm2022}/src/remote/RemoteInitDataViewCommand.mjs +10 -10
  134. package/esm2022/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +17 -0
  135. package/{esm2020 → esm2022}/src/remote/ResetUserRangeRemoteDataviewCommand.mjs +12 -12
  136. package/esm2022/src/remote/ResetUserSortRemoteDataviewCommand.mjs +16 -0
  137. package/esm2022/src/remote/ServerError.mjs +40 -0
  138. package/esm2022/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +20 -0
  139. package/esm2022/src/rt/Argument.mjs +265 -0
  140. package/esm2022/src/rt/ArgumentsList.mjs +103 -0
  141. package/esm2022/src/rt/Boundary.mjs +152 -0
  142. package/esm2022/src/rt/CompMainPrgTable.mjs +63 -0
  143. package/{esm2020 → esm2022}/src/rt/DataviewHeaderBase.mjs +98 -96
  144. package/{esm2020 → esm2022}/src/rt/DataviewHeaderFactory.mjs +6 -6
  145. package/esm2022/src/rt/DataviewHeaders.mjs +53 -0
  146. package/esm2022/src/rt/DataviewHeadersSaxHandler.mjs +38 -0
  147. package/esm2022/src/rt/ExecutionStack.mjs +94 -0
  148. package/{esm2020 → esm2022}/src/rt/ExecutionStackEntry.mjs +17 -17
  149. package/esm2022/src/rt/HandlersTable.mjs +96 -0
  150. package/{esm2020 → esm2022}/src/rt/IDataSourceViewDefinition.mjs +1 -1
  151. package/{esm2020 → esm2022}/src/rt/IDataviewHeader.mjs +1 -1
  152. package/{esm2020 → esm2022}/src/rt/IResultValue.mjs +1 -1
  153. package/esm2022/src/rt/LastFocusedManager.mjs +65 -0
  154. package/esm2022/src/rt/Operation.mjs +735 -0
  155. package/esm2022/src/rt/OperationTable.mjs +67 -0
  156. package/esm2022/src/rt/Recompute.mjs +355 -0
  157. package/esm2022/src/rt/RecomputeTable.mjs +63 -0
  158. package/esm2022/src/rt/RemoteDataviewHeader.mjs +108 -0
  159. package/esm2022/src/rt/ResultValue.mjs +10 -0
  160. package/esm2022/src/rt/TableCache.mjs +177 -0
  161. package/esm2022/src/rt/TableCacheManager.mjs +67 -0
  162. package/esm2022/src/rt/Transaction.mjs +53 -0
  163. package/esm2022/src/security/UserDetails.mjs +71 -0
  164. package/{esm2020 → esm2022}/src/tasks/IMGDataCollection.mjs +1 -1
  165. package/esm2022/src/tasks/MGData.mjs +552 -0
  166. package/esm2022/src/tasks/MGDataCollection.mjs +252 -0
  167. package/esm2022/src/tasks/RCTimer.mjs +63 -0
  168. package/esm2022/src/tasks/RemoteTaskService.mjs +45 -0
  169. package/esm2022/src/tasks/Task.mjs +2499 -0
  170. package/esm2022/src/tasks/TaskBase.mjs +83 -0
  171. package/esm2022/src/tasks/TaskServiceBase.mjs +25 -0
  172. package/esm2022/src/tasks/TasksTable.mjs +80 -0
  173. package/esm2022/src/tasks/sort/Sort.mjs +5 -0
  174. package/esm2022/src/tasks/sort/SortCollection.mjs +67 -0
  175. package/esm2022/src/util/ConstUtils.mjs +14 -0
  176. package/esm2022/src/util/FlowMonitorQueue.mjs +451 -0
  177. package/esm2022/src/util/HeapSort.mjs +70 -0
  178. package/{esm2020 → esm2022}/src/util/IMirrorXML.mjs +1 -1
  179. package/{esm2020 → esm2022}/src/util/IServerConfig.mjs +1 -1
  180. package/{esm2020 → esm2022}/src/util/MgBlockingQueue.mjs +1 -1
  181. package/esm2022/src/util/MgPriorityBlockingQueue.mjs +74 -0
  182. package/esm2022/src/util/MgPriorityQueue.mjs +66 -0
  183. package/{esm2020 → esm2022}/src/util/ParamParseResult.mjs +7 -7
  184. package/esm2022/src/util/PrmMap.mjs +152 -0
  185. package/esm2022/src/util/ReturnResult.mjs +46 -0
  186. package/esm2022/src/util/ReturnResultBase.mjs +18 -0
  187. package/esm2022/src/util/Scrambler.mjs +89 -0
  188. package/esm2022/src/util/UniqueIDUtils.mjs +13 -0
  189. package/esm2022/src/util/cookie.service.mjs +92 -0
  190. package/{fesm2020 → fesm2022}/magic-xpa-engine.mjs +29797 -29693
  191. package/fesm2022/magic-xpa-engine.mjs.map +1 -0
  192. package/index.d.ts +187 -187
  193. package/package.json +8 -14
  194. package/src/AccessHelper.d.ts +20 -20
  195. package/src/ClientManager.d.ts +35 -32
  196. package/src/CommandsProcessorBase.d.ts +23 -23
  197. package/src/CommandsProcessorManager.d.ts +6 -6
  198. package/src/CommandsTable.d.ts +22 -22
  199. package/src/ConstInterface.d.ts +516 -515
  200. package/src/CurrentClientVersion.d.ts +1 -1
  201. package/src/FlowMonitorInterface.d.ts +15 -15
  202. package/src/GUIManager.d.ts +17 -17
  203. package/src/GlobalCommandsManager.d.ts +17 -17
  204. package/src/GuiEventsProcessor.d.ts +24 -24
  205. package/src/ICommandsTable.d.ts +9 -9
  206. package/src/ServerConfig.d.ts +35 -34
  207. package/src/bridge/IGuiEvent.d.ts +19 -19
  208. package/src/bridge/MagicBridge.d.ts +16 -16
  209. package/src/commands/ClientOriginatedCommandTaskTag.d.ts +8 -8
  210. package/src/commands/ClientToServer/AddUserLocateDataViewCommand.d.ts +4 -4
  211. package/src/commands/ClientToServer/AddUserRangeDataviewCommand.d.ts +6 -6
  212. package/src/commands/ClientToServer/AddUserSortDataViewCommand.d.ts +6 -6
  213. package/src/commands/ClientToServer/BrowserEscEventCommand.d.ts +8 -8
  214. package/src/commands/ClientToServer/ClientOriginatedCommand.d.ts +8 -8
  215. package/src/commands/ClientToServer/ClientOriginatedCommandSerializer.d.ts +6 -6
  216. package/src/commands/ClientToServer/ColumnSortEventCommand.d.ts +10 -10
  217. package/src/commands/ClientToServer/CommandFactory.d.ts +64 -64
  218. package/src/commands/ClientToServer/CommandSerializationHelper.d.ts +20 -20
  219. package/src/commands/ClientToServer/ComputeEventCommand.d.ts +8 -8
  220. package/src/commands/ClientToServer/ContextTerminationEventCommand.d.ts +7 -7
  221. package/src/commands/ClientToServer/ContextTimeoutResetCommand.d.ts +7 -7
  222. package/src/commands/ClientToServer/ControlItemsRefreshCommand.d.ts +6 -6
  223. package/src/commands/ClientToServer/DataViewOutputCommand.d.ts +9 -9
  224. package/src/commands/ClientToServer/DataviewCommand.d.ts +32 -32
  225. package/src/commands/ClientToServer/EvaluateCommand.d.ts +15 -15
  226. package/src/commands/ClientToServer/EventCommand.d.ts +15 -15
  227. package/src/commands/ClientToServer/ExecOperCommand.d.ts +23 -23
  228. package/src/commands/ClientToServer/FetchDataControlValuesEventCommand.d.ts +8 -8
  229. package/src/commands/ClientToServer/GlobalParamsQueryCommand.d.ts +5 -5
  230. package/src/commands/ClientToServer/ICommandTaskTag.d.ts +3 -3
  231. package/src/commands/ClientToServer/IndexChangeEventCommand.d.ts +8 -8
  232. package/src/commands/ClientToServer/IniputForceWriteCommand.d.ts +10 -10
  233. package/src/commands/ClientToServer/NonReversibleExitEventCommand.d.ts +8 -8
  234. package/src/commands/ClientToServer/QueryCommand.d.ts +8 -8
  235. package/src/commands/ClientToServer/RecomputeCommand.d.ts +11 -11
  236. package/src/commands/ClientToServer/RefreshEventCommand.d.ts +12 -12
  237. package/src/commands/ClientToServer/RefreshScreenEventCommand.d.ts +10 -10
  238. package/src/commands/ClientToServer/RollbackEventCommand.d.ts +14 -14
  239. package/src/commands/ClientToServer/SelectProgramCommand.d.ts +6 -6
  240. package/src/commands/ClientToServer/SetTransactionStateDataviewCommand.d.ts +5 -5
  241. package/src/commands/ClientToServer/SubformOpenEventCommand.d.ts +8 -8
  242. package/src/commands/ClientToServer/SubformRefreshEventCommand.d.ts +9 -9
  243. package/src/commands/ClientToServer/TransactionCommand.d.ts +12 -12
  244. package/src/commands/ClientToServer/UnloadCommand.d.ts +7 -7
  245. package/src/commands/ClientToServer/WriteMessageToServerLogCommand.d.ts +6 -6
  246. package/src/commands/DataViewCommandBase.d.ts +6 -6
  247. package/src/commands/IClientCommand.d.ts +2 -2
  248. package/src/commands/IClientTargetedCommand.d.ts +12 -12
  249. package/src/commands/IClientToServerCommandInfo.d.ts +3 -3
  250. package/src/commands/ServerToClient/AbortCommand.d.ts +11 -11
  251. package/src/commands/ServerToClient/AddLocateCommand.d.ts +6 -6
  252. package/src/commands/ServerToClient/AddRangeCommand.d.ts +10 -10
  253. package/src/commands/ServerToClient/AddSortCommand.d.ts +9 -9
  254. package/src/commands/ServerToClient/ClientRefreshCommand.d.ts +7 -7
  255. package/src/commands/ServerToClient/ClientTargetedCommandBase.d.ts +12 -12
  256. package/src/commands/ServerToClient/EnhancedVerifyCommand.d.ts +13 -13
  257. package/src/commands/ServerToClient/OpenURLCommand.d.ts +21 -21
  258. package/src/commands/ServerToClient/ResetLocateCommand.d.ts +6 -6
  259. package/src/commands/ServerToClient/ResetRangeCommand.d.ts +6 -6
  260. package/src/commands/ServerToClient/ResetSortCommand.d.ts +6 -6
  261. package/src/commands/ServerToClient/ResultCommand.d.ts +10 -10
  262. package/src/commands/ServerToClient/VerifyCommand.d.ts +17 -17
  263. package/src/commands/ServerToClient/XMLBasedCommandBuilder.d.ts +11 -11
  264. package/src/communications/IConnectionStateManager.d.ts +4 -4
  265. package/src/communications/InteractiveCommunicationsFailureHandler.d.ts +6 -6
  266. package/src/data/DataSourceIdKey.d.ts +2 -2
  267. package/src/data/DataView.d.ts +162 -162
  268. package/src/data/DataViewBase.d.ts +12 -12
  269. package/src/data/DataviewManager.d.ts +14 -14
  270. package/src/data/DataviewManagerBase.d.ts +11 -11
  271. package/src/data/DvCache.d.ts +15 -15
  272. package/src/data/Field.d.ts +103 -103
  273. package/src/data/FieldBase.d.ts +23 -23
  274. package/src/data/FieldsTable.d.ts +27 -27
  275. package/src/data/IRecordsTable.d.ts +7 -7
  276. package/src/data/Key.d.ts +15 -15
  277. package/src/data/Record.d.ts +156 -156
  278. package/src/data/RecordOutOfDataViewException.d.ts +10 -10
  279. package/src/data/RecordsTable.d.ts +38 -38
  280. package/src/data/TaskTransactionManager.d.ts +17 -17
  281. package/src/data/XMLBasedDcValuesBuilder.d.ts +11 -11
  282. package/src/enums.d.ts +21 -21
  283. package/src/env/EnvVariablesTable.d.ts +17 -17
  284. package/src/env/Environment.d.ts +118 -118
  285. package/src/env/ILanguageData.d.ts +3 -3
  286. package/src/env/LanguageData.d.ts +20 -20
  287. package/src/env/MirrorString.d.ts +15 -15
  288. package/src/event/ActionManager.d.ts +14 -14
  289. package/src/event/Event.d.ts +79 -79
  290. package/src/event/EventHandler.d.ts +66 -66
  291. package/src/event/EventHandlerPosition.d.ts +25 -25
  292. package/src/event/EventsManager.d.ts +205 -204
  293. package/src/event/IEventsManager.d.ts +77 -77
  294. package/src/event/RunTimeEvent.d.ts +126 -123
  295. package/src/event/RunTimeEventBase.d.ts +5 -5
  296. package/src/event/UserEventsTable.d.ts +11 -11
  297. package/src/exp/ExpTable.d.ts +11 -11
  298. package/src/exp/Expression.d.ts +37 -37
  299. package/src/exp/ExpressionDict.d.ts +12 -12
  300. package/src/exp/ExpressionEvaluator.d.ts +198 -198
  301. package/src/exp/ExpressionLocalJpn.d.ts +18 -18
  302. package/src/exp/GlobalParamsTable.d.ts +19 -19
  303. package/src/exp/YesNoExp.d.ts +9 -9
  304. package/src/gui/CreatedFormVector.d.ts +10 -10
  305. package/src/gui/FormsTable.d.ts +15 -15
  306. package/src/gui/MgControl.d.ts +60 -60
  307. package/src/gui/MgForm.d.ts +96 -93
  308. package/src/http/HttpManager.d.ts +25 -25
  309. package/src/http/client/HttpClientAsync.d.ts +16 -16
  310. package/src/http/client/HttpClientBase.d.ts +30 -30
  311. package/src/http/client/HttpClientEvents.d.ts +18 -18
  312. package/src/http/client/HttpClientSync.d.ts +17 -17
  313. package/src/http/client/HttpUtility.d.ts +10 -10
  314. package/src/http/client/ICommunicationsFailureHandler.d.ts +5 -5
  315. package/src/remote/AddUserLocateRemoteDataViewCommand.d.ts +8 -8
  316. package/src/remote/AddUserRangeRemoteDataViewCommand.d.ts +8 -8
  317. package/src/remote/AddUserSortRemoteDataViewCommand.d.ts +8 -8
  318. package/src/remote/RemoteCommandsProcessor.d.ts +51 -51
  319. package/src/remote/RemoteControlItemsRefreshCommand.d.ts +8 -8
  320. package/src/remote/RemoteDataViewCommandBase.d.ts +10 -10
  321. package/src/remote/RemoteDataViewCommandFactory.d.ts +6 -6
  322. package/src/remote/RemoteDataViewCommandUpdateNonModifiable.d.ts +8 -8
  323. package/src/remote/RemoteDataviewManager.d.ts +9 -9
  324. package/src/remote/RemoteInitDataViewCommand.d.ts +7 -7
  325. package/src/remote/ResetUserLocateRemoteDataviewCommand.d.ts +7 -7
  326. package/src/remote/ResetUserRangeRemoteDataviewCommand.d.ts +7 -7
  327. package/src/remote/ResetUserSortRemoteDataviewCommand.d.ts +7 -7
  328. package/src/remote/ServerError.d.ts +16 -16
  329. package/src/remote/SetTransactionStateRemoteDataViewCommand.d.ts +8 -8
  330. package/src/rt/Argument.d.ts +36 -36
  331. package/src/rt/ArgumentsList.d.ts +24 -24
  332. package/src/rt/Boundary.d.ts +27 -27
  333. package/src/rt/CompMainPrgTable.d.ts +10 -10
  334. package/src/rt/DataviewHeaderBase.d.ts +34 -34
  335. package/src/rt/DataviewHeaderFactory.d.ts +5 -5
  336. package/src/rt/DataviewHeaders.d.ts +12 -12
  337. package/src/rt/DataviewHeadersSaxHandler.d.ts +10 -10
  338. package/src/rt/ExecutionStack.d.ts +22 -22
  339. package/src/rt/ExecutionStackEntry.d.ts +7 -7
  340. package/src/rt/HandlersTable.d.ts +19 -19
  341. package/src/rt/IDataSourceViewDefinition.d.ts +6 -6
  342. package/src/rt/IDataviewHeader.d.ts +10 -10
  343. package/src/rt/IResultValue.d.ts +4 -4
  344. package/src/rt/LastFocusedManager.d.ts +23 -23
  345. package/src/rt/Operation.d.ts +97 -97
  346. package/src/rt/OperationTable.d.ts +15 -15
  347. package/src/rt/Recompute.d.ts +41 -41
  348. package/src/rt/RecomputeTable.d.ts +9 -9
  349. package/src/rt/RemoteDataviewHeader.d.ts +14 -14
  350. package/src/rt/ResultValue.d.ts +7 -7
  351. package/src/rt/TableCache.d.ts +29 -29
  352. package/src/rt/TableCacheManager.d.ts +10 -10
  353. package/src/rt/Transaction.d.ts +23 -23
  354. package/src/security/UserDetails.d.ts +16 -16
  355. package/src/tasks/IMGDataCollection.d.ts +26 -26
  356. package/src/tasks/MGData.d.ts +63 -63
  357. package/src/tasks/MGDataCollection.d.ts +42 -42
  358. package/src/tasks/RCTimer.d.ts +13 -13
  359. package/src/tasks/RemoteTaskService.d.ts +16 -16
  360. package/src/tasks/Task.d.ts +312 -312
  361. package/src/tasks/TaskBase.d.ts +123 -123
  362. package/src/tasks/TaskServiceBase.d.ts +16 -16
  363. package/src/tasks/TasksTable.d.ts +21 -21
  364. package/src/tasks/sort/Sort.d.ts +4 -4
  365. package/src/tasks/sort/SortCollection.d.ts +11 -11
  366. package/src/util/ConstUtils.d.ts +3 -3
  367. package/src/util/FlowMonitorQueue.d.ts +70 -70
  368. package/src/util/HeapSort.d.ts +6 -6
  369. package/src/util/IMirrorXML.d.ts +6 -6
  370. package/src/util/IServerConfig.d.ts +11 -11
  371. package/src/util/MgBlockingQueue.d.ts +5 -5
  372. package/src/util/MgPriorityBlockingQueue.d.ts +17 -17
  373. package/src/util/MgPriorityQueue.d.ts +13 -13
  374. package/src/util/ParamParseResult.d.ts +6 -6
  375. package/src/util/PrmMap.d.ts +28 -28
  376. package/src/util/ReturnResult.d.ts +18 -18
  377. package/src/util/ReturnResultBase.d.ts +11 -11
  378. package/src/util/Scrambler.d.ts +10 -10
  379. package/src/util/UniqueIDUtils.d.ts +4 -4
  380. package/src/util/cookie.service.d.ts +8 -8
  381. package/esm2020/src/AccessHelper.mjs +0 -9
  382. package/esm2020/src/ClientManager.mjs +0 -399
  383. package/esm2020/src/CommandsProcessorBase.mjs +0 -58
  384. package/esm2020/src/CommandsProcessorManager.mjs +0 -26
  385. package/esm2020/src/CommandsTable.mjs +0 -162
  386. package/esm2020/src/ConstInterface.mjs +0 -516
  387. package/esm2020/src/FlowMonitorInterface.mjs +0 -16
  388. package/esm2020/src/GUIManager.mjs +0 -62
  389. package/esm2020/src/GlobalCommandsManager.mjs +0 -34
  390. package/esm2020/src/GuiEventsProcessor.mjs +0 -154
  391. package/esm2020/src/ServerConfig.mjs +0 -117
  392. package/esm2020/src/bridge/MagicBridge.mjs +0 -41
  393. package/esm2020/src/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
  394. package/esm2020/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +0 -60
  395. package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
  396. package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
  397. package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
  398. package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
  399. package/esm2020/src/commands/ClientToServer/EventCommand.mjs +0 -40
  400. package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
  401. package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
  402. package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
  403. package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
  404. package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
  405. package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
  406. package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
  407. package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
  408. package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
  409. package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
  410. package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
  411. package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
  412. package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
  413. package/esm2020/src/commands/ServerToClient/AddRangeCommand.mjs +0 -62
  414. package/esm2020/src/commands/ServerToClient/AddSortCommand.mjs +0 -33
  415. package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
  416. package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
  417. package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
  418. package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
  419. package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
  420. package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
  421. package/esm2020/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +0 -132
  422. package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
  423. package/esm2020/src/data/DataView.mjs +0 -1610
  424. package/esm2020/src/data/DataviewManager.mjs +0 -28
  425. package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
  426. package/esm2020/src/data/DvCache.mjs +0 -67
  427. package/esm2020/src/data/Field.mjs +0 -646
  428. package/esm2020/src/data/FieldBase.mjs +0 -18
  429. package/esm2020/src/data/FieldsTable.mjs +0 -103
  430. package/esm2020/src/data/Key.mjs +0 -88
  431. package/esm2020/src/data/Record.mjs +0 -846
  432. package/esm2020/src/data/RecordsTable.mjs +0 -267
  433. package/esm2020/src/data/TaskTransactionManager.mjs +0 -103
  434. package/esm2020/src/data/XMLBasedDcValuesBuilder.mjs +0 -74
  435. package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
  436. package/esm2020/src/env/Environment.mjs +0 -489
  437. package/esm2020/src/env/LanguageData.mjs +0 -226
  438. package/esm2020/src/env/MirrorString.mjs +0 -65
  439. package/esm2020/src/event/ActionManager.mjs +0 -91
  440. package/esm2020/src/event/Event.mjs +0 -1333
  441. package/esm2020/src/event/EventHandler.mjs +0 -766
  442. package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
  443. package/esm2020/src/event/EventsManager.mjs +0 -2975
  444. package/esm2020/src/event/RunTimeEvent.mjs +0 -392
  445. package/esm2020/src/event/UserEventsTable.mjs +0 -47
  446. package/esm2020/src/exp/ExpTable.mjs +0 -59
  447. package/esm2020/src/exp/Expression.mjs +0 -200
  448. package/esm2020/src/exp/ExpressionDict.mjs +0 -727
  449. package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4212
  450. package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
  451. package/esm2020/src/exp/GlobalParamsTable.mjs +0 -85
  452. package/esm2020/src/exp/YesNoExp.mjs +0 -36
  453. package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
  454. package/esm2020/src/gui/FormsTable.mjs +0 -66
  455. package/esm2020/src/gui/MgControl.mjs +0 -353
  456. package/esm2020/src/gui/MgForm.mjs +0 -1181
  457. package/esm2020/src/http/HttpManager.mjs +0 -97
  458. package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
  459. package/esm2020/src/http/client/HttpClientBase.mjs +0 -132
  460. package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
  461. package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
  462. package/esm2020/src/http/client/HttpUtility.mjs +0 -84
  463. package/esm2020/src/remote/AddUserLocateRemoteDataViewCommand.mjs +0 -18
  464. package/esm2020/src/remote/AddUserRangeRemoteDataViewCommand.mjs +0 -18
  465. package/esm2020/src/remote/AddUserSortRemoteDataViewCommand.mjs +0 -18
  466. package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
  467. package/esm2020/src/remote/RemoteControlItemsRefreshCommand.mjs +0 -25
  468. package/esm2020/src/remote/RemoteDataViewCommandBase.mjs +0 -24
  469. package/esm2020/src/remote/RemoteDataViewCommandFactory.mjs +0 -61
  470. package/esm2020/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +0 -17
  471. package/esm2020/src/remote/ResetUserSortRemoteDataviewCommand.mjs +0 -16
  472. package/esm2020/src/remote/ServerError.mjs +0 -40
  473. package/esm2020/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +0 -20
  474. package/esm2020/src/rt/Argument.mjs +0 -265
  475. package/esm2020/src/rt/ArgumentsList.mjs +0 -103
  476. package/esm2020/src/rt/Boundary.mjs +0 -152
  477. package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
  478. package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
  479. package/esm2020/src/rt/DataviewHeadersSaxHandler.mjs +0 -38
  480. package/esm2020/src/rt/ExecutionStack.mjs +0 -94
  481. package/esm2020/src/rt/HandlersTable.mjs +0 -96
  482. package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
  483. package/esm2020/src/rt/Operation.mjs +0 -735
  484. package/esm2020/src/rt/OperationTable.mjs +0 -67
  485. package/esm2020/src/rt/Recompute.mjs +0 -355
  486. package/esm2020/src/rt/RecomputeTable.mjs +0 -63
  487. package/esm2020/src/rt/RemoteDataviewHeader.mjs +0 -108
  488. package/esm2020/src/rt/ResultValue.mjs +0 -12
  489. package/esm2020/src/rt/TableCache.mjs +0 -177
  490. package/esm2020/src/rt/TableCacheManager.mjs +0 -67
  491. package/esm2020/src/rt/Transaction.mjs +0 -53
  492. package/esm2020/src/security/UserDetails.mjs +0 -71
  493. package/esm2020/src/tasks/MGData.mjs +0 -552
  494. package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
  495. package/esm2020/src/tasks/RCTimer.mjs +0 -63
  496. package/esm2020/src/tasks/RemoteTaskService.mjs +0 -45
  497. package/esm2020/src/tasks/Task.mjs +0 -2495
  498. package/esm2020/src/tasks/TaskBase.mjs +0 -87
  499. package/esm2020/src/tasks/TaskServiceBase.mjs +0 -25
  500. package/esm2020/src/tasks/TasksTable.mjs +0 -80
  501. package/esm2020/src/tasks/sort/Sort.mjs +0 -7
  502. package/esm2020/src/tasks/sort/SortCollection.mjs +0 -67
  503. package/esm2020/src/util/ConstUtils.mjs +0 -14
  504. package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
  505. package/esm2020/src/util/HeapSort.mjs +0 -70
  506. package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
  507. package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
  508. package/esm2020/src/util/PrmMap.mjs +0 -151
  509. package/esm2020/src/util/ReturnResult.mjs +0 -46
  510. package/esm2020/src/util/ReturnResultBase.mjs +0 -18
  511. package/esm2020/src/util/Scrambler.mjs +0 -89
  512. package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
  513. package/esm2020/src/util/cookie.service.mjs +0 -92
  514. package/fesm2015/magic-xpa-engine.mjs +0 -30835
  515. package/fesm2015/magic-xpa-engine.mjs.map +0 -1
  516. package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -0,0 +1,1613 @@
1
+ import { ApplicationException, Debug, Int32, Int64, isNullOrUndefined, List, NNumber } from '@magic-xpa/mscorelib';
2
+ import { Constants, InternalInterface, Logger, Misc, StorageAttribute, XMLConstants, XmlParser } from '@magic-xpa/utils';
3
+ import { DataModificationTypes, DisplayConvertor, PIC, PropInterface } from '@magic-xpa/gui';
4
+ import { ConstInterface } from '../ConstInterface';
5
+ import { RecordsTable } from './RecordsTable';
6
+ import { Record } from './Record';
7
+ import { TaskBase } from '../tasks/TaskBase';
8
+ import { FieldsTableExt as FieldsTable } from './FieldsTable';
9
+ import { RecordOutOfDataViewException, RecordOutOfDataViewException_ExceptionType } from './RecordOutOfDataViewException';
10
+ import { CommandFactory } from '../commands/ClientToServer/CommandFactory';
11
+ import { XMLBasedDcValuesBuilder } from './XMLBasedDcValuesBuilder';
12
+ import { Field } from './Field';
13
+ import { EventSubType } from '../enums';
14
+ import { RemoteCommandsProcessor } from '../remote/RemoteCommandsProcessor';
15
+ import { FieldBase } from './FieldBase';
16
+ import { CommandsProcessorManager } from '../CommandsProcessorManager';
17
+ import { DataViewBase } from './DataViewBase';
18
+ import { AccessHelper, ClearEventsOnStopExecution } from '../AccessHelper';
19
+ import { MGDataCollection } from '../tasks/MGDataCollection';
20
+ export const SET_DISPLAYLINE_BY_DV = Int32.MinValue;
21
+ const COMPUTE_NEWREC_ON_CLIENT = 'C';
22
+ const UNKNOWN_RCMPS_NOT_INITED = 'M';
23
+ const UNKNOWN_RCMPS_FOUND = 'Y';
24
+ const INVOKED_FROM_OFFLINE_TASK = '-99999';
25
+ const CHUNK_CACHE_NEXT = 'N';
26
+ const CHUNK_CACHE_PREV = 'P';
27
+ const CHUNK_DV_BOTTOM = 'B';
28
+ const CHUNK_DV_TOP = 'T';
29
+ const COMPUTE_FLUSH_UPDATES = 'H';
30
+ const COMPUTE_NEWREC_ON_SERVER = 'S';
31
+ const END_DV_TAG = '</' + ConstInterface.MG_TAG_DATAVIEW + '>';
32
+ const RECOVERY_ACT_BEGIN_SCREEN = 'S';
33
+ const RECOVERY_ACT_BEGIN_TABLE = 'T';
34
+ const RECOVERY_ACT_CANCEL = 'C';
35
+ const RECOVERY_ACT_MOVE_DIRECTION_BEGIN = 'B';
36
+ const RECOVERY_ACT_NONE = 'N';
37
+ const TRANS_STAT_CLOSED = 'C';
38
+ const TRANS_STAT_OPENED = 'O';
39
+ export class DataView extends DataViewBase {
40
+ _cacheLruTimeStamp = 0;
41
+ _changed = false;
42
+ _chunkSize = 30;
43
+ _computeBy = '\0';
44
+ _currRecId = 0;
45
+ _currRecIdx = 0;
46
+ _dvPosValue = 0;
47
+ _firstDv = true;
48
+ _flushUpdates = false;
49
+ _hasMainTable = true;
50
+ _insertAt = ' ';
51
+ set InsertAt(value) {
52
+ this._insertAt = value;
53
+ }
54
+ get InsertAt() {
55
+ return this._insertAt;
56
+ }
57
+ InLocalDataviewCommand = false;
58
+ _lastCreatedRecId = 0;
59
+ _lastSessionCounter = Int64.MinValue;
60
+ _locateFirstRec = -1;
61
+ _modifiedRecordsTab = null;
62
+ _oldTopRecIdx = Int32.MinValue;
63
+ _original = null;
64
+ _pendingRecovery = RECOVERY_ACT_NONE;
65
+ _prevCurrRec = null;
66
+ _recordsTab = null;
67
+ _recovery = ConstInterface.RECOVERY_NONE;
68
+ _rmIdx = 0;
69
+ _rmSize = 0;
70
+ _skipParsing = false;
71
+ _topRecId = 0;
72
+ _topRecIdx = Int32.MinValue;
73
+ _topRecIdxModified = false;
74
+ _transCleared = false;
75
+ _unknownRcmp = UNKNOWN_RCMPS_NOT_INITED;
76
+ IsOneWayKey = false;
77
+ _includesFirst = false;
78
+ _includesLast = false;
79
+ _serverTransCacheEmpty = true;
80
+ _currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER = null;
81
+ get CurrRec() {
82
+ return this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER;
83
+ }
84
+ set CurrRec(value) {
85
+ if (this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER !== null && value === null) {
86
+ this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER.resetDcValueId();
87
+ }
88
+ this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER = value;
89
+ if (this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER !== null) {
90
+ this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER.SetDcValueId();
91
+ }
92
+ }
93
+ get FlushUpdates() {
94
+ return this._flushUpdates;
95
+ }
96
+ get HasMainTable() {
97
+ return this._hasMainTable;
98
+ }
99
+ DBViewSize = 0;
100
+ taskModeFromCache;
101
+ get CurrentRecId() {
102
+ return this._currRecId;
103
+ }
104
+ Dvcount = 0;
105
+ TotalRecordsCount = 0;
106
+ RecordsBeforeCurrentView = 0;
107
+ get FirstRecord() {
108
+ return this._recordsTab.getRecByIdx(0);
109
+ }
110
+ get LastRecord() {
111
+ return this._recordsTab.getRecByIdx(this._recordsTab.getSize() - 1);
112
+ }
113
+ constructor(taskOrDataView) {
114
+ super();
115
+ if (taskOrDataView instanceof TaskBase) {
116
+ this._task = taskOrDataView;
117
+ this._fieldsTab = new FieldsTable();
118
+ this._recordsTab = new RecordsTable(true);
119
+ this._modifiedRecordsTab = new RecordsTable(false);
120
+ }
121
+ else {
122
+ Object.assign(this, taskOrDataView);
123
+ }
124
+ }
125
+ Init() {
126
+ this.init();
127
+ }
128
+ IncludesFirst() {
129
+ return this._includesFirst;
130
+ }
131
+ get ServerTransactionCacheEmpty() {
132
+ return this._serverTransCacheEmpty;
133
+ }
134
+ IncludesLast() {
135
+ return this._includesLast;
136
+ }
137
+ fillHeaderData(parser) {
138
+ while (this.initHeaderInnerObjects(parser, parser.getNextTag())) {
139
+ }
140
+ this.Dvcount = this._task.ctl_itm_4_parent_vee(0, 1);
141
+ }
142
+ initHeaderInnerObjects(parser, foundTagName) {
143
+ if (foundTagName === null)
144
+ return false;
145
+ if (foundTagName === XMLConstants.MG_TAG_DVHEADER) {
146
+ Logger.Instance.WriteDevToLog('dvheader found');
147
+ this.getHeaderAttributes(parser);
148
+ this._fieldsTab.fillData(parser, this);
149
+ this._fieldsTab.setRMPos(this._rmSize, this._rmIdx);
150
+ }
151
+ else if (foundTagName === ('/' + XMLConstants.MG_TAG_DVHEADER)) {
152
+ parser.setCurrIndex2EndOfTag();
153
+ return false;
154
+ }
155
+ else
156
+ return false;
157
+ return true;
158
+ }
159
+ getHeaderAttributes(parser) {
160
+ let tokensVector;
161
+ let tag;
162
+ let attribute;
163
+ let valueStr;
164
+ let endContext = parser.getXMLdata().indexOf(XMLConstants.TAG_CLOSE, parser.getCurrIndex());
165
+ if (endContext !== -1 && endContext < parser.getXMLdata().length) {
166
+ tag = parser.getXMLsubstring(endContext);
167
+ parser.add2CurrIndex(tag.indexOf(XMLConstants.MG_TAG_DVHEADER) + XMLConstants.MG_TAG_DVHEADER.length);
168
+ tokensVector = XmlParser.getTokens(parser.getXMLsubstring(endContext), XMLConstants.XML_ATTR_DELIM);
169
+ for (let j = 0; j < tokensVector.length; j += 2) {
170
+ attribute = (tokensVector.get_Item(j));
171
+ valueStr = (tokensVector.get_Item(j + 1));
172
+ switch (attribute) {
173
+ case ConstInterface.MG_ATTR_RMPOS: {
174
+ let i = valueStr.indexOf(',');
175
+ if (i > -1) {
176
+ this._rmSize = NNumber.Parse(valueStr.substr(0, i));
177
+ this._rmIdx = NNumber.Parse(valueStr.substr(i + 1));
178
+ }
179
+ break;
180
+ }
181
+ case ConstInterface.MG_ATTR_COMPUTE_BY:
182
+ this._computeBy = valueStr[0];
183
+ if (this._computeBy === COMPUTE_FLUSH_UPDATES) {
184
+ this._computeBy = COMPUTE_NEWREC_ON_SERVER;
185
+ this._flushUpdates = true;
186
+ }
187
+ else
188
+ this._flushUpdates = false;
189
+ break;
190
+ case ConstInterface.MG_ATTR_HAS_MAIN_TBL:
191
+ this._hasMainTable = XmlParser.getBoolean(valueStr);
192
+ break;
193
+ case ConstInterface.MG_ATTR_CHUNK_SIZE:
194
+ this._chunkSize = XmlParser.getInt(valueStr);
195
+ break;
196
+ case ConstInterface.MG_ATTR_CHUNK_SIZE_EXPRESSION:
197
+ break;
198
+ default:
199
+ Logger.Instance.WriteExceptionToLogWithMsg('Unknown attribute for <' + XMLConstants.MG_TAG_DVHEADER + '> tag: ' +
200
+ attribute);
201
+ break;
202
+ }
203
+ }
204
+ parser.setCurrIndex(++endContext);
205
+ return;
206
+ }
207
+ Logger.Instance.WriteExceptionToLogWithMsg('in DataView.getHeaderAttributes(): out of bounds');
208
+ }
209
+ async fillData(parser) {
210
+ this._skipParsing = false;
211
+ while (await this.initInnerObjects(parser, parser.getNextTag())) {
212
+ }
213
+ this.ResetFirstDv();
214
+ }
215
+ GetTransactionBegin() {
216
+ let transBegin = '\0';
217
+ let transBeginProp = this._task.getProp(PropInterface.PROP_TYPE_TRASACTION_BEGIN);
218
+ if (transBeginProp !== null) {
219
+ transBegin = (transBeginProp.GetComputedValue()).charAt(0);
220
+ }
221
+ return transBegin;
222
+ }
223
+ async initInnerObjects(parser, foundTagName) {
224
+ let form = this._task.getForm();
225
+ if (foundTagName == null)
226
+ return false;
227
+ if (foundTagName === (ConstInterface.MG_TAG_DATAVIEW)) {
228
+ let invalidate = await this.getAttributes(parser);
229
+ if (this._skipParsing) {
230
+ let endContext = parser.getXMLdata().indexOf(END_DV_TAG, parser.getCurrIndex());
231
+ parser.setCurrIndex(endContext + END_DV_TAG.length);
232
+ }
233
+ else {
234
+ this.fillExecStack(parser);
235
+ this.fillDataDc(parser);
236
+ if (invalidate && form != null)
237
+ form.SetTableItemsCount(0, true);
238
+ let taskRefreshType = this._recordsTab.fillData(this, this._insertAt, parser);
239
+ if (form != null) {
240
+ if (form.Opened) {
241
+ if (this._insertAt === 'B' && (invalidate || this._recordsTab.InsertedRecordsCount > 0)) {
242
+ if (invalidate || !this._task.getForm().isTableWithPagination()) {
243
+ form.SetTableItemsCount(0, true);
244
+ form.setTableItemsCount(false);
245
+ }
246
+ else
247
+ form.InsertTableItems(0, this._recordsTab.InsertedRecordsCount);
248
+ }
249
+ else
250
+ form.setTableItemsCount(false);
251
+ }
252
+ }
253
+ if (this.CurrRec != null && this.CurrRec.InRecompute && taskRefreshType === Constants.TASK_REFRESH_NONE)
254
+ taskRefreshType = Constants.TASK_REFRESH_CURR_REC;
255
+ if (invalidate) {
256
+ taskRefreshType = Constants.TASK_REFRESH_FORM;
257
+ if (this._task.IsSubForm)
258
+ this.getTask().DoSubformPrefixSuffix = true;
259
+ }
260
+ this.getTask().SetRefreshType(taskRefreshType);
261
+ this.UpdateDataviewAfterInsert();
262
+ let newRecId = this._recordsTab.getInitialCurrRecId();
263
+ if (newRecId !== Int32.MinValue && (this._recovery === ConstInterface.RECOVERY_NONE || this._firstDv)) {
264
+ if (this._firstDv && this._recovery === ConstInterface.RECOVERY_NONE &&
265
+ (this._task.getLevel().charCodeAt(0) === 0 || this._task.getLevel() === Constants.TASK_LEVEL_TASK))
266
+ this._task.setLevel(Constants.TASK_LEVEL_TASK);
267
+ this._fieldsTab.invalidate(true, Field.LEAVE_FLAGS);
268
+ if (newRecId !== this._currRecId) {
269
+ await this.setCurrRec(newRecId, !this._firstDv);
270
+ this._original = this.CurrRec.replicate();
271
+ if (this._firstDv)
272
+ this.takeFldValsFromCurrRec();
273
+ if (this._task.getForm() != null)
274
+ (this._task.getForm()).updateDisplayLineByDV();
275
+ }
276
+ else
277
+ this.takeFldValsFromCurrRec();
278
+ }
279
+ else if (invalidate && this._recordsTab.getSize() > 0) {
280
+ if (form == null || form.isScreenMode()) {
281
+ try {
282
+ await this.setCurrRecByIdx(0, false, true, false, 0);
283
+ }
284
+ catch (exception) {
285
+ if (exception instanceof RecordOutOfDataViewException) {
286
+ }
287
+ else
288
+ throw exception;
289
+ }
290
+ }
291
+ else {
292
+ this._fieldsTab.invalidate(true, Field.LEAVE_FLAGS);
293
+ this.setTopRecIdx(0);
294
+ if (this._task.getForm() != null)
295
+ this._task.getForm().SetTableTopIndex();
296
+ try {
297
+ await this.setCurrRecByIdx(0, false, true, true, 0);
298
+ if (this._task.getForm() != null)
299
+ (this._task.getForm()).updateDisplayLineByDV();
300
+ }
301
+ catch (exception) {
302
+ if (exception instanceof RecordOutOfDataViewException) {
303
+ }
304
+ else
305
+ throw exception;
306
+ }
307
+ if (this._task.getLevel() === Constants.TASK_LEVEL_CONTROL && this._task.getLastParkedCtrl() != null)
308
+ this._task.getLastParkedCtrl().resetPrevVal();
309
+ }
310
+ this.saveOriginal();
311
+ this._fieldsTab.invalidate(true, FieldBase.CLEAR_FLAGS);
312
+ }
313
+ if (this._firstDv)
314
+ this.setPrevCurrRec();
315
+ if (invalidate && this._task.IsSubForm)
316
+ this._task.getForm().getSubFormCtrl().RefreshOnVisible = false;
317
+ if (this._recovery === ConstInterface.RECOVERY_NONE) {
318
+ if (this.getTask().getAfterRetry(ConstInterface.RECOVERY_RETRY) &&
319
+ !this.getTask().IsAfterRetryBeforeBuildXML)
320
+ this._task.setLevel(Constants.TASK_LEVEL_RECORD);
321
+ }
322
+ else {
323
+ let transBegin = this.GetTransactionBegin();
324
+ let stopExecution = true;
325
+ switch (this._recovery) {
326
+ case ConstInterface.RECOVERY_ROLLBACK:
327
+ if (transBegin === ConstInterface.TRANS_RECORD_PREFIX) {
328
+ if (this._task.getMode() === Constants.TASK_MODE_DELETE ||
329
+ !this._task.IsInteractive)
330
+ stopExecution = false;
331
+ else {
332
+ this.getTask().setAfterRetry(ConstInterface.RECOVERY_ROLLBACK);
333
+ this.CurrRec.restart(this.CurrRec.getMode());
334
+ this.CurrRec.resetModified();
335
+ this._original = this.CurrRec.replicate();
336
+ this._pendingRecovery = RECOVERY_ACT_CANCEL;
337
+ }
338
+ }
339
+ else if (transBegin !== ConstInterface.TRANS_NONE) {
340
+ this._task.setLevel(Constants.TASK_LEVEL_TASK);
341
+ this._pendingRecovery = RECOVERY_ACT_BEGIN_TABLE;
342
+ this.getTask().setAfterRetry(ConstInterface.RECOVERY_ROLLBACK);
343
+ }
344
+ break;
345
+ case ConstInterface.RECOVERY_RETRY:
346
+ this.RecoveryRetry(transBegin);
347
+ break;
348
+ }
349
+ if (stopExecution) {
350
+ AccessHelper.eventsManager.setStopExecution(true);
351
+ this.getTask().TaskSuffixExecuted = false;
352
+ }
353
+ }
354
+ }
355
+ }
356
+ else if (foundTagName === '/' + ConstInterface.MG_TAG_DATAVIEW) {
357
+ if (this._includesFirst && this._includesLast && this.isEmpty()) {
358
+ this._currRecId = Int32.MinValue;
359
+ this._currRecIdx = Int32.MinValue;
360
+ this.CurrRec = null;
361
+ this.setTopRecIdx(Int32.MinValue);
362
+ }
363
+ parser.setCurrIndex2EndOfTag();
364
+ return false;
365
+ }
366
+ else
367
+ return false;
368
+ return true;
369
+ }
370
+ RecoveryRetry(transBegin) {
371
+ if (transBegin === ConstInterface.TRANS_RECORD_PREFIX) {
372
+ this._task.setLevel(Constants.TASK_LEVEL_RECORD);
373
+ this.getTask().setTransactionFailed(true);
374
+ this.getTask().setAfterRetry(ConstInterface.RECOVERY_RETRY);
375
+ this.CurrRec.restart(this.CurrRec.getMode());
376
+ if (!this._firstDv) {
377
+ this.takeFldValsFromCurrRec();
378
+ this._pendingRecovery = RECOVERY_ACT_MOVE_DIRECTION_BEGIN;
379
+ }
380
+ }
381
+ else if (transBegin !== ConstInterface.TRANS_NONE) {
382
+ this._task.setLevel(Constants.TASK_LEVEL_TASK);
383
+ this._pendingRecovery = RECOVERY_ACT_BEGIN_SCREEN;
384
+ this.getTask().setAfterRetry(ConstInterface.RECOVERY_RETRY);
385
+ this.getTask().setTransactionFailed(true);
386
+ }
387
+ }
388
+ UpdateDataviewAfterInsert() {
389
+ if (this._insertAt === 'B') {
390
+ let newRecs = this._recordsTab.InsertedRecordsCount;
391
+ if (this._currRecIdx !== Int32.MinValue)
392
+ this._currRecIdx += newRecs;
393
+ if (this._topRecIdx !== Int32.MinValue)
394
+ this._topRecIdx += newRecs;
395
+ if (this._oldTopRecIdx !== Int32.MinValue)
396
+ this._oldTopRecIdx += newRecs;
397
+ }
398
+ }
399
+ async getAttributes(parser) {
400
+ let tokensVector;
401
+ let tag;
402
+ let boolVal;
403
+ let dataViewCommand = null;
404
+ let isEmptyDataview = false;
405
+ this._recovery = ConstInterface.RECOVERY_NONE;
406
+ let endContext = parser.getXMLdata().indexOf(XMLConstants.TAG_CLOSE, parser.getCurrIndex());
407
+ if (endContext !== -1 && endContext < parser.getXMLdata().length) {
408
+ tag = parser.getXMLsubstring(endContext);
409
+ parser.add2CurrIndex(tag.indexOf(ConstInterface.MG_TAG_DATAVIEW) + ConstInterface.MG_TAG_DATAVIEW.length);
410
+ tokensVector = XmlParser.getTokens(parser.getXMLsubstring(endContext), XMLConstants.XML_ATTR_DELIM);
411
+ this._insertAt = ' ';
412
+ let invalidate = this.peekInvalidate(tokensVector);
413
+ this._locateFirstRec = 0;
414
+ for (let j = 0; j < tokensVector.length; j += 2) {
415
+ let attribute = (tokensVector.get_Item(j));
416
+ let valueStr = (tokensVector.get_Item(j + 1));
417
+ switch (attribute) {
418
+ case ConstInterface.MG_ATTR_INSERT_AT:
419
+ this._insertAt = valueStr[0];
420
+ break;
421
+ case ConstInterface.MG_ATTR_INCLUDE_FIRST:
422
+ boolVal = XmlParser.getBoolean(valueStr);
423
+ this.SetIncludesFirst(boolVal);
424
+ break;
425
+ case ConstInterface.MG_ATTR_INCLUDE_LAST:
426
+ boolVal = XmlParser.getBoolean(valueStr);
427
+ this.SetIncludesLast(boolVal);
428
+ break;
429
+ case ConstInterface.MG_ATTR_IS_ONEWAY_KEY:
430
+ boolVal = XmlParser.getBoolean(valueStr);
431
+ this.SetOneWayKey(boolVal);
432
+ break;
433
+ case ConstInterface.MG_ATTR_DBVIEWSIZE:
434
+ this.DBViewSize = XmlParser.getInt(valueStr);
435
+ break;
436
+ case ConstInterface.MG_ATTR_INVALIDATE:
437
+ {
438
+ }
439
+ break;
440
+ case ConstInterface.MG_ATTR_TOP_REC_ID:
441
+ this._topRecId = NNumber.Parse(valueStr);
442
+ break;
443
+ case ConstInterface.MG_ATTR_TASKMODE:
444
+ if (this._task.getOriginalTaskMode() === Constants.TASK_MODE_NONE || invalidate)
445
+ this._task.setOriginalTaskMode(valueStr);
446
+ this._task.setProp(PropInterface.PROP_TYPE_TASK_MODE, valueStr);
447
+ break;
448
+ case ConstInterface.MG_ATTR_EMPTY_DATAVIEW:
449
+ isEmptyDataview = true;
450
+ break;
451
+ case XMLConstants.MG_ATTR_TASKID:
452
+ continue;
453
+ case ConstInterface.MG_ATTR_LOW_ID:
454
+ this._lastCreatedRecId = NNumber.Parse(valueStr);
455
+ break;
456
+ case ConstInterface.MG_ATTR_TRANS_STAT:
457
+ let transStat = valueStr[0];
458
+ switch (transStat) {
459
+ case TRANS_STAT_OPENED:
460
+ dataViewCommand = CommandFactory.CreateSetTransactionStateDataviewCommand(this.getTask().getTaskTag(), true);
461
+ await this.getTask().DataviewManager.RemoteDataviewManager.Execute(dataViewCommand);
462
+ break;
463
+ case TRANS_STAT_CLOSED:
464
+ dataViewCommand = CommandFactory.CreateSetTransactionStateDataviewCommand(this.getTask().getTaskTag(), false);
465
+ await this.getTask().DataviewManager.RemoteDataviewManager.Execute(dataViewCommand);
466
+ this.getTask().setTransactionFailed(false);
467
+ break;
468
+ default:
469
+ break;
470
+ }
471
+ break;
472
+ case ConstInterface.MG_ATTR_RECOVERY:
473
+ if (this._task.IsTryingToStop)
474
+ this.getTask().setTryingToStop(false);
475
+ this.getTask().resetExecEndTask();
476
+ this._recovery = valueStr[0];
477
+ break;
478
+ case ConstInterface.MG_ATTR_DVPOS_VALUE:
479
+ this._dvPosValue = NNumber.Parse(valueStr);
480
+ break;
481
+ case ConstInterface.MG_ATTR_LOCATE_FIRST_ID:
482
+ this._locateFirstRec = NNumber.Parse(valueStr);
483
+ break;
484
+ case ConstInterface.MG_ATTR_OFFSET:
485
+ break;
486
+ case ConstInterface.MG_ATTR_USER_SORT:
487
+ let form = this._task.getForm();
488
+ form.clearTableColumnSortMark(XmlParser.getBoolean(valueStr));
489
+ break;
490
+ case ConstInterface.MG_ATTR_VAL_TOTAL_RECORDS_COUNT:
491
+ this.TotalRecordsCount = XmlParser.getInt(valueStr);
492
+ break;
493
+ case ConstInterface.MG_ATTR_VAL_RECORDS_BEFORE_CURRENT_VIEW:
494
+ this.RecordsBeforeCurrentView = XmlParser.getInt(valueStr);
495
+ break;
496
+ case ConstInterface.MG_ATTR_VAL_SERVER_TRANS_CACHE_EMPTY:
497
+ this._serverTransCacheEmpty = XmlParser.getBoolean(valueStr);
498
+ break;
499
+ default:
500
+ Logger.Instance.WriteExceptionToLogWithMsg('Unknown attribute for <' + ConstInterface.MG_TAG_DATAVIEW + '> tag: ' + attribute);
501
+ break;
502
+ }
503
+ }
504
+ this.setEmptyDataview(isEmptyDataview);
505
+ parser.setCurrIndex(++endContext);
506
+ return invalidate;
507
+ }
508
+ Logger.Instance.WriteExceptionToLogWithMsg('in DataView.getAttributes(): out of bounds');
509
+ return false;
510
+ }
511
+ SetOneWayKey(val) {
512
+ this.IsOneWayKey = val;
513
+ }
514
+ SetIncludesLast(val) {
515
+ this._includesLast = val;
516
+ }
517
+ SetIncludesFirst(val) {
518
+ let prevIncludeFirst = this._includesFirst;
519
+ this._includesFirst = val;
520
+ if (this._includesFirst !== prevIncludeFirst) {
521
+ let form = this._task.getForm();
522
+ if (form !== null) {
523
+ form.SetTableItemsCount(0, true);
524
+ }
525
+ }
526
+ }
527
+ fillDataDc(parser) {
528
+ let dcvBuilder = new XMLBasedDcValuesBuilder();
529
+ let foundTagName = parser.getNextTag();
530
+ while (foundTagName !== null && foundTagName === ConstInterface.MG_TAG_DC_VALS) {
531
+ let dcValsPosition = parser.getCurrIndex();
532
+ dcvBuilder.SerializedDCVals = parser.ReadToEndOfCurrentElement();
533
+ let dcv = dcvBuilder.Build();
534
+ if (dcv !== null)
535
+ this.AddDcValues(dcv);
536
+ else
537
+ Logger.Instance.WriteExceptionToLogWithMsg('Error while parsing DC values at position ' + dcValsPosition);
538
+ foundTagName = parser.getNextTag();
539
+ }
540
+ }
541
+ AddDcValues(dcv) {
542
+ this._dcValsCollection.Add(dcv.getId().toString(), dcv);
543
+ }
544
+ fillExecStack(parser) {
545
+ let foundTagName = parser.getNextTag();
546
+ let execStackTagExists = false;
547
+ while (foundTagName !== null && foundTagName === ConstInterface.MG_TAG_EXEC_STACK_ENTRY) {
548
+ this.fillInnerExecStack(parser);
549
+ foundTagName = parser.getNextTag();
550
+ execStackTagExists = true;
551
+ }
552
+ if (execStackTagExists) {
553
+ AccessHelper.eventsManager.reverseServerExecStack();
554
+ }
555
+ }
556
+ fillInnerExecStack(parser) {
557
+ let tokensVector;
558
+ const endContext = parser.getXMLdata().indexOf(XMLConstants.TAG_TERM, parser.getCurrIndex());
559
+ let attribute;
560
+ let taskId = '';
561
+ let handlerId = '';
562
+ let operIdx = 0;
563
+ if (endContext !== -1 && endContext < parser.getXMLdata().length) {
564
+ let tag = parser.getXMLsubstring(endContext);
565
+ parser.add2CurrIndex(tag.indexOf(ConstInterface.MG_TAG_EXEC_STACK_ENTRY) + ConstInterface.MG_TAG_EXEC_STACK_ENTRY.length);
566
+ tokensVector = XmlParser.getTokens(parser.getXMLsubstring(endContext), XMLConstants.XML_ATTR_DELIM);
567
+ for (let j = 0; j < tokensVector.length; j += 2) {
568
+ attribute = (tokensVector.get_Item(j));
569
+ let valueStr = (tokensVector.get_Item(j + 1));
570
+ switch (attribute) {
571
+ case XMLConstants.MG_ATTR_TASKID:
572
+ taskId = valueStr;
573
+ break;
574
+ case ConstInterface.MG_ATTR_HANDLERID:
575
+ handlerId = valueStr;
576
+ break;
577
+ case ConstInterface.MG_ATTR_OPER_IDX:
578
+ operIdx = XmlParser.getInt(valueStr);
579
+ break;
580
+ }
581
+ }
582
+ AccessHelper.eventsManager.pushServerExecStack(taskId, handlerId, operIdx);
583
+ parser.setCurrIndex(endContext + XMLConstants.TAG_TERM.length);
584
+ }
585
+ else
586
+ Logger.Instance.WriteExceptionToLogWithMsg('in DataView.fillInnerExecStack() out of bounds');
587
+ }
588
+ peekInvalidate(tokensVector) {
589
+ let sessionCounter = CommandsProcessorManager.GetCommandsProcessor().GetSessionCounter();
590
+ for (let j = 0; j < tokensVector.length; j += 2) {
591
+ let attribute = tokensVector.get_Item(j);
592
+ if (attribute === (ConstInterface.MG_ATTR_INVALIDATE)) {
593
+ let valueStr = tokensVector.get_Item(j + 1);
594
+ if (XmlParser.getBoolean(valueStr)) {
595
+ if (sessionCounter < this._lastSessionCounter)
596
+ this._skipParsing = true;
597
+ else {
598
+ this._lastSessionCounter = sessionCounter;
599
+ this.clear();
600
+ return true;
601
+ }
602
+ }
603
+ return false;
604
+ }
605
+ }
606
+ return false;
607
+ }
608
+ getFieldByName(fldName) {
609
+ if (this._fieldsTab !== null)
610
+ return this._fieldsTab.getField(fldName);
611
+ Logger.Instance.WriteExceptionToLogWithMsg('in DataView.getField(String): There is no fieldsTab object');
612
+ return null;
613
+ }
614
+ async buildXML(message) {
615
+ let dcv;
616
+ let taskTag = this._task.getTaskTag();
617
+ let brkLevelIndex = this._task.getBrkLevelIndex();
618
+ let currRecDeleted = false;
619
+ let serverParent;
620
+ let contextTask = (this.getTask().GetContextTask());
621
+ let invokingTaskTag = contextTask.IsOffline ? INVOKED_FROM_OFFLINE_TASK : contextTask.getTaskTag();
622
+ message.Append('\n <' + ConstInterface.MG_TAG_DATAVIEW + ' ' + XMLConstants.MG_ATTR_TASKID + '="' +
623
+ taskTag + '"');
624
+ message.Append(' ' + ConstInterface.MG_ATTR_TASKLEVEL + '="' + brkLevelIndex + '"');
625
+ serverParent = '0';
626
+ let triggeringTask = this.getTask().getTriggeringTask();
627
+ if (triggeringTask != null) {
628
+ if (triggeringTask.IsOffline) {
629
+ let ctlIdx = triggeringTask.getCtlIdx();
630
+ let mainPrg = AccessHelper.mgDataTable.GetMainProgByCtlIdx(-1, ctlIdx);
631
+ serverParent = mainPrg.getTaskTag();
632
+ }
633
+ else
634
+ serverParent = triggeringTask.getTaskTag();
635
+ }
636
+ if (this._currRecId > Int32.MinValue) {
637
+ if (this.CurrRec != null)
638
+ message.Append(' ' + ConstInterface.MG_ATTR_CURR_REC + '="' + this._currRecId + '"');
639
+ message.Append(' ' + ConstInterface.MG_ATTR_TASKMODE + '="' + this._task.getMode() + '"');
640
+ if (this._transCleared && !(MGDataCollection.Instance.StartupMgData.getFirstTask().InEndTask && MGDataCollection.Instance.StartupMgData.getFirstTask().ClosingFormUI)) {
641
+ message.Append(' ' + ConstInterface.MG_ATTR_TRANS_CLEARED + '="1"');
642
+ this._transCleared = false;
643
+ }
644
+ message.Append(' ' + ConstInterface.MG_ATTR_INVOKER_ID + '="' + invokingTaskTag + ',' + serverParent + '"');
645
+ if (await this.getTask().isCached())
646
+ message.Append(' ' + ConstInterface.MG_ATTR_DVPOS_VALUE + '="' + this._dvPosValue + '"');
647
+ message.Append(' ' + ConstInterface.MG_ATTR_LOOP_COUNTER + '="' + this.getTask().getLoopCounter() + '"');
648
+ if (this._task.IsSubForm) {
649
+ let subformCtrl = this._task.getForm().getSubFormCtrl();
650
+ if (!subformCtrl.isVisible() &&
651
+ !await subformCtrl.checkProp(PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN, false))
652
+ message.Append(' ' + ConstInterface.MG_ATTR_SUBFORM_VISIBLE + '="0"');
653
+ }
654
+ if (!this._task.IsInteractive)
655
+ message.Append(' ' + ConstInterface.MG_ATTR_TASK_COUNTER + '="' + this.getTask().getCounter() + '"');
656
+ if (this._task != null && this._task.GetComputedProperty(PropInterface.PROP_TYPE_PRELOAD_VIEW).GetComputedValueBoolean()) {
657
+ message.Append(' ' + ConstInterface.MG_ATTR_LAST_REC_ID + '="' +
658
+ (this._recordsTab.getRecByIdx(this.getSize() - 1).getId()) + '"');
659
+ message.Append(' ' + ConstInterface.MG_ATTR_OLD_FIRST_REC_ID + '="' +
660
+ this._recordsTab.getRecByIdx(0).getId() + '"');
661
+ }
662
+ if (this._task.IsInteractive) {
663
+ let form = this._task.getForm();
664
+ if (form != null && this._recordsTab.getSize() > 1) {
665
+ message.Append(' ' + ConstInterface.MG_ATTR_CURR_REC_POS_IN_FORM + '="' +
666
+ form.getCurrRecPosInForm() + '"');
667
+ }
668
+ }
669
+ message.Append(XMLConstants.TAG_CLOSE);
670
+ if (this.getTask().ResetRange || this.getTask().UserRngs != null) {
671
+ message.Append(XMLConstants.START_TAG + ConstInterface.USER_RANGES);
672
+ if (this.getTask().ResetRange) {
673
+ message.Append(' ' + ConstInterface.CLEAR_RANGE + '="1"');
674
+ this.getTask().ResetRange = false;
675
+ }
676
+ if (this.getTask().UserRngs != null) {
677
+ this.getTask().buildXMLForRngs(message, this.getTask().UserRngs, false);
678
+ this.getTask().UserRngs.Clear();
679
+ this.getTask().UserRngs = null;
680
+ }
681
+ else
682
+ message.Append(XMLConstants.TAG_TERM);
683
+ }
684
+ if (this.getTask().ResetLocate || this.getTask().UserLocs != null) {
685
+ message.Append(XMLConstants.START_TAG + ConstInterface.USER_LOCATES);
686
+ if (this.getTask().ResetLocate) {
687
+ message.Append(' ' + ConstInterface.CLEAR_LOCATES + '="1"');
688
+ this.getTask().ResetLocate = false;
689
+ }
690
+ if (this.getTask().UserLocs != null) {
691
+ this.getTask().buildXMLForRngs(message, this.getTask().UserLocs, true);
692
+ this.getTask().UserLocs.Clear();
693
+ this.getTask().UserLocs = null;
694
+ }
695
+ else
696
+ message.Append(XMLConstants.TAG_TERM);
697
+ }
698
+ if (this.getTask().ResetSort || this.getTask().UserSorts != null) {
699
+ message.Append(XMLConstants.START_TAG + ConstInterface.MG_TAG_SORTS);
700
+ if (this.getTask().ResetSort) {
701
+ message.Append(' ' + ConstInterface.CLEAR_SORTS + '="1"');
702
+ this.getTask().ResetSort = false;
703
+ }
704
+ if (this.getTask().UserSorts != null)
705
+ this.getTask().buildXMLForSorts(message);
706
+ else
707
+ message.Append(XMLConstants.TAG_TERM);
708
+ }
709
+ if (await this.getTask().isCached()) {
710
+ let delList = this.getTask().getTaskCache().getDeletedListToXML();
711
+ if (delList !== '') {
712
+ message.Append(XMLConstants.START_TAG + ConstInterface.MG_TAG_DEL_LIST);
713
+ message.Append(' ' + XMLConstants.MG_ATTR_ID + '="' + this._task.getTaskTag() + '"');
714
+ message.Append(' ' + ConstInterface.MG_ATTR_REMOVE + '="' + delList + '"');
715
+ message.Append(XMLConstants.TAG_TERM);
716
+ if (this.getTask().getTaskCache().isDeleted(this._dvPosValue))
717
+ this.setChanged(true);
718
+ this.getTask().getTaskCache().clearDeletedList();
719
+ }
720
+ }
721
+ let dcValKeys = this._dcValsCollection.Keys;
722
+ dcValKeys.forEach((dcValKey) => {
723
+ dcv = this._dcValsCollection.get_Item(dcValKey);
724
+ if (!dcv.HasReferences) {
725
+ message.Append(XMLConstants.START_TAG + ConstInterface.MG_TAG_DC_VALS);
726
+ message.Append(' ' + XMLConstants.MG_ATTR_ID + '="' + dcv.getId() + '"');
727
+ message.Append(' ' + ConstInterface.MG_ATTR_REMOVE + '="1"');
728
+ message.Append(XMLConstants.TAG_TERM);
729
+ this._dcValsCollection.Remove(dcValKey);
730
+ }
731
+ });
732
+ if (this.CurrRec != null)
733
+ currRecDeleted = (this.CurrRec.getMode() === DataModificationTypes.Delete
734
+ && this._modifiedRecordsTab.getRecord(this.CurrRec.getId()) != null && this.CurrRec.SendToServer);
735
+ let skipCurrRec = false;
736
+ if (this.CurrRec != null && this._modifiedRecordsTab.getRecord(this.CurrRec.getId()) != null)
737
+ skipCurrRec = AccessHelper.eventsManager.isForceExitPreRecordUpdate(this.getTask());
738
+ this._modifiedRecordsTab.buildXML(message, skipCurrRec, this.CurrRec.getId());
739
+ if (this._original != null)
740
+ this._original.clearMode();
741
+ for (let i = this._modifiedRecordsTab.getSize() - 1; i >= 0; i--) {
742
+ if (skipCurrRec && this._modifiedRecordsTab.getRecByIdx(i).getId() === this.CurrRec.getId())
743
+ continue;
744
+ this._modifiedRecordsTab.getRecByIdx(i).clearFlagsHistory();
745
+ this._modifiedRecordsTab.removeRecord(i);
746
+ }
747
+ if (this.CurrRec != null && !currRecDeleted) {
748
+ let forceBuild = (this._task.isMainProg() && (RemoteCommandsProcessor.IsSessionReInitializing));
749
+ this.CurrRec.buildXML(message, true, forceBuild);
750
+ }
751
+ }
752
+ else {
753
+ message.Append(' ' + ConstInterface.MG_ATTR_INVOKER_ID + '="' + invokingTaskTag + ',' + serverParent + '"' +
754
+ XMLConstants.TAG_CLOSE);
755
+ }
756
+ message.Append('\n </' + ConstInterface.MG_TAG_DATAVIEW + XMLConstants.TAG_CLOSE);
757
+ }
758
+ getCurrRec() {
759
+ if (this.CurrRec === null && this._currRecId > Int32.MinValue) {
760
+ Logger.Instance.WriteExceptionToLogWithMsg('DataView.getCurrRec(): record ' + this._currRecId + ' not found');
761
+ }
762
+ return this.CurrRec;
763
+ }
764
+ getPrevCurrRec() {
765
+ return this._prevCurrRec;
766
+ }
767
+ getOriginalRec() {
768
+ if (this._original === null || this._original.getId() !== this.CurrRec.getId())
769
+ return this.CurrRec;
770
+ return this._original;
771
+ }
772
+ async setCurrRec(id, compute) {
773
+ let oldRecId = this._currRecId;
774
+ if (id > Int32.MinValue) {
775
+ let newIdx = this._recordsTab.getRecIdx(id);
776
+ if (newIdx === -1)
777
+ this._original = null;
778
+ else {
779
+ try {
780
+ let ignoreCurrRec = this._currRecId === Int32.MinValue;
781
+ await this.setCurrRecByIdx(newIdx, !ignoreCurrRec, ignoreCurrRec, compute, Int32.MinValue);
782
+ if (id !== oldRecId)
783
+ this.saveOriginal();
784
+ return true;
785
+ }
786
+ catch (exception) {
787
+ if (exception instanceof RecordOutOfDataViewException) {
788
+ }
789
+ else
790
+ throw exception;
791
+ }
792
+ }
793
+ }
794
+ else {
795
+ this.CurrRec = null;
796
+ this._original = null;
797
+ this._currRecId = Int32.MinValue;
798
+ }
799
+ return false;
800
+ }
801
+ async setCurrRecByIdx(newIdx, doSuffix, ignoreCurrRec, compute, newDisplayLine) {
802
+ let lastRecIdx = this._recordsTab.getSize() - 1;
803
+ let oldFirstRec, nextRec;
804
+ let recordSuff = false;
805
+ if (newIdx === Constants.MG_DATAVIEW_FIRST_RECORD) {
806
+ if (this.getTask().isTableWithAbsolutesScrollbar()) {
807
+ this.RecordsBeforeCurrentView = 0;
808
+ }
809
+ if (this._includesFirst) {
810
+ if (this._currRecIdx >= 0 || this._currRecIdx === Int32.MinValue) {
811
+ newIdx = 0;
812
+ recordSuff = true;
813
+ }
814
+ else
815
+ throw new RecordOutOfDataViewException(RecordOutOfDataViewException_ExceptionType.TOP);
816
+ }
817
+ else {
818
+ await this.fetchChunkFromServer(CHUNK_DV_TOP, doSuffix);
819
+ await this.setCurrRecByIdx(newIdx, false, ignoreCurrRec, compute, SET_DISPLAYLINE_BY_DV);
820
+ return;
821
+ }
822
+ }
823
+ else if (newIdx === Constants.MG_DATAVIEW_LAST_RECORD) {
824
+ if (this._includesLast) {
825
+ if (this._currRecIdx <= lastRecIdx) {
826
+ newIdx = lastRecIdx;
827
+ recordSuff = true;
828
+ }
829
+ else
830
+ throw new RecordOutOfDataViewException(RecordOutOfDataViewException_ExceptionType.BOTTOM);
831
+ }
832
+ else {
833
+ if (this.getTask().isTableWithAbsolutesScrollbar())
834
+ this.RecordsBeforeCurrentView = this.TotalRecordsCount;
835
+ await this.fetchChunkFromServer(CHUNK_DV_BOTTOM, doSuffix);
836
+ if (!this._includesLast)
837
+ throw new RecordOutOfDataViewException(RecordOutOfDataViewException_ExceptionType.BOTTOM);
838
+ if (this.getTask().isTableWithAbsolutesScrollbar()) {
839
+ let form = this._task.getForm();
840
+ if (form != null) {
841
+ while (!this._includesFirst && form.getRowsInPage() >= this.getSize()) {
842
+ await this.fetchChunkFromServer(CHUNK_CACHE_PREV, false);
843
+ }
844
+ }
845
+ }
846
+ await this.setCurrRecByIdx(newIdx, false, ignoreCurrRec, compute, SET_DISPLAYLINE_BY_DV);
847
+ return;
848
+ }
849
+ }
850
+ else if (newIdx < 0) {
851
+ if (this._includesFirst)
852
+ throw new RecordOutOfDataViewException(RecordOutOfDataViewException_ExceptionType.TOP);
853
+ oldFirstRec = this._recordsTab.getRecByIdx(0);
854
+ if (this._recordsTab.getSize() > 0 || this.IncludesLast())
855
+ await this.fetchChunkFromServer(CHUNK_CACHE_PREV, doSuffix);
856
+ else if (this._recordsTab.getSize() === 0 && this.IncludesFirst())
857
+ await this.fetchChunkFromServer(CHUNK_DV_TOP, doSuffix);
858
+ else
859
+ Logger.Instance.WriteExceptionToLogWithMsg('in DataView.fetchChunkFromServer() wrong option');
860
+ let oldFirstNewIdx = oldFirstRec != null
861
+ ? this._recordsTab.getRecIdx(oldFirstRec.getId())
862
+ : this._recordsTab.getSize();
863
+ if (oldFirstNewIdx !== 0)
864
+ await this.setCurrRecByIdx(oldFirstNewIdx + newIdx, false, ignoreCurrRec, compute, SET_DISPLAYLINE_BY_DV);
865
+ return;
866
+ }
867
+ else if (newIdx > lastRecIdx) {
868
+ if (this._includesLast)
869
+ throw new RecordOutOfDataViewException(RecordOutOfDataViewException_ExceptionType.BOTTOM);
870
+ if (this.getForm().isRowCreated(newIdx))
871
+ this.getForm().markRowNOTCreated(newIdx);
872
+ await this.fetchChunkFromServer(CHUNK_CACHE_NEXT, doSuffix);
873
+ await this.setCurrRecByIdx(newIdx, false, ignoreCurrRec, compute, SET_DISPLAYLINE_BY_DV);
874
+ return;
875
+ }
876
+ let isCreateLineAboveAct = false;
877
+ let lastEvent = isNullOrUndefined(AccessHelper.eventsManager.getLastRtEvent()) ? 0 :
878
+ AccessHelper.eventsManager.getLastRtEvent().getInternalCode();
879
+ if (newIdx >= 0 && !this.getTask().transactionFailed(ConstInterface.TRANS_RECORD_PREFIX) &&
880
+ lastEvent === InternalInterface.MG_ACT_CRELINE_ABOVE) {
881
+ if ((this.getTask().getInCreateLine()) && newIdx == this._currRecIdx) {
882
+ let newRec = this._recordsTab.getRecByIdx(newIdx);
883
+ if (newRec.getMode() == DataModificationTypes.Insert)
884
+ isCreateLineAboveAct = true;
885
+ }
886
+ }
887
+ if (recordSuff || isCreateLineAboveAct || newIdx !== this._currRecIdx || ignoreCurrRec && compute) {
888
+ if (!ignoreCurrRec && doSuffix && this.CurrRec != null) {
889
+ let oldRecTabSize = this._recordsTab.getSize();
890
+ nextRec = this._recordsTab.getRecByIdx(newIdx);
891
+ if (nextRec.isNewRec()) {
892
+ if (this._task.getMode() !== Constants.TASK_MODE_CREATE &&
893
+ !await this._task.checkProp(PropInterface.PROP_TYPE_ALLOW_CREATE, true))
894
+ AccessHelper.eventsManager.setStopExecution(true);
895
+ }
896
+ if (!AccessHelper.eventsManager.GetStopExecutionFlag()) {
897
+ let orgTopRecIdx = 0;
898
+ if (this._topRecIdxModified) {
899
+ orgTopRecIdx = this.getTopRecIdx();
900
+ this.restoreTopRecIdx();
901
+ }
902
+ await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_REC_SUFFIX);
903
+ if (this._topRecIdxModified)
904
+ this.setTopRecIdx(orgTopRecIdx);
905
+ }
906
+ if (AccessHelper.eventsManager.GetStopExecutionFlag())
907
+ throw new RecordOutOfDataViewException(RecordOutOfDataViewException_ExceptionType.REC_SUFFIX_FAILED);
908
+ if (nextRec !== this.CurrRec && this.getTask().getAfterRetry())
909
+ this._task.setLevel(Constants.TASK_LEVEL_TASK);
910
+ if (oldRecTabSize - 1 === this._recordsTab.getSize() && this._currRecIdx < newIdx)
911
+ newIdx--;
912
+ if (newIdx === this._currRecIdx) {
913
+ if (this._task.getMode() === Constants.TASK_MODE_CREATE && !this.CurrRec.isNewRec() &&
914
+ !this._task.getForm().inRefreshDisplay())
915
+ this._task.setMode(Constants.TASK_MODE_MODIFY);
916
+ return;
917
+ }
918
+ }
919
+ this.CurrRec = this._recordsTab.getRecByIdx(newIdx);
920
+ if (this.CurrRec == null)
921
+ throw new ApplicationException('in DataView.setCurrRecByIdx() current record not found!');
922
+ this._currRecId = this.CurrRec.getId();
923
+ this._currRecIdx = newIdx;
924
+ if (this._task.getForm() != null) {
925
+ if (newDisplayLine === SET_DISPLAYLINE_BY_DV) {
926
+ (this._task.getForm()).updateDisplayLineByDV();
927
+ }
928
+ else
929
+ this._task.getForm().DisplayLine = newDisplayLine;
930
+ }
931
+ if (this._task.getMode() === Constants.TASK_MODE_CREATE && !this.CurrRec.isNewRec() &&
932
+ !this._task.getForm().inRefreshDisplay())
933
+ this._task.setMode(Constants.TASK_MODE_MODIFY);
934
+ if (compute)
935
+ await this.currRecCompute(false);
936
+ }
937
+ }
938
+ async currRecCompute(forceClientCompute) {
939
+ this._fieldsTab.invalidate(false, true);
940
+ await this.compute(false, forceClientCompute);
941
+ }
942
+ saveOriginal() {
943
+ if (!this.CurrRec.Modified)
944
+ this._original = this.CurrRec.replicate();
945
+ }
946
+ async fetchChunkFromServer(chunkId, doSuffix) {
947
+ this._task.getForm().FormRefreshed = true;
948
+ if (doSuffix && this.CurrRec != null) {
949
+ await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_REC_SUFFIX);
950
+ if (AccessHelper.eventsManager.GetStopExecutionFlag() || this._task.isAborting())
951
+ throw new RecordOutOfDataViewException(RecordOutOfDataViewException_ExceptionType.REC_SUFFIX_FAILED);
952
+ this._task.getForm().setSuffixDone();
953
+ }
954
+ let eventCode;
955
+ let clientRecId = this._currRecId;
956
+ switch (chunkId) {
957
+ case CHUNK_DV_TOP:
958
+ eventCode = InternalInterface.MG_ACT_DATAVIEW_TOP;
959
+ break;
960
+ case CHUNK_DV_BOTTOM:
961
+ eventCode = InternalInterface.MG_ACT_DATAVIEW_BOTTOM;
962
+ break;
963
+ case CHUNK_CACHE_PREV:
964
+ clientRecId = this.FirstRecord == null ? 0 : this.FirstRecord.getId();
965
+ eventCode = InternalInterface.MG_ACT_CACHE_PREV;
966
+ break;
967
+ case CHUNK_CACHE_NEXT:
968
+ eventCode = InternalInterface.MG_ACT_CACHE_NEXT;
969
+ clientRecId = this.LastRecord == null ? 0 : this.LastRecord.getId();
970
+ break;
971
+ default:
972
+ Logger.Instance.WriteExceptionToLogWithMsg('in DataView.fetchChunkFromServer() unknown chunk id: ' + chunkId);
973
+ return;
974
+ }
975
+ let cmd = CommandFactory.CreateEventCommand(this._task.getTaskTag(), eventCode);
976
+ cmd.ClientRecId = clientRecId;
977
+ await this.getTask().DataviewManager.Execute(cmd);
978
+ }
979
+ async FetchRecordsAheadFromServer() {
980
+ if (!this._includesLast)
981
+ await this.fetchChunkFromServer(CHUNK_CACHE_NEXT, false);
982
+ else if (!this._includesFirst)
983
+ await this.fetchChunkFromServer(CHUNK_CACHE_PREV, false);
984
+ }
985
+ recExists(recIdx) {
986
+ let lastRecIdx = this._recordsTab.getSize() - 1;
987
+ return recIdx >= 0 && recIdx <= lastRecIdx;
988
+ }
989
+ checkFirst(locateFirst) {
990
+ return this._recordsTab.getRecord(locateFirst) !== null;
991
+ }
992
+ getCurrRecIdx() {
993
+ if (this._currRecIdx === Int32.MinValue) {
994
+ if (!this.setCurrRec(this._currRecId, true)) {
995
+ Logger.Instance.WriteWarningToLogWithMsg('DataView.getCurrRecIdx(): _task ' +
996
+ (this.getTask()).PreviouslyActiveTaskId +
997
+ ', record ' + this._currRecId + ' not found');
998
+ }
999
+ }
1000
+ return this._currRecIdx;
1001
+ }
1002
+ getCurrDBViewRowIdx() {
1003
+ return this.CurrRec.getDBViewRowIdx();
1004
+ }
1005
+ setTopRecIdx(newTopRecIdx) {
1006
+ this._oldTopRecIdx = this.getTopRecIdx();
1007
+ this._topRecIdx = newTopRecIdx;
1008
+ }
1009
+ getTopRecIdx() {
1010
+ return this._topRecIdx;
1011
+ }
1012
+ setTopRecIdxModified(val) {
1013
+ this._topRecIdxModified = val;
1014
+ }
1015
+ getChunkSize() {
1016
+ return this._chunkSize;
1017
+ }
1018
+ restoreTopRecIdx() {
1019
+ this._topRecIdx = this._oldTopRecIdx;
1020
+ }
1021
+ clear() {
1022
+ this._recordsTab.removeAll();
1023
+ this._original = null;
1024
+ let mgForm = this._task.getForm();
1025
+ if (mgForm !== null) {
1026
+ this._task.getForm().SetTableItemsCount(0, true);
1027
+ }
1028
+ this._modifiedRecordsTab.removeAll();
1029
+ this.init();
1030
+ }
1031
+ init() {
1032
+ this._currRecId = Int32.MinValue;
1033
+ this._currRecIdx = Int32.MinValue;
1034
+ this.CurrRec = null;
1035
+ this._prevCurrRec = null;
1036
+ this._includesFirst = false;
1037
+ this._includesLast = false;
1038
+ this.IsOneWayKey = false;
1039
+ this.setTopRecIdx(Int32.MinValue);
1040
+ this._fieldsTab.invalidate(false, true);
1041
+ }
1042
+ async computeSubForms() {
1043
+ if (await this.getTask().prepareCache(true)) {
1044
+ if (!await this.getTask().testAndSet(true))
1045
+ await this.compute(true, false);
1046
+ }
1047
+ else
1048
+ await this.compute(true, false);
1049
+ }
1050
+ async compute(subForms, forceClientCompute) {
1051
+ let tmpRec = null;
1052
+ let computeByServer = !this.computeByClient();
1053
+ let orgComputeBy = this._computeBy;
1054
+ if (forceClientCompute)
1055
+ this._computeBy = COMPUTE_NEWREC_ON_CLIENT;
1056
+ try {
1057
+ this.CurrRec.setInCompute(true);
1058
+ if (!subForms) {
1059
+ if (this.CurrRec.isNewRec()) {
1060
+ if (this._task.getMode() !== Constants.TASK_MODE_CREATE && !super.isEmptyDataview()) {
1061
+ this._task.setMode(Constants.TASK_MODE_CREATE);
1062
+ }
1063
+ }
1064
+ else if (this._task.getMode() === Constants.TASK_MODE_CREATE) {
1065
+ this._task.setMode(Constants.TASK_MODE_MODIFY);
1066
+ }
1067
+ }
1068
+ let getRecordData = computeByServer;
1069
+ if (subForms || (getRecordData && !this.CurrRec.isComputed() && !forceClientCompute)) {
1070
+ let command = CommandFactory.CreateComputeEventCommand(this._task.getTaskTag(), subForms, this._currRecId);
1071
+ await this._task.DataviewManager.Execute(command);
1072
+ }
1073
+ else {
1074
+ if (getRecordData) {
1075
+ tmpRec = new Record(this.CurrRec.getId(), this);
1076
+ tmpRec.Initialize();
1077
+ tmpRec.setInitialFldVals(true, true);
1078
+ }
1079
+ this._fieldsTab.setServerRcmp(false);
1080
+ let from = this._fieldsTab.getRMIdx();
1081
+ let size = this._fieldsTab.getRMSize();
1082
+ for (let i = from; i < from + size; i = i + 1) {
1083
+ let fld = this._fieldsTab.getField(i);
1084
+ if (getRecordData && this._fieldsTab.serverRcmpDone() && fld.IsVirtual && !fld.VirAsReal && !fld.hasInitExp()) {
1085
+ let currRec2 = this.CurrRec;
1086
+ this.CurrRec = tmpRec;
1087
+ try {
1088
+ fld.takeValFromRec();
1089
+ }
1090
+ finally {
1091
+ this.CurrRec = currRec2;
1092
+ }
1093
+ }
1094
+ if (!this._task.getForm().TransferringDataToGUI)
1095
+ await fld.compute(false);
1096
+ }
1097
+ }
1098
+ }
1099
+ finally {
1100
+ this.CurrRec.setInCompute(false);
1101
+ this.CurrRec.setLateCompute(false);
1102
+ this._computeBy = orgComputeBy;
1103
+ }
1104
+ }
1105
+ async addRecord(doSuffix, ignoreCurrRec, isCrelineAbove) {
1106
+ let newCurrRecId = (--this._lastCreatedRecId);
1107
+ let mode = DataModificationTypes.Insert;
1108
+ return await this.addRecord_1(doSuffix, ignoreCurrRec, false, newCurrRecId, mode, isCrelineAbove);
1109
+ }
1110
+ async addRecord_1(doSuffix, ignoreCurrRec, isFirstRecord, newCurrRecId, mode, isCrelineAbove) {
1111
+ let rec = new Record(newCurrRecId, this);
1112
+ rec.Initialize();
1113
+ rec.setInitialFldVals(false, !isFirstRecord);
1114
+ let newCurrRecIdx = 0;
1115
+ if (isCrelineAbove) {
1116
+ newCurrRecIdx = (this._currRecIdx >= 0
1117
+ ? this._currRecIdx
1118
+ : 0);
1119
+ }
1120
+ else
1121
+ newCurrRecIdx = (this._currRecIdx != Int32.MinValue
1122
+ ? this._currRecIdx + 1
1123
+ : 0);
1124
+ this._recordsTab.insertRecord(rec, newCurrRecIdx);
1125
+ rec.setMode(mode);
1126
+ try {
1127
+ let compute = !isFirstRecord;
1128
+ await this.setCurrRecByIdx(newCurrRecIdx, doSuffix, ignoreCurrRec, compute, Int32.MinValue);
1129
+ if (isFirstRecord && this.getTask().getMode() !== Constants.TASK_MODE_CREATE)
1130
+ rec.setOldRec();
1131
+ }
1132
+ catch (execption) {
1133
+ if (execption instanceof RecordOutOfDataViewException) {
1134
+ if (AccessHelper.eventsManager.GetStopExecutionFlag())
1135
+ newCurrRecIdx = -1;
1136
+ else
1137
+ throw new ApplicationException('in DataView.addRecord() invalid exception');
1138
+ }
1139
+ else
1140
+ throw execption;
1141
+ }
1142
+ return newCurrRecIdx;
1143
+ }
1144
+ async removeCurrRec() {
1145
+ let mgForm = this._task.getForm();
1146
+ let onDelete;
1147
+ if (this.CurrRec.getMode() === DataModificationTypes.Insert &&
1148
+ !this.getTask().transactionFailed(ConstInterface.TRANS_RECORD_PREFIX)) {
1149
+ this._modifiedRecordsTab.removeRecord(this.CurrRec);
1150
+ onDelete = false;
1151
+ }
1152
+ else {
1153
+ this.CurrRec.clearMode();
1154
+ this.CurrRec.setMode(DataModificationTypes.Delete);
1155
+ onDelete = true;
1156
+ }
1157
+ this.CurrRec.removeRecFromDc();
1158
+ this._recordsTab.removeRecord(this._currRecIdx);
1159
+ this.setChanged(true);
1160
+ if (this.isEmpty() && !this._task.IsTryingToStop) {
1161
+ await this.MoveToEmptyDataviewIfAllowed();
1162
+ }
1163
+ let newDisplayLine = this.calcLineToMove(onDelete);
1164
+ try {
1165
+ if (mgForm.isScreenMode()) {
1166
+ await this.setCurrRecByIdx(newDisplayLine, false, false, true, SET_DISPLAYLINE_BY_DV);
1167
+ }
1168
+ else {
1169
+ await mgForm.setCurrRowByDisplayLine(newDisplayLine, false, true);
1170
+ }
1171
+ }
1172
+ catch (exception) {
1173
+ if (exception instanceof RecordOutOfDataViewException) {
1174
+ try {
1175
+ if (!super.isEmptyDataview())
1176
+ newDisplayLine = mgForm.getPrevLine(newDisplayLine);
1177
+ if (mgForm.isScreenMode())
1178
+ await this.setCurrRecByIdx(newDisplayLine, false, false, true, SET_DISPLAYLINE_BY_DV);
1179
+ else
1180
+ await mgForm.setCurrRowByDisplayLine(newDisplayLine, false, true);
1181
+ }
1182
+ catch (exception) {
1183
+ if (exception instanceof RecordOutOfDataViewException) {
1184
+ this.reset();
1185
+ }
1186
+ else
1187
+ throw exception;
1188
+ }
1189
+ }
1190
+ else
1191
+ throw exception;
1192
+ }
1193
+ }
1194
+ RemoveRecord(record) {
1195
+ let recIdx = this._recordsTab.getRecIdx(record.getId());
1196
+ if (this._topRecIdx > recIdx)
1197
+ this._topRecIdx--;
1198
+ if (this._oldTopRecIdx > recIdx)
1199
+ this._oldTopRecIdx--;
1200
+ if (this._currRecIdx > recIdx)
1201
+ this._currRecIdx--;
1202
+ this._recordsTab.removeRecord(record);
1203
+ }
1204
+ async MoveToEmptyDataviewIfAllowed() {
1205
+ if (!super.isEmptyDataview() && this._task.getMode() !== Constants.TASK_MODE_CREATE) {
1206
+ if (await this._task.checkProp(PropInterface.PROP_TYPE_ALLOW_EMPTY_DATAVIEW, true))
1207
+ super.setEmptyDataview(true);
1208
+ }
1209
+ else {
1210
+ if (this._task.getMode() === Constants.TASK_MODE_CREATE && super.isEmptyDataview())
1211
+ super.setEmptyDataview(false);
1212
+ }
1213
+ }
1214
+ calcLineToMove(onDelete) {
1215
+ let newDisplayLine;
1216
+ if (onDelete)
1217
+ newDisplayLine = this._currRecIdx;
1218
+ else {
1219
+ if (this._currRecIdx > 0)
1220
+ newDisplayLine = this._currRecIdx - 1;
1221
+ else
1222
+ newDisplayLine = this._currRecIdx;
1223
+ }
1224
+ return newDisplayLine;
1225
+ }
1226
+ reset() {
1227
+ this._currRecId = Int32.MinValue;
1228
+ this._currRecIdx = Int32.MinValue;
1229
+ this.CurrRec = null;
1230
+ this.setTopRecIdx(Int32.MinValue);
1231
+ this.SetIncludesFirst(true);
1232
+ this.SetIncludesLast(true);
1233
+ }
1234
+ async cancelEdit(onlyReal, recomputeUnknowns) {
1235
+ let tempCurrRec = null;
1236
+ let recRemoved = false;
1237
+ let inEndTask = this._task.InEndTask;
1238
+ if (inEndTask)
1239
+ onlyReal = true;
1240
+ if (this.CurrRec.getMode() === DataModificationTypes.Insert && this.CurrRec.isNewRec()) {
1241
+ if ((this._includesFirst && this._includesLast && (this._recordsTab === null || this._recordsTab.getSize() === 1)) || !this.HasMainTable) {
1242
+ if (this._original !== null) {
1243
+ this.CurrRec.setSameAs(this._original, onlyReal);
1244
+ }
1245
+ }
1246
+ else {
1247
+ await this.removeCurrRec();
1248
+ recRemoved = true;
1249
+ this._original = this.CurrRec.replicate();
1250
+ }
1251
+ }
1252
+ else {
1253
+ if (!this.CurrRec.Modified) {
1254
+ let currCtrl = this._task.getLastParkedCtrl();
1255
+ if (currCtrl !== null)
1256
+ currCtrl.resetPrevVal();
1257
+ }
1258
+ if (recomputeUnknowns)
1259
+ tempCurrRec = this.CurrRec.replicate();
1260
+ if (this._original !== null)
1261
+ this.CurrRec.setSameAs(this._original, onlyReal);
1262
+ if ((this._original !== null && recomputeUnknowns) && !this.CurrRec.isSameRecData(tempCurrRec, false, false))
1263
+ await this.execUnknownRcmps(this._original);
1264
+ this.takeFldValsFromCurrRec();
1265
+ this._original = this.CurrRec.replicate();
1266
+ }
1267
+ return recRemoved;
1268
+ }
1269
+ isEmpty() {
1270
+ return this._includesFirst && this._includesLast && (this._recordsTab === null || this._recordsTab.getSize() === 0);
1271
+ }
1272
+ async addCurrToModified(setRecToOld) {
1273
+ if (isNullOrUndefined(setRecToOld)) {
1274
+ await this.addCurrToModified_0();
1275
+ return;
1276
+ }
1277
+ await this.addCurrToModified_1(setRecToOld);
1278
+ }
1279
+ async addCurrToModified_0() {
1280
+ await this.addCurrToModified(true);
1281
+ }
1282
+ async addCurrToModified_1(setRecToOld) {
1283
+ this._modifiedRecordsTab.addRecord(this.CurrRec);
1284
+ if (setRecToOld) {
1285
+ this.CurrRec.setOldRec();
1286
+ }
1287
+ let command = CommandFactory.CreateSetTransactionStateDataviewCommand(this.getTask().getTaskTag(), true);
1288
+ await this.getTask().DataviewManager.RemoteDataviewManager.Execute(command);
1289
+ }
1290
+ takeFldValsFromCurrRec() {
1291
+ this._fieldsTab.takeValsFromRec();
1292
+ }
1293
+ currEqualsPrev(fldList) {
1294
+ if (this.CurrRec !== null && this._prevCurrRec !== null) {
1295
+ if (this.CurrRec === this._prevCurrRec)
1296
+ return true;
1297
+ for (let i = 0; i < fldList.length; i = i + 1) {
1298
+ if (!this.CurrRec.fldValsEqual(this._prevCurrRec, fldList[i]))
1299
+ return false;
1300
+ }
1301
+ }
1302
+ else if (this.CurrRec !== this._prevCurrRec)
1303
+ return false;
1304
+ return true;
1305
+ }
1306
+ getTask() {
1307
+ Debug.Assert(this._task instanceof TaskBase);
1308
+ return this._task;
1309
+ }
1310
+ getForm() {
1311
+ return this._task.getForm();
1312
+ }
1313
+ modifiedRecordsNumber() {
1314
+ return this._modifiedRecordsTab.getSize();
1315
+ }
1316
+ getSize() {
1317
+ return this._recordsTab.getSize();
1318
+ }
1319
+ computeByClient() {
1320
+ return this._computeBy === COMPUTE_NEWREC_ON_CLIENT;
1321
+ }
1322
+ recExistsById(id) {
1323
+ return this._recordsTab.getRecord(id) !== null;
1324
+ }
1325
+ ParametersExist(iPos, iLen) {
1326
+ if (arguments.length === 2)
1327
+ return this.ParametersExist_0(iPos, iLen);
1328
+ return this.ParametersExist_1();
1329
+ }
1330
+ ParametersExist_0(iPos, iLen) {
1331
+ for (let i = iPos; i < iPos + iLen; i = i + 1) {
1332
+ if (super.getField(i).isParam())
1333
+ return true;
1334
+ }
1335
+ return false;
1336
+ }
1337
+ ParametersExist_1() {
1338
+ return this.ParametersExist(this._rmIdx, this._rmSize);
1339
+ }
1340
+ recInModifiedTab(id) {
1341
+ let record = this._modifiedRecordsTab.getRecord(id);
1342
+ return record !== null;
1343
+ }
1344
+ setPrevCurrRec(rec) {
1345
+ if (arguments.length === 0) {
1346
+ this.setPrevCurrRec_0();
1347
+ return;
1348
+ }
1349
+ this.setPrevCurrRec_1(rec);
1350
+ }
1351
+ setPrevCurrRec_0() {
1352
+ this._prevCurrRec = this.CurrRec;
1353
+ }
1354
+ setPrevCurrRec_1(rec) {
1355
+ this._prevCurrRec = rec;
1356
+ }
1357
+ isPrevCurrRecNull() {
1358
+ return this._prevCurrRec === null;
1359
+ }
1360
+ async execUnknownRcmps(orgRec) {
1361
+ let i;
1362
+ let from = this._fieldsTab.getRMIdx();
1363
+ let size = this._fieldsTab.getRMSize();
1364
+ let rec = this.getCurrRec();
1365
+ if (this._unknownRcmp === UNKNOWN_RCMPS_NOT_INITED) {
1366
+ for (i = from; i < from + size && this._unknownRcmp === UNKNOWN_RCMPS_NOT_INITED; i++) {
1367
+ let field = this._fieldsTab.getField(i);
1368
+ if (field.IsVirtual && !field.hasInitExp() && field.isServerRcmp())
1369
+ this._unknownRcmp = UNKNOWN_RCMPS_FOUND;
1370
+ }
1371
+ }
1372
+ if (this._unknownRcmp === UNKNOWN_RCMPS_FOUND && rec !== null) {
1373
+ for (i = from; i < from + size; i = i + 1) {
1374
+ let field = this._fieldsTab.getField(i);
1375
+ if (field.IsVirtual && !field.hasInitExp() && field.isServerRcmp() && !rec.fldValsEqual(orgRec, i)) {
1376
+ let fieldValue = rec.GetFieldValue(i);
1377
+ let isNullFld = rec.IsNull(i);
1378
+ rec.setFieldValue(i, orgRec.GetFieldValue(i), false);
1379
+ await field.setValueAndStartRecompute(fieldValue, isNullFld, false, false, false);
1380
+ }
1381
+ }
1382
+ }
1383
+ }
1384
+ setTransCleared() {
1385
+ this._transCleared = true;
1386
+ }
1387
+ async processRecovery() {
1388
+ if (!this._task.isAborting()) {
1389
+ let orgAction = this._pendingRecovery;
1390
+ let orgStopExecution = AccessHelper.eventsManager.GetStopExecutionFlag();
1391
+ this._pendingRecovery = RECOVERY_ACT_NONE;
1392
+ if (orgStopExecution)
1393
+ AccessHelper.eventsManager.setStopExecution(false);
1394
+ let temporaryResetInCtrlPrefix = this._task.InCtrlPrefix;
1395
+ if (temporaryResetInCtrlPrefix)
1396
+ this._task.InCtrlPrefix = false;
1397
+ switch (orgAction) {
1398
+ case RECOVERY_ACT_CANCEL:
1399
+ (this._task.DataView.getCurrRec()).resetUpdated();
1400
+ this.getTask().getTaskCache().clearCache();
1401
+ if (this.getSize() === 1 && this._task.getMode() === Constants.TASK_MODE_CREATE) {
1402
+ this.CurrRec.resetModified();
1403
+ this.CurrRec.clearMode();
1404
+ this.CurrRec.setMode(DataModificationTypes.Insert);
1405
+ this.CurrRec.setNewRec();
1406
+ this._original.setSameAs(this.CurrRec, false);
1407
+ }
1408
+ await AccessHelper.eventsManager.handleInternalEventWithTaskAndEventSubtype(this.getTask(), InternalInterface.MG_ACT_CANCEL, EventSubType.CancelWithNoRollback);
1409
+ break;
1410
+ case RECOVERY_ACT_MOVE_DIRECTION_BEGIN:
1411
+ let lastParkedControl = this._task.getLastParkedCtrl();
1412
+ if (lastParkedControl !== null)
1413
+ await lastParkedControl.invoke();
1414
+ break;
1415
+ case RECOVERY_ACT_BEGIN_SCREEN:
1416
+ this.getTask().setPreventRecordSuffix(true);
1417
+ await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_TBL_BEGPAGE);
1418
+ this.getTask().setPreventRecordSuffix(false);
1419
+ break;
1420
+ case RECOVERY_ACT_BEGIN_TABLE:
1421
+ this._task.ActionManager.enable(InternalInterface.MG_ACT_TBL_BEGTBL, true);
1422
+ await AccessHelper.eventsManager.handleInternalEventWithTask(this._task, InternalInterface.MG_ACT_TBL_BEGTBL);
1423
+ this.getTask().getTaskCache().clearCache();
1424
+ break;
1425
+ default:
1426
+ AccessHelper.eventsManager.setStopExecution(orgStopExecution);
1427
+ break;
1428
+ }
1429
+ if (temporaryResetInCtrlPrefix)
1430
+ this._task.InCtrlPrefix = true;
1431
+ if (orgAction !== RECOVERY_ACT_NONE)
1432
+ AccessHelper.eventsManager.setStopExecution(true, orgAction !== RECOVERY_ACT_BEGIN_TABLE ? ClearEventsOnStopExecution.ALL : ClearEventsOnStopExecution.SERVER);
1433
+ }
1434
+ }
1435
+ replicate() {
1436
+ let rep = new DataView(this);
1437
+ rep._recordsTab = this._recordsTab.replicate();
1438
+ rep._currRecId = rep._recordsTab.getRecByIdx(0).getId();
1439
+ rep._currRecIdx = 0;
1440
+ rep.CurrRec = rep._recordsTab.getRecByIdx(0);
1441
+ rep._prevCurrRec = rep._recordsTab.getRecByIdx(0);
1442
+ rep._original = rep._recordsTab.getRecByIdx(0);
1443
+ rep.setTopRecIdx(Int32.MinValue);
1444
+ return rep;
1445
+ }
1446
+ getDvPosValue() {
1447
+ return this._dvPosValue;
1448
+ }
1449
+ getFirstDv() {
1450
+ return this._firstDv;
1451
+ }
1452
+ ResetFirstDv() {
1453
+ this._firstDv = false;
1454
+ }
1455
+ getCacheLRU() {
1456
+ return this._cacheLruTimeStamp;
1457
+ }
1458
+ setCacheLRU() {
1459
+ this._cacheLruTimeStamp = Misc.getSystemMilliseconds();
1460
+ }
1461
+ async setSameAs(newDv) {
1462
+ this._rmSize = newDv._rmSize;
1463
+ this._rmIdx = newDv._rmIdx;
1464
+ this._computeBy = newDv._computeBy;
1465
+ this._flushUpdates = newDv._flushUpdates;
1466
+ this._currRecId = newDv._currRecId;
1467
+ this._currRecIdx = newDv._currRecIdx;
1468
+ this._topRecId = newDv._topRecId;
1469
+ this.CurrRec = newDv.CurrRec;
1470
+ this._original = newDv._original;
1471
+ this._prevCurrRec = null;
1472
+ this._fieldsTab = newDv._fieldsTab;
1473
+ this._recordsTab = newDv._recordsTab;
1474
+ this._modifiedRecordsTab = newDv._modifiedRecordsTab;
1475
+ this._includesFirst = newDv._includesFirst;
1476
+ this._includesLast = newDv._includesLast;
1477
+ this._insertAt = newDv._insertAt;
1478
+ this._lastCreatedRecId = newDv._lastCreatedRecId;
1479
+ this._task = newDv._task;
1480
+ this._dcValsCollection = newDv._dcValsCollection;
1481
+ this._recovery = newDv._recovery;
1482
+ this._pendingRecovery = newDv._pendingRecovery;
1483
+ this._hasMainTable = newDv._hasMainTable;
1484
+ this._chunkSize = newDv._chunkSize;
1485
+ this._firstDv = newDv._firstDv;
1486
+ this._lastSessionCounter = newDv._lastSessionCounter;
1487
+ this._skipParsing = newDv._skipParsing;
1488
+ this._unknownRcmp = newDv._unknownRcmp;
1489
+ this._transCleared = newDv._transCleared;
1490
+ this._dvPosValue = newDv._dvPosValue;
1491
+ this._cacheLruTimeStamp = newDv._cacheLruTimeStamp;
1492
+ this._changed = newDv._changed;
1493
+ this._locateFirstRec = newDv._locateFirstRec;
1494
+ super.setEmptyDataview(newDv.isEmptyDataview());
1495
+ this._task.setMode(newDv.taskModeFromCache);
1496
+ try {
1497
+ if (this.getTask().HasLoacte()) {
1498
+ await this.setCurrRec(this._locateFirstRec, true);
1499
+ this.setTopRecIdx(this._recordsTab.getRecIdx(this._locateFirstRec));
1500
+ }
1501
+ else {
1502
+ this.getTask().setPreventRecordSuffix(true);
1503
+ await this.setCurrRecByIdx(Int32.MinValue, true, false, true, Int32.MinValue);
1504
+ this.getTask().setPreventRecordSuffix(false);
1505
+ this.setTopRecIdx(0);
1506
+ }
1507
+ if (!this._task.getForm().isScreenMode()) {
1508
+ if (this._task.getForm().isTableWithPagination()) {
1509
+ this.TotalRecordsCount = newDv.TotalRecordsCount;
1510
+ this.RecordsBeforeCurrentView = newDv.RecordsBeforeCurrentView;
1511
+ }
1512
+ await this.setCurrRecByIdx(this._topRecIdx, true, false, true, Int32.MinValue);
1513
+ }
1514
+ if (this._task.getForm() !== null)
1515
+ this._task.getForm().updateDisplayLineByDV();
1516
+ }
1517
+ catch (ex) {
1518
+ if (ex instanceof RecordOutOfDataViewException) {
1519
+ Logger.Instance.WriteDevToLog('wrong top record idx in DataView.setSameAs' + ex.Message);
1520
+ }
1521
+ else
1522
+ throw ex;
1523
+ }
1524
+ }
1525
+ setChanged(val) {
1526
+ this._changed = val;
1527
+ }
1528
+ getChanged() {
1529
+ return this._changed;
1530
+ }
1531
+ getLocateFirstRec() {
1532
+ return this._locateFirstRec;
1533
+ }
1534
+ setLocateFirstRec(newFirst) {
1535
+ this._locateFirstRec = newFirst;
1536
+ }
1537
+ getRecByIdx(idx) {
1538
+ return this._recordsTab.getRecByIdx(idx);
1539
+ }
1540
+ getServerCurrRec() {
1541
+ return this._recordsTab.getServerCurrRec();
1542
+ }
1543
+ zeroServerCurrRec() {
1544
+ this._recordsTab.zeroServerCurrRec();
1545
+ }
1546
+ inRollback() {
1547
+ let inRollback = false;
1548
+ if (this._recovery === ConstInterface.RECOVERY_ROLLBACK && this.getTask().isTransactionOwner()) {
1549
+ inRollback = true;
1550
+ }
1551
+ return inRollback;
1552
+ }
1553
+ getRecIdx(id) {
1554
+ return this._recordsTab.getRecIdx(id);
1555
+ }
1556
+ backupCurrent() {
1557
+ return this.CurrRec.replicate();
1558
+ }
1559
+ restoreCurrent(recBackup) {
1560
+ Debug.Assert(recBackup !== null);
1561
+ this._currRecId = recBackup.getId();
1562
+ this._currRecIdx = this._recordsTab.getRecIdx(this._currRecId);
1563
+ this.CurrRec = this._recordsTab.getRecByIdx(this._currRecIdx);
1564
+ this.CurrRec.setSameAs(recBackup, false);
1565
+ this.takeFldValsFromCurrRec();
1566
+ }
1567
+ GetCurrentRecId() {
1568
+ return this._currRecId;
1569
+ }
1570
+ DataviewBoundriesAreChanged(orgIncludesFirst, orgIncludesLast) {
1571
+ return orgIncludesFirst !== this.IncludesFirst() || orgIncludesLast !== this.IncludesLast();
1572
+ }
1573
+ GetRouteParams() {
1574
+ let params = new List();
1575
+ for (let i = 0; i < this._fieldsTab.getSize(); i++) {
1576
+ let field = this._fieldsTab.getField(i);
1577
+ let val;
1578
+ if (field.IsExposedRouteParam && !field.isNull()) {
1579
+ switch (field.getType()) {
1580
+ case StorageAttribute.ALPHA:
1581
+ case StorageAttribute.UNICODE:
1582
+ {
1583
+ val = field.getDispValue();
1584
+ if (field.isNull())
1585
+ val = field.getNullDisplay();
1586
+ val = val.trim();
1587
+ params.push(val.length === 0 ? ' ' : val);
1588
+ }
1589
+ break;
1590
+ case StorageAttribute.BOOLEAN:
1591
+ {
1592
+ if (field.isNull())
1593
+ params.push(false);
1594
+ else
1595
+ params.push((field.getDispValue()).charAt(0) === '1');
1596
+ }
1597
+ break;
1598
+ case StorageAttribute.NUMERIC: {
1599
+ val = field.getDispValue();
1600
+ if (field.isNull())
1601
+ val = field.getNullDisplay();
1602
+ let pic = new PIC(field.getPicture(), field.getType(), this.getTask().getCompIdx());
1603
+ val = DisplayConvertor.Instance.mg2disp(val, '', pic, true, 0, false);
1604
+ params.push(val);
1605
+ break;
1606
+ }
1607
+ }
1608
+ }
1609
+ }
1610
+ return (params.length > 0) ? params : null;
1611
+ }
1612
+ }
1613
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGF0YVZpZXcuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9lbmdpbmUvc3JjL2RhdGEvRGF0YVZpZXcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLG9CQUFvQixFQUNwQixLQUFLLEVBQ0wsS0FBSyxFQUNMLEtBQUssRUFDTCxpQkFBaUIsRUFDakIsSUFBSSxFQUNKLE9BQU8sRUFFUixNQUFNLHNCQUFzQixDQUFDO0FBQzlCLE9BQU8sRUFDTCxTQUFTLEVBQ1QsaUJBQWlCLEVBQ2pCLE1BQU0sRUFDTixJQUFJLEVBQ0osZ0JBQWdCLEVBQ2hCLFlBQVksRUFDWixTQUF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CkgIT0gbnVsbClcclxuICAgICAgICAgICAgICAvLyB0byB1cGRhdGUgdHJlZSB3ZSBuZWVkIHRvIGxvYWQgbm9kZXMgZmlyc3RcclxuICAgICAgICAgICAgICAgICg8TWdGb3JtPih0aGlzLl90YXNrLmdldEZvcm0oKSkpLnVwZGF0ZURpc3BsYXlMaW5lQnlEVigpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNhdGNoIChleGNlcHRpb24pIHtcclxuICAgICAgICAgICAgICBpZiAoZXhjZXB0aW9uIGluc3RhbmNlb2YgUmVjb3JkT3V0T2ZEYXRhVmlld0V4Y2VwdGlvbikge1xyXG4gICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICB0aHJvdyBleGNlcHRpb247XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIGlmICh0aGlzLl90YXNrLmdldExldmVsKCkgPT09IENvbnN0YW50cy5UQVNLX0xFVkVMX0NPTlRST0wgJiYgdGhpcy5fdGFzay5nZXRMYXN0UGFya2VkQ3RybCgpICE9IG51bGwpXHJcbiAgICAgICAgICAgICAgdGhpcy5fdGFzay5nZXRMYXN0UGFya2VkQ3RybCgpLnJlc2V0UHJldlZhbCgpO1xyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgdGhpcy5zYXZlT3JpZ2luYWwoKTsgLy8gQWZ0ZXIgaW52YWxpZGF0aW9uLCB3ZSBtdXN0IHNhdmUgdGhlIG9yaWdpbmFsIHJlY29yZCB0b29cclxuICAgICAgICAgICg8RmllbGRzVGFibGU+dGhpcy5fZmllbGRzVGFiKS5pbnZhbGlkYXRlKHRydWUsIEZpZWxkQmFzZS5DTEVBUl9GTEFHUyk7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyBRQ1IgIzc2MTg0OCBwcmV2Q3VyclJlYyBzaG91bGQgc2V0IHRoZSBmaXJzdCB0aW1lIHRoZSBkYXRhdmlldyBp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0ludGVyYWN0aXZlKVxyXG4gICAgICAgICAgICAgICAgICBzdG9wRXhlY3V0aW9uID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgdGhpcy5nZXRUYXNrKCkuc2V0QWZ0ZXJSZXRyeShDb25zdEludGVyZmFjZS5SRUNPVkVSWV9ST0xMQkFDSyk7XHJcbiAgICAgICAgICAgICAgICAgIHRoaXMuQ3VyclJlYy5yZXN0YXJ0KHRoaXMuQ3VyclJlYy5nZXRNb2RlKCkpO1xyXG4gICAgICAgICAgICAgICAgICB0aGlzLkN1cnJSZWMucmVzZXRNb2RpZmllZCgpO1xyXG4gICAgICAgICAgICAgICAgICB0aGlzLl9vcmlnaW5hbCA9IHRoaXMuQ3VyclJlYy5yZXBsaWNhdGUoKTtcclxuICAgICAgICAgICAgICAgICAgdGhpcy5fcGVuZGluZ1JlY292ZXJ5ID0gUkVDT1ZFUllfQUNUX0NBTkNFTDtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgZWxzZSBpZiAodHJhbnNCZWdpbiAhPT0gQ29uc3RJbnRlcmZhY2UuVFJBTlNfTk9ORSkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5fdGFzay5zZXRMZXZlbChDb25zdGFudHMuVEFTS19MRVZFTF9UQVNLKTtcclxuICAgICAgICAgICAgICAgIHRoaXMuX3BlbmRpbmdSZWNvdmVyeSA9IFJFQ09WRVJZX0FDVF9CRUdJTl9UQUJMRTtcclxuICAgICAgICAgICAgICAgIHRoaXMuZ2V0VGFzaygpLnNldEFmdGVyUmV0cnkoQ29uc3RJbnRlcmZhY2UuUkVDT1ZFUllfUk9MTEJBQ0spO1xyXG4gICAgICAgICAgICAgICAgLy8gZW5zdXJlIF90YXNrIGNsb3NlIGFjdGlvbiBpcyBzdG9wcGVkICh0YXNrRW5kKVxyXG4gICAgICAgICAgICAgIH1cclxuICAgICAgICAg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gIGJvb2xWYWwgPSBYbWxQYXJzZXIuZ2V0Qm9vbGVhbih2YWx1ZVN0cik7XHJcbiAgICAgICAgICAgIHRoaXMuU2V0SW5jbHVkZXNMYXN0KGJvb2xWYWwpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgIGNhc2UgQ29uc3RJbnRlcmZhY2UuTUdfQVRUUl9JU19PTkVXQVlfS0VZOlxyXG4gICAgICAgICAgICBib29sVmFsID0gWG1sUGFyc2VyLmdldEJvb2xlYW4odmFsdWVTdHIpO1xyXG4gICAgICAgICAgICB0aGlzLlNldE9uZVdheUtleShib29sVmFsKTtcclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICBjYXNlIENvbnN0SW50ZXJmYWNlLk1HX0FUVFJfREJWSUVXU0laRTpcclxuICAgICAgICAgICAgdGhpcy5EQlZpZXdTaXplID0gWG1sUGFyc2VyLmdldEludCh2YWx1ZVN0cik7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgY2FzZSBDb25zdEludGVyZmFjZS5NR19BVFRSX0lOVkFMSURBVEU6IHtcclxuXHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgY2FzZSBDb25zdEludGVyZmFjZS5NR19BVFRSX1RPUF9SRUNfSUQ6XHJcbiAgICAgICAgICAgIHRoaXMuX3RvcFJlY0lkID0gTk51bWJlci5QYXJzZSh2YWx1ZVN0cik7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgY2FzZSBDb25zdEludGVyZmFjZS5NR19BVFRSX1RBU0tNT0RFOlxyXG4gICAgICAgICAgICBpZiAoKDxUYXNrQmFzZT50aGlzLl90YXNrKS5nZXRPcmlnaW5hbFRhc2tNb2RlKCkgPT09IENvbnN0YW50cy5UQVNLX01PREVfTk9ORSB8fCBpbnZhbGlkYXRlKVxyXG4gICAgICAgICAgICAgICg8VGFza0Jhc2U+dGhpcy5fdGFz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ICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgIGNhc2UgU3RvcmFnZUF0dHJpYnV0ZS5OVU1FUklDOiB7XHJcbiAgICAgICAgICAgIHZhbCA9IGZpZWxkLmdldERpc3BWYWx1ZSgpO1xyXG4gICAgICAgICAgICBpZiAoZmllbGQuaXNOdWxsKCkpXHJcbiAgICAgICAgICAgICAgdmFsID0gZmllbGQuZ2V0TnVsbERpc3BsYXkoKTtcclxuICAgICAgICAgICAgbGV0IHBpYzogUElDID0gbmV3IFBJQyhmaWVsZC5nZXRQaWN0dXJlKCksIGZpZWxkLmdldFR5cGUoKSwgdGhpcy5nZXRUYXNrKCkuZ2V0Q29tcElkeCgpKTtcclxuICAgICAgICAgICAgdmFsID0gRGlzcGxheUNvbnZlcnRvci5JbnN0YW5jZS5tZzJkaXNwKHZhbCwgJycsIHBpYywgdHJ1ZSwgMCwgZmFsc2UpO1xyXG4gICAgICAgICAgICBwYXJhbXMucHVzaCh2YWwpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgIH1cclxuICAgIHJldHVybiAocGFyYW1zLmxlbmd0aCA+IDApID8gcGFyYW1zIDogbnVsbDtcclxuICB9XHJcbn1cclxuIl19