@magic-xpa/engine 4.1100.0-dev4110.20 → 4.1100.0-dev4110.202

Sign up to get free protection for your applications and to get access to all the features.
Files changed (515) 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 +409 -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 +157 -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/{esm2020 → esm2022}/src/bridge/MagicBridge.mjs +40 -40
  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 +1181 -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 +882 -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 +2498 -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 +29750 -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 +34 -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 +93 -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/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
  393. package/esm2020/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +0 -60
  394. package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
  395. package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
  396. package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
  397. package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
  398. package/esm2020/src/commands/ClientToServer/EventCommand.mjs +0 -40
  399. package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
  400. package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
  401. package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
  402. package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
  403. package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
  404. package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
  405. package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
  406. package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
  407. package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
  408. package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
  409. package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
  410. package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
  411. package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
  412. package/esm2020/src/commands/ServerToClient/AddRangeCommand.mjs +0 -62
  413. package/esm2020/src/commands/ServerToClient/AddSortCommand.mjs +0 -33
  414. package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
  415. package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
  416. package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
  417. package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
  418. package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
  419. package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
  420. package/esm2020/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +0 -132
  421. package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
  422. package/esm2020/src/data/DataView.mjs +0 -1610
  423. package/esm2020/src/data/DataviewManager.mjs +0 -28
  424. package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
  425. package/esm2020/src/data/DvCache.mjs +0 -67
  426. package/esm2020/src/data/Field.mjs +0 -646
  427. package/esm2020/src/data/FieldBase.mjs +0 -18
  428. package/esm2020/src/data/FieldsTable.mjs +0 -103
  429. package/esm2020/src/data/Key.mjs +0 -88
  430. package/esm2020/src/data/Record.mjs +0 -846
  431. package/esm2020/src/data/RecordsTable.mjs +0 -267
  432. package/esm2020/src/data/TaskTransactionManager.mjs +0 -103
  433. package/esm2020/src/data/XMLBasedDcValuesBuilder.mjs +0 -74
  434. package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
  435. package/esm2020/src/env/Environment.mjs +0 -489
  436. package/esm2020/src/env/LanguageData.mjs +0 -226
  437. package/esm2020/src/env/MirrorString.mjs +0 -65
  438. package/esm2020/src/event/ActionManager.mjs +0 -91
  439. package/esm2020/src/event/Event.mjs +0 -1333
  440. package/esm2020/src/event/EventHandler.mjs +0 -766
  441. package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
  442. package/esm2020/src/event/EventsManager.mjs +0 -2975
  443. package/esm2020/src/event/RunTimeEvent.mjs +0 -392
  444. package/esm2020/src/event/UserEventsTable.mjs +0 -47
  445. package/esm2020/src/exp/ExpTable.mjs +0 -59
  446. package/esm2020/src/exp/Expression.mjs +0 -200
  447. package/esm2020/src/exp/ExpressionDict.mjs +0 -727
  448. package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4212
  449. package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
  450. package/esm2020/src/exp/GlobalParamsTable.mjs +0 -85
  451. package/esm2020/src/exp/YesNoExp.mjs +0 -36
  452. package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
  453. package/esm2020/src/gui/FormsTable.mjs +0 -66
  454. package/esm2020/src/gui/MgControl.mjs +0 -353
  455. package/esm2020/src/gui/MgForm.mjs +0 -1181
  456. package/esm2020/src/http/HttpManager.mjs +0 -97
  457. package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
  458. package/esm2020/src/http/client/HttpClientBase.mjs +0 -132
  459. package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
  460. package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
  461. package/esm2020/src/http/client/HttpUtility.mjs +0 -84
  462. package/esm2020/src/remote/AddUserLocateRemoteDataViewCommand.mjs +0 -18
  463. package/esm2020/src/remote/AddUserRangeRemoteDataViewCommand.mjs +0 -18
  464. package/esm2020/src/remote/AddUserSortRemoteDataViewCommand.mjs +0 -18
  465. package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
  466. package/esm2020/src/remote/RemoteControlItemsRefreshCommand.mjs +0 -25
  467. package/esm2020/src/remote/RemoteDataViewCommandBase.mjs +0 -24
  468. package/esm2020/src/remote/RemoteDataViewCommandFactory.mjs +0 -61
  469. package/esm2020/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +0 -17
  470. package/esm2020/src/remote/ResetUserSortRemoteDataviewCommand.mjs +0 -16
  471. package/esm2020/src/remote/ServerError.mjs +0 -40
  472. package/esm2020/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +0 -20
  473. package/esm2020/src/rt/Argument.mjs +0 -265
  474. package/esm2020/src/rt/ArgumentsList.mjs +0 -103
  475. package/esm2020/src/rt/Boundary.mjs +0 -152
  476. package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
  477. package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
  478. package/esm2020/src/rt/DataviewHeadersSaxHandler.mjs +0 -38
  479. package/esm2020/src/rt/ExecutionStack.mjs +0 -94
  480. package/esm2020/src/rt/HandlersTable.mjs +0 -96
  481. package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
  482. package/esm2020/src/rt/Operation.mjs +0 -735
  483. package/esm2020/src/rt/OperationTable.mjs +0 -67
  484. package/esm2020/src/rt/Recompute.mjs +0 -355
  485. package/esm2020/src/rt/RecomputeTable.mjs +0 -63
  486. package/esm2020/src/rt/RemoteDataviewHeader.mjs +0 -108
  487. package/esm2020/src/rt/ResultValue.mjs +0 -12
  488. package/esm2020/src/rt/TableCache.mjs +0 -177
  489. package/esm2020/src/rt/TableCacheManager.mjs +0 -67
  490. package/esm2020/src/rt/Transaction.mjs +0 -53
  491. package/esm2020/src/security/UserDetails.mjs +0 -71
  492. package/esm2020/src/tasks/MGData.mjs +0 -552
  493. package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
  494. package/esm2020/src/tasks/RCTimer.mjs +0 -63
  495. package/esm2020/src/tasks/RemoteTaskService.mjs +0 -45
  496. package/esm2020/src/tasks/Task.mjs +0 -2495
  497. package/esm2020/src/tasks/TaskBase.mjs +0 -87
  498. package/esm2020/src/tasks/TaskServiceBase.mjs +0 -25
  499. package/esm2020/src/tasks/TasksTable.mjs +0 -80
  500. package/esm2020/src/tasks/sort/Sort.mjs +0 -7
  501. package/esm2020/src/tasks/sort/SortCollection.mjs +0 -67
  502. package/esm2020/src/util/ConstUtils.mjs +0 -14
  503. package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
  504. package/esm2020/src/util/HeapSort.mjs +0 -70
  505. package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
  506. package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
  507. package/esm2020/src/util/PrmMap.mjs +0 -151
  508. package/esm2020/src/util/ReturnResult.mjs +0 -46
  509. package/esm2020/src/util/ReturnResultBase.mjs +0 -18
  510. package/esm2020/src/util/Scrambler.mjs +0 -89
  511. package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
  512. package/esm2020/src/util/cookie.service.mjs +0 -92
  513. package/fesm2015/magic-xpa-engine.mjs +0 -30835
  514. package/fesm2015/magic-xpa-engine.mjs.map +0 -1
  515. package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -0,0 +1,2988 @@
1
+ import { Constants, ForceExit, InternalInterface, Logger, Logger_LogLevels, MgControlType, Misc, MsgInterface, Priority, RaiseAt, StorageAttribute, StrUtil, SubformType } from '@magic-xpa/utils';
2
+ import { ApplicationException, Int32, List, NString, RefParam, Stack, StringBuilder, Thread, isNullOrUndefined } from '@magic-xpa/mscorelib';
3
+ import { Commands, CommandType, DataModificationTypes, ExpVal, FocusManager, GuiConstants, GuiEnvironment, KeyboardItem, Manager, Modifiers, PropInterface, RuntimeContextBase, Styles, TaskDefinitionId } from '@magic-xpa/gui';
4
+ import { EventSubType } from '../enums';
5
+ import { RollbackEventCommand_RollbackType } from '../commands/ClientToServer/RollbackEventCommand';
6
+ import { MgControl } from '../gui/MgControl';
7
+ import { MgPriorityBlockingQueue } from '../util/MgPriorityBlockingQueue';
8
+ import { RunTimeEvent } from './RunTimeEvent';
9
+ import { FlowMonitorQueue } from '../util/FlowMonitorQueue';
10
+ import { GUIManager } from '../GUIManager';
11
+ import { Task } from '../tasks/Task';
12
+ import { Task_SubformExecModeEnum } from '../tasks/TaskBase';
13
+ import { ArgumentsList } from '../rt/ArgumentsList';
14
+ import { MGData } from '../tasks/MGData';
15
+ import { MGDataCollection } from '../tasks/MGDataCollection';
16
+ import { RecordOutOfDataViewException } from '../data/RecordOutOfDataViewException';
17
+ import { CommandsProcessorBase_SendingInstruction } from '../CommandsProcessorBase';
18
+ import { CommandFactory } from '../commands/ClientToServer/CommandFactory';
19
+ import { CommandsProcessorManager } from '../CommandsProcessorManager';
20
+ import { ClientRefreshCommand } from '../commands/ServerToClient/ClientRefreshCommand';
21
+ import { RemoteCommandsProcessor } from '../remote/RemoteCommandsProcessor';
22
+ import { ExecutionStack } from '../rt/ExecutionStack';
23
+ import { EventHandlerPosition } from './EventHandlerPosition';
24
+ import { ConstInterface } from '../ConstInterface';
25
+ import { FlowMonitorInterface } from '../FlowMonitorInterface';
26
+ import { DataViewCommandType } from '../commands/ClientToServer/DataviewCommand';
27
+ import { ServerError } from '../remote/ServerError';
28
+ import { Environment } from '../env/Environment';
29
+ import { LastFocusedManager } from '../rt/LastFocusedManager';
30
+ import { EventsAllowedType } from './IEventsManager';
31
+ import { LanguageData } from '../env/LanguageData';
32
+ import { Subject } from 'rxjs';
33
+ import { ClientManager } from '../ClientManager';
34
+ import { ClearEventsOnStopExecution } from '../AccessHelper';
35
+ var EventScope;
36
+ (function (EventScope) {
37
+ EventScope["NONE"] = " ";
38
+ EventScope["TRANS"] = "T";
39
+ })(EventScope || (EventScope = {}));
40
+ export class EventsManager {
41
+ static REAL_ONLY = true;
42
+ static MAX_OPER = 9999;
43
+ static userGrantedForContextActivity = true;
44
+ _eventsQueue = null;
45
+ _execStack = null;
46
+ _rtEvents = null;
47
+ _serverExecStack = null;
48
+ _allowEvents = EventsAllowedType.ALL;
49
+ _compMainPrgTab = null;
50
+ _currCtrl = null;
51
+ _currField = null;
52
+ _currKbdItem = null;
53
+ _endOfWork = false;
54
+ _eventScope = EventScope.NONE;
55
+ _forceExit = ForceExit.None;
56
+ _forceExitTask = null;
57
+ _ignoreUnknownAbort = false;
58
+ _initialized = false;
59
+ _isHandlingForceExit = false;
60
+ _isNonReversibleExit = false;
61
+ _isInRecordFlushEvent = false;
62
+ static clientInactivityTimerON = false;
63
+ static clientContextInactivityTimerAborted = false;
64
+ lastSavedRouteEvent = null;
65
+ _stopExecution = false;
66
+ _processingTopMostEndTask = false;
67
+ _stopExecutionCtrl = null;
68
+ guiPendingEvent = null;
69
+ KBI_DOWN = null;
70
+ KBI_UP = null;
71
+ confirmationDialogMsg = 'The server context serving this application is about to time out. Do you want to continue your work?';
72
+ confirmationDialogTitle = 'Session is about to be terminated!';
73
+ static Instance = new EventsManager();
74
+ _lastFailedFocusedControl = null;
75
+ isSpinnerShown = false;
76
+ isInViewRefresh = false;
77
+ SpinnerStopped = new Subject();
78
+ static clientBusyTimeStart = 0;
79
+ constructor() {
80
+ this._rtEvents = new Stack();
81
+ this._eventsQueue = new MgPriorityBlockingQueue();
82
+ this._execStack = new Stack();
83
+ this._execStack.push(new ExecutionStack());
84
+ this._serverExecStack = new Stack();
85
+ this._serverExecStack.push(null);
86
+ this.KBI_DOWN = new KeyboardItem(GuiConstants.KEY_DOWN, Modifiers.MODIFIER_NONE);
87
+ this.KBI_UP = new KeyboardItem(GuiConstants.KEY_UP, Modifiers.MODIFIER_NONE);
88
+ }
89
+ getPendingGuiEvent() {
90
+ return this.guiPendingEvent;
91
+ }
92
+ setPendingGuiEvent(guiEvent) {
93
+ this.guiPendingEvent = guiEvent;
94
+ }
95
+ addToTail(rtEvt) {
96
+ if (!rtEvt.isIdleTimer()) {
97
+ if (EventsManager.clientInactivityTimerON) {
98
+ EventsManager.clientContextInactivityTimerAborted = true;
99
+ }
100
+ }
101
+ else {
102
+ if (this.getLastSavedRouteEvent() != null) {
103
+ this.addToTail(this.getLastSavedRouteEvent());
104
+ this.setLastSavedRouteEvent(null);
105
+ }
106
+ }
107
+ this._eventsQueue.put(rtEvt);
108
+ }
109
+ AddKeyboardEvent(mgForm, mgControl, modifier, keyCode, start, end, text, isActChar, suggestedValue, code) {
110
+ let rtEvt = (mgControl !== null) ? new RunTimeEvent(mgControl, true, false) : new RunTimeEvent(mgForm.getTask(), true);
111
+ rtEvt.setInternal(code);
112
+ let newKbItem = new KeyboardItem(keyCode, modifier);
113
+ if (isActChar && (mgControl !== null && (mgControl.isTextControl())))
114
+ newKbItem.setAction(InternalInterface.MG_ACT_CHAR);
115
+ rtEvt.setKeyboardItem(newKbItem);
116
+ if (code === InternalInterface.MG_ACT_CTRL_KEYDOWN) {
117
+ rtEvt.setEditParms(start, end, text);
118
+ }
119
+ else
120
+ rtEvt.setValue(suggestedValue);
121
+ this.addToTail(rtEvt);
122
+ return;
123
+ }
124
+ async checkParkability() {
125
+ let current = LastFocusedManager.getLastFocusedControl();
126
+ if (current !== null && (current.getForm().getTask()).getLevel() === Constants.TASK_LEVEL_CONTROL && !await current.IsParkable())
127
+ await this.HandleNonParkableControls(current.getForm().getTask());
128
+ }
129
+ async HandleParkabilityOnRowChange(itask) {
130
+ await this.HandleNonParkableControls(itask);
131
+ }
132
+ async HandleNonParkableControls(itask) {
133
+ let task = itask;
134
+ if (task.getMode() === Constants.TASK_MODE_CREATE && task.IsInteractive) {
135
+ await task.enableModes();
136
+ let oldMode = task.getOriginalTaskMode();
137
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
138
+ if (!this.GetStopExecutionFlag()) {
139
+ if (oldMode !== Constants.TASK_MODE_CREATE) {
140
+ task.setMode(oldMode);
141
+ await task.DataView.currRecCompute(true);
142
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
143
+ await task.getForm().RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
144
+ task.setLastParkedCtrl(null);
145
+ await FocusManager.SetFocus(task, null, -1, true);
146
+ return;
147
+ }
148
+ }
149
+ }
150
+ if (task.getLevel() === Constants.TASK_LEVEL_CONTROL)
151
+ await this.handleInternalEventWithMgControlBase(task.getLastParkedCtrl(), InternalInterface.MG_ACT_CTRL_SUFFIX);
152
+ task.setLastParkedCtrl(null);
153
+ MgControl.ReturnToCtrl = null;
154
+ await FocusManager.SetFocus(task, null, -1, true);
155
+ }
156
+ async handleEvent(rtEvt, returnedFromServer) {
157
+ let handler = null;
158
+ let pos = new EventHandlerPosition();
159
+ let task = rtEvt.getTask();
160
+ let ctrl = task.getLastParkedCtrl();
161
+ let forceExitDone = false;
162
+ let endTaskError = false;
163
+ let oldRtEvt = null;
164
+ let oldForceExit = this.getForceExit();
165
+ let oldForceExitTask = this.getForceExitTask();
166
+ let oldIsHandlingForceExit = this._isHandlingForceExit;
167
+ let restoreIsForceExit = false;
168
+ let restoreCurrCtrl;
169
+ let restoreCurrField = null;
170
+ if ((rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL)) {
171
+ if (rtEvt.InternalEvent < InternalInterface.MG_ACT_TOT_CNT && (!task.ActionManager.isEnabled(rtEvt.InternalEvent) || (!rtEvt.isImmediate() && this.NoEventsAllowed())))
172
+ return;
173
+ }
174
+ else if (!rtEvt.isImmediate() && this.NoEventsAllowed())
175
+ return;
176
+ restoreCurrCtrl = this._currCtrl;
177
+ this._currCtrl = ctrl;
178
+ let propagate = rtEvt.getType() !== ConstInterface.EVENT_TYPE_INTERNAL || rtEvt.getInternalCode() < 1000;
179
+ try {
180
+ this.pushRtEvent(rtEvt);
181
+ await this.CheckAndShowSpinner(true);
182
+ let bRcBefore = await this.commonHandlerBefore(rtEvt);
183
+ restoreCurrField = this._currField;
184
+ this._currField = task.getCurrField();
185
+ if (bRcBefore) {
186
+ pos.init(rtEvt);
187
+ handler = pos.getNext();
188
+ if (handler !== null && handler.getEvent() !== null && handler.getEvent().UserEvt !== null)
189
+ this.setForceExit(handler.getEvent().UserEvt.ForceExit, task);
190
+ while (handler !== null) {
191
+ let handlerContextTask = null;
192
+ let rtEvtChanged;
193
+ try {
194
+ let enabledCndCheckedAndTrue = false;
195
+ handlerContextTask = handler.getTask().GetContextTask();
196
+ if (rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && rtEvt.getInternalCode() >= 1000 && rtEvt.getInternalCode() !== InternalInterface.MG_ACT_VARIABLE)
197
+ handler.getTask().SetContextTask(handler.getTask());
198
+ else
199
+ handler.getTask().SetContextTask(rtEvt.getTask());
200
+ if (handler.getEvent().getType() === ConstInterface.EVENT_TYPE_USER && await handler.isEnabled()) {
201
+ enabledCndCheckedAndTrue = true;
202
+ this._isHandlingForceExit = false;
203
+ restoreIsForceExit = true;
204
+ if (await this.handleForceExitBefore(handler.getEvent(), rtEvt)) {
205
+ forceExitDone = true;
206
+ }
207
+ }
208
+ if (rtEvt !== handler.getEvent()) {
209
+ oldRtEvt = rtEvt;
210
+ rtEvt = new RunTimeEvent(handler.getEvent(), rtEvt);
211
+ rtEvtChanged = true;
212
+ this.popRtEvent();
213
+ this.pushRtEvent(rtEvt);
214
+ }
215
+ else
216
+ rtEvtChanged = false;
217
+ if (rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && rtEvt.getInternalCode() === InternalInterface.MG_ACT_REC_SUFFIX)
218
+ rtEvt.getTask().setInRecordSuffix(true);
219
+ this.createEventArguments(rtEvt);
220
+ let handlerRetVals = await handler.execute(rtEvt, returnedFromServer, enabledCndCheckedAndTrue);
221
+ if (rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && rtEvt.getInternalCode() === InternalInterface.MG_ACT_REC_SUFFIX)
222
+ rtEvt.getTask().setInRecordSuffix(false);
223
+ propagate = handlerRetVals.Propagate;
224
+ if (!handlerRetVals.Enabled && rtEvtChanged) {
225
+ rtEvt = oldRtEvt;
226
+ oldRtEvt = null;
227
+ rtEvtChanged = false;
228
+ this.popRtEvent();
229
+ this.pushRtEvent(rtEvt);
230
+ }
231
+ if (rtEvt.getInternalCode() !== InternalInterface.MG_ACT_TASK_PREFIX && task.isStarted() && task.getExecEndTask()) {
232
+ endTaskError = await task.endTask(true, false, false);
233
+ if (endTaskError)
234
+ break;
235
+ }
236
+ if (this.GetStopExecutionFlag()) {
237
+ if (await this.handleStopExecution(rtEvt))
238
+ break;
239
+ }
240
+ }
241
+ finally {
242
+ handler.getTask().SetContextTask(handlerContextTask);
243
+ }
244
+ if (!propagate)
245
+ break;
246
+ if (rtEvtChanged)
247
+ handler = pos.getNext(rtEvt);
248
+ else
249
+ handler = pos.getNext();
250
+ if (handler !== null)
251
+ FlowMonitorQueue.Instance.addTaskEvent(rtEvt.getBrkLevel(true), FlowMonitorInterface.FLWMTR_PROPAGATE, task.GetTaskDetails());
252
+ }
253
+ if (propagate && !endTaskError)
254
+ await this.commonHandler(rtEvt);
255
+ }
256
+ if (!endTaskError) {
257
+ await this.commonHandlerAfter(rtEvt, bRcBefore);
258
+ }
259
+ if (forceExitDone && this._isHandlingForceExit) {
260
+ this._isHandlingForceExit = false;
261
+ await this.handleForceExitAfter(rtEvt);
262
+ }
263
+ this.setForceExit(oldForceExit, oldForceExitTask);
264
+ if (restoreIsForceExit)
265
+ this._isHandlingForceExit = oldIsHandlingForceExit;
266
+ }
267
+ finally {
268
+ this._currCtrl = restoreCurrCtrl;
269
+ this._currField = restoreCurrField;
270
+ this.popRtEvent();
271
+ }
272
+ GUIManager.Instance.execGuiCommandQueue();
273
+ }
274
+ async simulateSelection(ctrl, val, line, produceClick) {
275
+ let mgControl = ctrl;
276
+ let currTask = mgControl.getForm().getTask();
277
+ let cancelWasRaised = currTask.cancelWasRaised();
278
+ if (mgControl.Type === MgControlType.CTRL_TYPE_BUTTON) {
279
+ let aRtEvt = new RunTimeEvent(mgControl);
280
+ let raiseAt = (await (mgControl.getProp(PropInterface.PROP_TYPE_RAISE_AT)).getValueInt());
281
+ if (aRtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && (aRtEvt.InternalEvent === InternalInterface.MG_ACT_CANCEL || aRtEvt.InternalEvent === InternalInterface.MG_ACT_RT_QUIT)) {
282
+ if (raiseAt === RaiseAt.TaskInFocus)
283
+ currTask = LastFocusedManager.Instance.getLastFocusedTask();
284
+ cancelWasRaised = currTask.cancelWasRaised();
285
+ currTask.setCancelWasRaised(true);
286
+ }
287
+ if (raiseAt === RaiseAt.TaskInFocus)
288
+ mgControl.setRtEvtTask(LastFocusedManager.Instance.getLastFocusedTask());
289
+ }
290
+ await this.handleFocus(mgControl, line, produceClick, false);
291
+ currTask.setCancelWasRaised(cancelWasRaised);
292
+ if (this._stopExecution)
293
+ return;
294
+ let controlIsParkable = await mgControl.IsParkable();
295
+ if (mgControl.Type !== MgControlType.CTRL_TYPE_BUTTON || (mgControl.getField() === null || controlIsParkable)) {
296
+ if (mgControl.Type === MgControlType.CTRL_TYPE_BUTTON && !controlIsParkable) {
297
+ let subformTask = mgControl.getForm().getTask();
298
+ if (subformTask.IsSubForm) {
299
+ currTask = LastFocusedManager.Instance.getLastFocusedTask();
300
+ if (subformTask !== currTask && subformTask.pathContains(currTask)) {
301
+ if (subformTask.getLevel() === Constants.TASK_LEVEL_TASK) {
302
+ await this.handleInternalEventWithTask(subformTask, InternalInterface.MG_ACT_REC_PREFIX);
303
+ }
304
+ await this.HandleNonParkableControls(subformTask);
305
+ }
306
+ }
307
+ }
308
+ let rtEvt = new RunTimeEvent(mgControl);
309
+ RuntimeContextBase.Instance.CurrentClickedCtrl = mgControl;
310
+ rtEvt.setInternal(InternalInterface.MG_ACT_CTRL_HIT);
311
+ await this.handleEvent(rtEvt, false);
312
+ if (this._stopExecution)
313
+ return;
314
+ }
315
+ if (mgControl.Type !== MgControlType.CTRL_TYPE_BUTTON)
316
+ await this.handleSelection(mgControl, line, val);
317
+ if (this._stopExecution)
318
+ return;
319
+ await this.handleMouseUp(mgControl, line, produceClick);
320
+ }
321
+ async handleInternalEventWithTask(itask, eventCode) {
322
+ await this.handleInternalEventWithTaskAndSubformRefresh(itask, eventCode, false);
323
+ }
324
+ async handleInternalEventWithTaskAndSubformRefresh(itask, eventCode, subformRefresh) {
325
+ let task = itask;
326
+ if (eventCode === InternalInterface.MG_ACT_REC_PREFIX && task.IsSubForm && task.SubformExecMode !== Task_SubformExecModeEnum.FIRST_TIME) {
327
+ task.SubformExecMode = (subformRefresh ? Task_SubformExecModeEnum.REFRESH : Task_SubformExecModeEnum.SET_FOCUS);
328
+ }
329
+ if (subformRefresh)
330
+ await this.handleInternalEventWithTask(itask, InternalInterface.MG_ACT_POST_REFRESH_BY_PARENT);
331
+ if (task.DataView.isEmptyDataview()) {
332
+ if (eventCode === InternalInterface.MG_ACT_REC_PREFIX || eventCode === InternalInterface.MG_ACT_REC_SUFFIX) {
333
+ if (eventCode === InternalInterface.MG_ACT_REC_PREFIX)
334
+ await task.emptyDataviewOpen(subformRefresh);
335
+ else
336
+ task.emptyDataviewClose();
337
+ if (task.getForm() !== null) {
338
+ if (eventCode === InternalInterface.MG_ACT_REC_PREFIX)
339
+ await task.getForm().RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
340
+ task.getForm().SelectRow();
341
+ }
342
+ }
343
+ else
344
+ await this.handleInternalEventWithTaskAndEventSubtype(task, eventCode, EventSubType.Normal);
345
+ }
346
+ else
347
+ await this.handleInternalEventWithTaskAndEventSubtype(task, eventCode, EventSubType.Normal);
348
+ }
349
+ async handleInternalEventWithMgControlBase(ctrl, eventCode) {
350
+ await this.handleInternalEventWithMgControl(ctrl, eventCode, EventSubType.Normal);
351
+ }
352
+ GetStopExecutionFlag() {
353
+ return this._stopExecution;
354
+ }
355
+ getStopExecutionCtrl() {
356
+ return this._stopExecutionCtrl;
357
+ }
358
+ Init() {
359
+ if (this._initialized) {
360
+ this._isHandlingForceExit = false;
361
+ this._forceExit = ForceExit.None;
362
+ this._forceExitTask = null;
363
+ this._currField = null;
364
+ this.setEndOfWork(true);
365
+ }
366
+ this._initialized = true;
367
+ }
368
+ addInternalEventWithItaskAndCode(itask, code) {
369
+ this.addGuiTriggeredEventWithTaskAndCodeAndOnMultiMark(itask, code);
370
+ }
371
+ addInternalEventWithCtrlAndCode(ctrl, code) {
372
+ let rtEvt = new RunTimeEvent(ctrl);
373
+ rtEvt.setInternal(code);
374
+ this.addToTail(rtEvt);
375
+ }
376
+ addInternalEventWithCtrlAndDisplayLineAndCode(ctrl, DisplayLine, code) {
377
+ let rtEvt = new RunTimeEvent(ctrl, DisplayLine, false);
378
+ rtEvt.setInternal(code);
379
+ this.addToTail(rtEvt);
380
+ }
381
+ addInternalEventWithCtrlAndCodeAndPriority(ctrl, code, priority) {
382
+ let rtEvt = new RunTimeEvent(ctrl);
383
+ rtEvt.setInternal(code);
384
+ rtEvt.setPriority(priority);
385
+ this.addToTail(rtEvt);
386
+ }
387
+ addGuiTriggeredEventWithTaskAndCodeAndOnMultiMark(itask, code) {
388
+ let task = itask;
389
+ let rtEvt = new RunTimeEvent(task);
390
+ rtEvt.setInternal(code);
391
+ this.addToTail(rtEvt);
392
+ }
393
+ addGuiTriggeredEventWithCtrlAndCodeAndLineAndModifier(ctrl, code, line) {
394
+ let rtEvt = new RunTimeEvent(ctrl, line, false);
395
+ rtEvt.setInternal(code);
396
+ this.addToTail(rtEvt);
397
+ }
398
+ addGuiTriggeredEventWithTaskAndCodeAndLine(task, code, line) {
399
+ let tsk = null;
400
+ if (task !== null)
401
+ tsk = task;
402
+ let rtEvt = new RunTimeEvent(tsk);
403
+ rtEvt.setInternal(code);
404
+ rtEvt.DisplayLine = line;
405
+ this.addToTail(rtEvt);
406
+ }
407
+ AddColumnClickEvent(columnCtrl, direction, columnHeader) {
408
+ let rtEvt = new RunTimeEvent(columnCtrl, direction, 0);
409
+ rtEvt.setInternal(InternalInterface.MG_ACT_COL_CLICK);
410
+ let argsList = new Array();
411
+ argsList[0] = new ExpVal(StorageAttribute.UNICODE, false, columnHeader);
412
+ let args = new ArgumentsList(argsList);
413
+ rtEvt.setArgList(args);
414
+ this.addToTail(rtEvt);
415
+ }
416
+ AddRouteEvent(task, code, routerpath, routerOutletName, routeParams) {
417
+ let rtEvt = new RunTimeEvent(task, true);
418
+ rtEvt.setInternal(code);
419
+ let argsList = new Array(2);
420
+ argsList[0] = new ExpVal(StorageAttribute.ALPHA, false, routerpath);
421
+ if (routerOutletName === null)
422
+ routerOutletName = '';
423
+ argsList[1] = new ExpVal(StorageAttribute.ALPHA, false, routerOutletName);
424
+ let args = new ArgumentsList(argsList);
425
+ rtEvt.setArgList(args);
426
+ rtEvt.setRouteParamList(routeParams);
427
+ this.addToTail(rtEvt);
428
+ }
429
+ AddRouterClosedEvent(task) {
430
+ let subFormControl = task.getForm().getSubFormCtrl();
431
+ let rtEvt = new RunTimeEvent(subFormControl.getForm().getTask(), true);
432
+ rtEvt.setInternal(InternalInterface.MG_ACT_SUBFORM_CLOSE);
433
+ let argsList = new Array(1);
434
+ argsList[0] = new ExpVal(StorageAttribute.ALPHA, false, subFormControl.getName());
435
+ let args = new ArgumentsList(argsList);
436
+ rtEvt.setArgList(args);
437
+ EventsManager.Instance.addToTail(rtEvt);
438
+ }
439
+ AddLastSavedRouteEvent(srcTask, args) {
440
+ let rtEvt = new RunTimeEvent(LastFocusedManager.Instance.getLastFocusedTask(), true);
441
+ rtEvt.setInternal(InternalInterface.MG_ACT_WEBCLIENT_ROUTE);
442
+ if (srcTask != null) {
443
+ rtEvt.setTask(srcTask);
444
+ if (args != null) {
445
+ rtEvt.setArgList(args);
446
+ }
447
+ this.setLastSavedRouteEvent(rtEvt);
448
+ }
449
+ }
450
+ AddExternalValueEvent(ctrl, value, refreshDisplay) {
451
+ let rtEvt = new RunTimeEvent(ctrl, 0, true);
452
+ rtEvt.setInternal(InternalInterface.MG_ACT_SET_EXTERNAL_VALUE);
453
+ rtEvt.setValue(value);
454
+ let argsList = new Array(1);
455
+ argsList[0] = new ExpVal(StorageAttribute.BOOLEAN, false, refreshDisplay ? '1' : '0');
456
+ let args = new ArgumentsList(argsList);
457
+ rtEvt.setArgList(args);
458
+ this.addToTail(rtEvt);
459
+ }
460
+ addGuiTriggeredEventWithCtrlAndCodeAndLine(ctrl, code, line) {
461
+ let rtEvt = new RunTimeEvent(ctrl, line, true);
462
+ rtEvt.setInternal(code);
463
+ this.addToTail(rtEvt);
464
+ }
465
+ addGuiTriggeredEventWithCtrlAndLineAndCodeAndIsProductClick(ctrl, code, line, isProduceClick) {
466
+ let rtEvt = new RunTimeEvent(ctrl, line, true);
467
+ rtEvt.setInternal(code);
468
+ rtEvt.setProduceClick(isProduceClick);
469
+ this.addToTail(rtEvt);
470
+ }
471
+ addGuiTriggeredEventWithCtrlAndCodeAndList(ctrl, code, list) {
472
+ let rtEvt = new RunTimeEvent(ctrl, list, true);
473
+ rtEvt.setInternal(code);
474
+ this.addToTail(rtEvt);
475
+ }
476
+ addGuiTriggeredEventWithTaskAndCode(task, code) {
477
+ let rtEvt = new RunTimeEvent(task, true);
478
+ rtEvt.setInternal(code);
479
+ this.addToTail(rtEvt);
480
+ }
481
+ addGuiTriggeredEventTaskAndCodeAndRaisedBy(task, code) {
482
+ this.addGuiTriggeredEventWithTaskAndCode(task, code);
483
+ }
484
+ getEvent() {
485
+ return this._eventsQueue.poll();
486
+ }
487
+ getForceExit() {
488
+ return this._forceExit;
489
+ }
490
+ setForceExit(forceExit, task) {
491
+ this._forceExit = forceExit;
492
+ this.setForceExitTask(task);
493
+ }
494
+ getForceExitTask() {
495
+ return this._forceExitTask;
496
+ }
497
+ setForceExitTask(task) {
498
+ this._forceExitTask = task;
499
+ }
500
+ isForceExitPreRecordUpdate(task) {
501
+ return this._isHandlingForceExit && this.getForceExit() === ForceExit.PreRecordUpdate && task === this.getForceExitTask();
502
+ }
503
+ async ExecuteClientContextInactivityTimer() {
504
+ let startTime = Misc.getSystemMilliseconds();
505
+ let clientCtxInactivityTimeout = Environment.Instance.getClientContextInactivityTimeout() * 100;
506
+ EventsManager.clientInactivityTimerON = true;
507
+ while (EventsManager.clientInactivityTimerON) {
508
+ await Thread.Sleep(1000);
509
+ var timeLapsed = Misc.getSystemMilliseconds() - startTime;
510
+ if (EventsManager.clientContextInactivityTimerAborted || timeLapsed >= clientCtxInactivityTimeout) {
511
+ EventsManager.clientInactivityTimerON = false;
512
+ }
513
+ }
514
+ }
515
+ async CheckAndShowSpinner(show) {
516
+ let sendCommand = false;
517
+ if (this.getLastRtEvent() !== null && this.getLastRtEvent().getPriority() === Priority.LOWEST)
518
+ show = false;
519
+ if (show != this.isSpinnerShown) {
520
+ if (show) {
521
+ if (Misc.getSystemMilliseconds() - this.GetEventTime() > 1000) {
522
+ sendCommand = true;
523
+ EventsManager.clientBusyTimeStart = Misc.getSystemMilliseconds();
524
+ }
525
+ }
526
+ else
527
+ sendCommand = true;
528
+ if (sendCommand) {
529
+ Commands.addShowSpinner(show);
530
+ Commands.beginInvoke();
531
+ await Thread.Sleep(50);
532
+ this.isSpinnerShown = show;
533
+ if (!this.isSpinnerShown) {
534
+ let totalClientBusyTime = Misc.getSystemMilliseconds() - EventsManager.clientBusyTimeStart;
535
+ this.SpinnerStopped.next(totalClientBusyTime);
536
+ EventsManager.clientBusyTimeStart = 0;
537
+ }
538
+ }
539
+ }
540
+ }
541
+ async EventsLoop(mgData) {
542
+ let savedAllowEvents = this.getAllowEvents();
543
+ this.setAllowEvents(EventsAllowedType.ALL);
544
+ this.pushNewExecStacks();
545
+ while (!mgData.IsAborting) {
546
+ await this.CheckAndShowSpinner(false);
547
+ await this._eventsQueue.waitForElement();
548
+ await this.handleEvents(mgData, 0);
549
+ if (!mgData.IsAborting)
550
+ await this.checkParkability();
551
+ }
552
+ this.popNewExecStacks();
553
+ this.setAllowEvents(savedAllowEvents);
554
+ }
555
+ async NonInteractiveEventsLoop(mgData, taskBase) {
556
+ let task = taskBase;
557
+ let savedAllowEvents = this.getAllowEvents();
558
+ this.setNonInteractiveAllowEvents(await task.isAllowEvents());
559
+ this.pushNewExecStacks();
560
+ while (!mgData.IsAborting) {
561
+ if (task.getMode() === Constants.TASK_MODE_DELETE)
562
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_CYCLE_NEXT_DELETE_REC);
563
+ else
564
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_CYCLE_NEXT_REC);
565
+ await Thread.Sleep(10);
566
+ if (!mgData.IsAborting && await task.isAllowEvents())
567
+ await this.handleEvents(mgData, 1);
568
+ }
569
+ this.popNewExecStacks();
570
+ this.setAllowEvents(savedAllowEvents);
571
+ }
572
+ async handleEvents(baseMgDataOrHandlersTab, eventsToHandleCntOrRtEvt) {
573
+ if ((baseMgDataOrHandlersTab === null || baseMgDataOrHandlersTab instanceof MGData) && (eventsToHandleCntOrRtEvt === null || eventsToHandleCntOrRtEvt.constructor === Number)) {
574
+ await this.handleEvents_0(baseMgDataOrHandlersTab, eventsToHandleCntOrRtEvt);
575
+ return;
576
+ }
577
+ await this.handleEvents_1(baseMgDataOrHandlersTab, eventsToHandleCntOrRtEvt);
578
+ }
579
+ async handleEvents_0(baseMgData, eventsToHandleCnt) {
580
+ let task = null;
581
+ let delta = 0;
582
+ let eventsPolledCnt = 0;
583
+ this.setStopExecution(false);
584
+ while (!this._eventsQueue.isEmpty() && !this._stopExecution && (eventsToHandleCnt === 0 || eventsPolledCnt < eventsToHandleCnt)) {
585
+ let rtEvt = this.getEvent();
586
+ if (rtEvt !== null && rtEvt.isGuiTriggeredEvent()) {
587
+ delta = Misc.getSystemMilliseconds();
588
+ this._currKbdItem = null;
589
+ let blockedByModalWindow = rtEvt.isBlockedByModalWindow(baseMgData);
590
+ if (blockedByModalWindow && rtEvt.getInternalCode() !== InternalInterface.MG_ACT_TIMER) {
591
+ continue;
592
+ }
593
+ if (!rtEvt.isIdleTimer() && !blockedByModalWindow && rtEvt.getInternalCode() !== InternalInterface.MG_ACT_ENABLE_EVENTS && rtEvt.getInternalCode() !== InternalInterface.MG_ACT_DISABLE_EVENTS && rtEvt.getTask() !== null && !rtEvt.getTask().getMGData().IsAborting) {
594
+ MGDataCollection.Instance.currMgdID = rtEvt.getTask().getMGData().GetId();
595
+ }
596
+ }
597
+ let currMgd = MGDataCollection.Instance.getCurrMGData();
598
+ if (currMgd !== null) {
599
+ while (currMgd !== null && currMgd.IsAborting) {
600
+ currMgd = currMgd.getParentMGdata();
601
+ if (currMgd !== null)
602
+ MGDataCollection.Instance.currMgdID = MGDataCollection.Instance.getMgDataIdx(currMgd);
603
+ }
604
+ }
605
+ else {
606
+ task = rtEvt.getTask();
607
+ while (currMgd === null && task !== null && task.getParent() !== null) {
608
+ task = task.getParent();
609
+ currMgd = task.getMGData();
610
+ if (currMgd.IsAborting)
611
+ currMgd = null;
612
+ if (currMgd !== null)
613
+ MGDataCollection.Instance.currMgdID = MGDataCollection.Instance.getMgDataIdx(currMgd);
614
+ }
615
+ }
616
+ if (currMgd === null)
617
+ break;
618
+ if (rtEvt.getTask() === null) {
619
+ task = LastFocusedManager.Instance.getLastFocusedTask();
620
+ while (task !== null && (task.isAborting() || task.InEndTask))
621
+ task = task.getParent();
622
+ if (task !== null) {
623
+ rtEvt.setCtrl(task.getLastParkedCtrl());
624
+ rtEvt.setTask(task);
625
+ }
626
+ }
627
+ else
628
+ task = rtEvt.getTask();
629
+ if (task !== null) {
630
+ await this.handleEvent(rtEvt, false);
631
+ }
632
+ GUIManager.Instance.execGuiCommandQueue();
633
+ this._currCtrl = null;
634
+ if (task !== null)
635
+ await Task.CommandsProcessor.SendMonitorOnly();
636
+ else {
637
+ await Task.CommandsProcessor.SendMonitorOnly();
638
+ }
639
+ if (rtEvt !== null && rtEvt.isGuiTriggeredEvent()) {
640
+ if (delta > 0) {
641
+ delta = Misc.getSystemMilliseconds() - delta;
642
+ }
643
+ }
644
+ if (eventsToHandleCnt > 0 && rtEvt !== null && rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && rtEvt.InternalEvent < InternalInterface.MG_ACT_TOT_CNT)
645
+ eventsPolledCnt++;
646
+ }
647
+ }
648
+ async handleStopExecution(rtEvt) {
649
+ let stop = false;
650
+ if (!this.GetStopExecutionFlag())
651
+ return stop;
652
+ let task = rtEvt.getTask();
653
+ let currCtrl = rtEvt.Control;
654
+ let lastParkedCtrl = LastFocusedManager.getLastFocusedControl();
655
+ let endTaskDueToVerifyError = false;
656
+ if (rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL) {
657
+ switch (rtEvt.getInternalCode()) {
658
+ case InternalInterface.MG_ACT_TASK_PREFIX:
659
+ endTaskDueToVerifyError = true;
660
+ break;
661
+ case InternalInterface.MG_ACT_REC_PREFIX:
662
+ endTaskDueToVerifyError = true;
663
+ break;
664
+ case InternalInterface.MG_ACT_REC_SUFFIX:
665
+ this.setStopExecutionCtrl(null);
666
+ this.setStopExecutionCtrl(task.getLastParkedCtrl());
667
+ break;
668
+ case InternalInterface.MG_ACT_CTRL_PREFIX:
669
+ this.setStopExecution(false);
670
+ task.InCtrlPrefix = false;
671
+ if (lastParkedCtrl === null) {
672
+ task.setCurrField(null);
673
+ this.setStopExecutionCtrl(null);
674
+ this.setStopExecutionCtrl(currCtrl);
675
+ await this.HandleNonParkableControls(task);
676
+ }
677
+ else {
678
+ task.setCurrField(lastParkedCtrl.getField());
679
+ await FocusManager.SetFocus(lastParkedCtrl, -1);
680
+ }
681
+ this.setStopExecution(true);
682
+ break;
683
+ case InternalInterface.MG_ACT_CTRL_SUFFIX:
684
+ currCtrl.setInControlSuffix(false);
685
+ break;
686
+ }
687
+ if (endTaskDueToVerifyError) {
688
+ await task.endTask(true, false, true);
689
+ stop = true;
690
+ }
691
+ }
692
+ return stop;
693
+ }
694
+ async handleForceExitBefore(evt, rtEvt) {
695
+ let forceExit = evt.UserEvt.ForceExit;
696
+ let isNewRec = false;
697
+ let oldIdx = 0;
698
+ if (forceExit === ForceExit.None || rtEvt.isImmediate())
699
+ return false;
700
+ this._isHandlingForceExit = true;
701
+ let task = rtEvt.getTask();
702
+ let oldRec = task.DataView.getCurrRec();
703
+ if (oldRec !== null && oldRec.getMode() === DataModificationTypes.Insert && oldRec.isNewRec()) {
704
+ isNewRec = true;
705
+ oldIdx = oldRec.getId();
706
+ }
707
+ if (forceExit !== ForceExit.Editing && task.getLevel() === Constants.TASK_LEVEL_CONTROL) {
708
+ let ctrl = task.getLastParkedCtrl();
709
+ if (ctrl !== null)
710
+ await this.handleInternalEventWithMgControlBase(ctrl, InternalInterface.MG_ACT_CTRL_SUFFIX);
711
+ }
712
+ if ((forceExit === ForceExit.PreRecordUpdate || forceExit === ForceExit.PostRecordUpdate) && task.getLevel() === Constants.TASK_LEVEL_RECORD) {
713
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
714
+ if (task.getMode() === Constants.TASK_MODE_CREATE && !this._stopExecution)
715
+ task.setMode(Constants.TASK_MODE_MODIFY);
716
+ let currRec = task.DataView.getCurrRec();
717
+ if (currRec !== null && this._stopExecution && isNewRec && oldIdx === currRec.getId() && task.getMode() === Constants.TASK_MODE_CREATE) {
718
+ currRec.clearMode();
719
+ currRec.restart(DataModificationTypes.Insert);
720
+ }
721
+ }
722
+ if (forceExit === ForceExit.PostRecordUpdate && !this._stopExecution) {
723
+ if (task.getLevel() === Constants.TASK_LEVEL_TASK)
724
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
725
+ }
726
+ if (forceExit === ForceExit.Editing) {
727
+ let evtCtrl = rtEvt.Control;
728
+ if (evtCtrl !== null && evtCtrl.getField() !== null) {
729
+ let ctrlVal = Manager.GetCtrlVal(evtCtrl);
730
+ await evtCtrl.validateAndSetValue(ctrlVal, true);
731
+ }
732
+ }
733
+ return true;
734
+ }
735
+ async handleForceExitAfter(rtEvt) {
736
+ let forceExit = rtEvt.UserEvt.ForceExit;
737
+ let task = rtEvt.getTask();
738
+ if (forceExit === ForceExit.PreRecordUpdate) {
739
+ await this.commitRecord(task, true);
740
+ if (!task.transactionFailed(ConstInterface.TRANS_RECORD_PREFIX) && !task.isAborting()) {
741
+ if (await task.evalEndCond(ConstInterface.END_COND_EVAL_AFTER))
742
+ await task.endTask(true, false, false);
743
+ }
744
+ }
745
+ if (forceExit !== ForceExit.PostRecordUpdate) {
746
+ task = rtEvt.getTask();
747
+ if (task.getLevel() === Constants.TASK_LEVEL_TASK)
748
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
749
+ }
750
+ let ctrl = LastFocusedManager.getLastFocusedControl();
751
+ if (ctrl !== null && forceExit !== ForceExit.Editing) {
752
+ await this.handleInternalEventWithMgControlBase(ctrl, InternalInterface.MG_ACT_CTRL_PREFIX);
753
+ }
754
+ if (forceExit === ForceExit.Editing) {
755
+ let evtCtrl = rtEvt.Control;
756
+ if (evtCtrl !== null && evtCtrl.getField() !== null)
757
+ await evtCtrl.getField().updateDisplay();
758
+ }
759
+ }
760
+ async handleEvents_1(handlersTab, rtEvt) {
761
+ try {
762
+ this.pushRtEvent(rtEvt);
763
+ for (let i = 0; i < handlersTab.getSize(); i++) {
764
+ let handler = handlersTab.getHandler(i);
765
+ if (rtEvt.getType() === ConstInterface.EVENT_TYPE_EXPRESSION || handler.isSpecificHandlerOf(rtEvt) || handler.isNonSpecificHandlerOf(rtEvt) || handler.isGlobalHandlerOf(rtEvt)) {
766
+ await handler.execute(rtEvt, false, false);
767
+ }
768
+ }
769
+ }
770
+ finally {
771
+ this.popRtEvent();
772
+ }
773
+ }
774
+ async handleKeyDown(task, ctrl, evt) {
775
+ let kbdItem = evt.getKbdItmAlways();
776
+ let keyCode = kbdItem.getKeyCode();
777
+ this._currKbdItem = kbdItem;
778
+ if (evt.IgnoreSpecifiedControl) {
779
+ ctrl = this.getCurrCtrl();
780
+ task = (((ctrl.getForm().getTask() instanceof Task) ? ctrl.getForm().getTask() : null));
781
+ if (ctrl.Type !== MgControlType.CTRL_TYPE_TEXT)
782
+ return;
783
+ }
784
+ Logger.Instance.WriteDevToLog('Start handling KEYDOWN event. Key code: ' + keyCode);
785
+ try {
786
+ if (this._currKbdItem.equals(this.KBI_DOWN) || this._currKbdItem.equals(this.KBI_UP)) {
787
+ if (ctrl !== null && (ctrl.Type === MgControlType.CTRL_TYPE_LIST || ctrl.Type === MgControlType.CTRL_TYPE_RADIO))
788
+ return;
789
+ }
790
+ let rtEvt = new RunTimeEvent(task, ctrl);
791
+ rtEvt.setSystem(this._currKbdItem);
792
+ rtEvt.setEditParms(evt.getStartSelection(), evt.getEndSelection(), evt.getValue());
793
+ try {
794
+ await this.handleEvent(rtEvt, false);
795
+ }
796
+ finally {
797
+ if (this._stopExecution) {
798
+ let returnToCtrl = MgControl.ReturnToCtrl;
799
+ if (returnToCtrl !== null && MgControl.validReturnToCtrl())
800
+ returnToCtrl.getForm().getTask().setLastParkedCtrl(returnToCtrl);
801
+ }
802
+ }
803
+ let mgd = MGDataCollection.Instance.getCurrMGData();
804
+ if (mgd !== null && !mgd.IsAborting)
805
+ await this.handleExpressionHandlers();
806
+ Logger.Instance.WriteDevToLog('End handling KEYDOWN event. Key code: ' + keyCode);
807
+ if (ctrl !== null && ctrl.IsRepeatable && ctrl === MgControl.ReturnToCtrl) {
808
+ await ctrl.getForm().bringRecordToPage();
809
+ }
810
+ }
811
+ finally {
812
+ }
813
+ }
814
+ async handleSelection(ctrl, line, val) {
815
+ if (ctrl.Type === MgControlType.CTRL_TYPE_TAB || ctrl.Type === MgControlType.CTRL_TYPE_CHECKBOX || ctrl.Type === MgControlType.CTRL_TYPE_RADIO || ctrl.Type === MgControlType.CTRL_TYPE_COMBO || ctrl.Type === MgControlType.CTRL_TYPE_LIST) {
816
+ let checkFocus = (ctrl.Type !== MgControlType.CTRL_TYPE_TAB && ctrl.Type !== MgControlType.CTRL_TYPE_CHECKBOX);
817
+ let allowSelection = (checkFocus ? (ctrl.getForm().getTask().getLastParkedCtrl() === ctrl) : true);
818
+ if (!allowSelection || !ctrl.isModifiable() || !await ctrl.IsParkable())
819
+ await ctrl.restoreOldValue();
820
+ else {
821
+ if (ctrl.isChoiceControl())
822
+ Commands.setGetSuggestedValueOfChoiceControlOnTagData(ctrl, ctrl.IsRepeatable ? line : 0, true);
823
+ if (ctrl.isDifferentValue(val, ctrl.IsNull, true)) {
824
+ ctrl.ModifiedByUser = true;
825
+ await this.handleCtrlModify(ctrl, InternalInterface.MG_ACT_SELECTION);
826
+ }
827
+ if (ctrl.isChoiceControl())
828
+ Commands.setGetSuggestedValueOfChoiceControlOnTagData(ctrl, ctrl.IsRepeatable ? line : 0, false);
829
+ if (!ctrl.IsMultipleSelectionListBox())
830
+ await ctrl.validateAndSetValue(val, true);
831
+ }
832
+ }
833
+ }
834
+ async handleMouseUp(ctrl, line, produceClick) {
835
+ if (ctrl === null)
836
+ return;
837
+ if (ctrl.Type === MgControlType.CTRL_TYPE_RADIO)
838
+ RuntimeContextBase.Instance.CurrentClickedRadio = ctrl;
839
+ try {
840
+ if (ctrl.Type !== MgControlType.CTRL_TYPE_TABLE) {
841
+ if (!await ctrl.checkPropWithLine(PropInterface.PROP_TYPE_ENABLED, true, line)) {
842
+ return;
843
+ }
844
+ let canGotoCtrl = this.canGoToControl(ctrl, true);
845
+ let StopFocus = ctrl.isFocusedStopExecution();
846
+ let returnToCtrl = MgControl.ReturnToCtrl;
847
+ if ((!canGotoCtrl || ((this._stopExecution || StopFocus) && returnToCtrl !== ctrl)) && returnToCtrl !== null) {
848
+ MGDataCollection.Instance.currMgdID = returnToCtrl.getForm().getTask().getMgdID();
849
+ if (returnToCtrl.IsRepeatable)
850
+ await returnToCtrl.getForm().bringRecordToPage();
851
+ await FocusManager.SetFocus(returnToCtrl, -1);
852
+ returnToCtrl.getForm().getTask().setLastParkedCtrl(returnToCtrl);
853
+ }
854
+ if (this._stopExecution || StopFocus)
855
+ return;
856
+ }
857
+ if (produceClick && (ctrl.Type === MgControlType.CTRL_TYPE_BUTTON || ctrl.Type === MgControlType.CTRL_TYPE_CHECKBOX || ctrl.Type === MgControlType.CTRL_TYPE_LIST)) {
858
+ let rtEvt = new RunTimeEvent(ctrl);
859
+ rtEvt.setInternal(InternalInterface.MG_ACT_WEB_CLICK);
860
+ this.addToTail(rtEvt);
861
+ }
862
+ }
863
+ finally {
864
+ RuntimeContextBase.Instance.CurrentClickedRadio = null;
865
+ }
866
+ }
867
+ checkAndSaveRouteEventIfCtxRemovedFromSrvr(aRtEvt) {
868
+ if (aRtEvt.getType() == ConstInterface.EVENT_TYPE_INTERNAL && aRtEvt.getInternalCode() ==
869
+ InternalInterface.MG_ACT_WEBCLIENT_ROUTE && RuntimeContextBase.Instance.RemovedContextFromServer) {
870
+ this.setLastSavedRouteEvent(aRtEvt);
871
+ }
872
+ }
873
+ async handleFocus(ctrl, line, onClick, shouldHandleZoom) {
874
+ try {
875
+ if (ctrl.isStatic())
876
+ return;
877
+ if (ctrl !== this._lastFailedFocusedControl && ctrl.HasExpOrParentTaskField()) {
878
+ if (ctrl.isListBox() || ctrl.isCheckBox() || ctrl.isComboBox() || ctrl.isTextControl() || ctrl.isRadio() || ctrl.isTabControl()) {
879
+ Logger.Instance.WriteErrorToLog(NString.Format('Control either has expression or has parent task variable attached to it. Failed to park on control with name: {0}', ctrl.Name));
880
+ FocusManager.SetFocus(LastFocusedManager.Instance.getLastFocusedTask(), LastFocusedManager.getLastFocusedControl(), 0, LastFocusedManager.getLastFocusedControl() === null ? true : false);
881
+ this._lastFailedFocusedControl = ctrl;
882
+ return;
883
+ }
884
+ }
885
+ this._lastFailedFocusedControl = null;
886
+ if (onClick)
887
+ RuntimeContextBase.Instance.CurrentClickedCtrl = ctrl;
888
+ let prevCtrl = LastFocusedManager.getLastFocusedControl();
889
+ if (ctrl === prevCtrl && !ctrl.isRepeatable()) {
890
+ await ctrl.getForm().bringRecordToPage();
891
+ await this.HandleZoomIfNeeded(ctrl, line, shouldHandleZoom);
892
+ let rtEvnt = this.getLastRtEvent();
893
+ if (rtEvnt != null && rtEvnt.ShouldHandleZoom)
894
+ FocusManager.SetFocus(ctrl, -1);
895
+ return;
896
+ }
897
+ let prevTask = LastFocusedManager.Instance.getLastFocusedTask();
898
+ if (ctrl === null || ctrl.Type === MgControlType.CTRL_TYPE_TABLE) {
899
+ if (prevCtrl === null)
900
+ await this.HandleNonParkableControls(ctrl.getForm().getTask());
901
+ return;
902
+ }
903
+ let currTask;
904
+ if ((ctrl.Type === MgControlType.CTRL_TYPE_BUTTON) && ((await (ctrl.getProp(PropInterface.PROP_TYPE_RAISE_AT)).getValueInt()) === RaiseAt.TaskInFocus))
905
+ currTask = prevTask;
906
+ else
907
+ currTask = ctrl.getForm().getTask();
908
+ let canGotoCtrl = this.canGoToControl(ctrl, onClick);
909
+ if (canGotoCtrl) {
910
+ if (this.guiPendingEvent != null)
911
+ return;
912
+ let handled = await this.HandleSubformModality(ctrl, prevTask, currTask);
913
+ if (handled)
914
+ return;
915
+ let eventLine = (ctrl.isRepeatable() || ctrl.isRadio()) ? line : Int32.MinValue;
916
+ let rtEvt = new RunTimeEvent(ctrl, eventLine);
917
+ rtEvt.setInternal(InternalInterface.MG_ACT_CTRL_PREFIX);
918
+ await this.handleEvent(rtEvt, false);
919
+ }
920
+ else if (prevCtrl !== null) {
921
+ if (!prevCtrl.isModifiable()) {
922
+ if (prevCtrl.isChoiceControl())
923
+ await prevCtrl.restoreOldValue();
924
+ }
925
+ else if (!currTask.cancelWasRaised()) {
926
+ let newVal = Manager.GetCtrlVal(prevCtrl);
927
+ if (!await prevCtrl.validateAndSetValue(newVal, true))
928
+ this.setStopExecution(true);
929
+ }
930
+ MgControl.ReturnToCtrl = prevCtrl;
931
+ }
932
+ else
933
+ await this.HandleNonParkableControls(ctrl.getForm().getTask());
934
+ if (!this._stopExecution && MgControl.ReturnToCtrl === ctrl) {
935
+ LastFocusedManager.setLastFocusedControl(ctrl.getForm().getTask(), ctrl);
936
+ await this.HandleZoomIfNeeded(ctrl, line, shouldHandleZoom);
937
+ }
938
+ return;
939
+ }
940
+ finally {
941
+ ctrl.setFocusedStopExecution(this._stopExecution);
942
+ if (this._stopExecution) {
943
+ {
944
+ let returnToCtrl = MgControl.ReturnToCtrl;
945
+ if (returnToCtrl !== null) {
946
+ MGDataCollection.Instance.currMgdID = returnToCtrl.getForm().getTask().getMgdID();
947
+ await FocusManager.SetFocus(returnToCtrl, -1);
948
+ returnToCtrl.getForm().getTask().setLastParkedCtrl(returnToCtrl);
949
+ }
950
+ }
951
+ }
952
+ }
953
+ }
954
+ async HandleSubformModality(ctrl, prevTask, currTask) {
955
+ let handledSubformModality = false;
956
+ let length = prevTask.getMGData().getTasksCount();
957
+ let topTask = prevTask.getMGData().getTask(length - 1);
958
+ if (currTask == prevTask || prevTask != topTask) {
959
+ if (topTask != null && prevTask != topTask && topTask.IsSubForm) {
960
+ let subformCtrl = topTask.getForm().getSubFormCtrl();
961
+ if (subformCtrl.IsModal())
962
+ prevTask = topTask;
963
+ }
964
+ }
965
+ if (prevTask != ctrl.getForm().getTask() && prevTask.getIsDestinationCall()) {
966
+ if (!currTask.isDescendentOf(prevTask)) {
967
+ let subformCtrl = prevTask.getForm().getSubFormCtrl();
968
+ if (!subformCtrl.IsModal() && !currTask.getIsDestinationCall())
969
+ subformCtrl = prevTask.GetSubformModalParentTask();
970
+ if (subformCtrl != null && (ctrl != subformCtrl) && subformCtrl.IsModal()) {
971
+ await this.performSubformClose(subformCtrl);
972
+ if (!this._stopExecution)
973
+ this.guiPendingEvent = this.getLastRtEvent();
974
+ handledSubformModality = true;
975
+ }
976
+ }
977
+ }
978
+ return handledSubformModality;
979
+ }
980
+ async handleFocusOnNonMagicControl(ctrl) {
981
+ try {
982
+ await EventsManager.Instance.handleInternalEventWithMgControlBase(ctrl, InternalInterface.MG_ACT_CTRL_SUFFIX);
983
+ }
984
+ finally {
985
+ ctrl.setFocusedStopExecution(this._stopExecution);
986
+ if (this._stopExecution) {
987
+ {
988
+ let returnToCtrl = MgControl.ReturnToCtrl;
989
+ if (returnToCtrl !== null) {
990
+ MGDataCollection.Instance.currMgdID = returnToCtrl.getForm().getTask().getMgdID();
991
+ await FocusManager.SetFocus(returnToCtrl, -1);
992
+ returnToCtrl.getForm().getTask().setLastParkedCtrl(returnToCtrl);
993
+ }
994
+ }
995
+ }
996
+ }
997
+ }
998
+ async HandleZoomIfNeeded(ctrl, line, shouldHandleZoom) {
999
+ if (shouldHandleZoom) {
1000
+ var rtEvt = new RunTimeEvent(ctrl, line, true);
1001
+ rtEvt.setInternal(InternalInterface.MG_ACT_ZOOM);
1002
+ await this.handleEvent(rtEvt, false);
1003
+ }
1004
+ }
1005
+ canGoToControl(ctrl, onClick) {
1006
+ if (onClick && (ctrl.Type === MgControlType.CTRL_TYPE_SUBFORM || ctrl.Type === MgControlType.CTRL_TYPE_BROWSER))
1007
+ return false;
1008
+ let canGotoCtrl = true;
1009
+ let currTask = ctrl.getForm().getTask();
1010
+ let lastTask = LastFocusedManager.Instance.getLastFocusedTask();
1011
+ if (!currTask.IsInteractive || (lastTask != null && lastTask.getLastParkedCtrl() != null &&
1012
+ lastTask.cancelWasRaised()))
1013
+ return false;
1014
+ if (ctrl.Type === MgControlType.CTRL_TYPE_IMAGE && !ctrl.IsRepeatable)
1015
+ canGotoCtrl = false;
1016
+ return canGotoCtrl;
1017
+ }
1018
+ async handleTimer(evt) {
1019
+ evt.setType(ConstInterface.EVENT_TYPE_TIMER);
1020
+ if (evt.isIdleTimer()) {
1021
+ await this.handleExpressionHandlers();
1022
+ await this.handleContextInactivityAlert(evt);
1023
+ }
1024
+ else {
1025
+ let mgd = MGDataCollection.Instance.getMGData(evt.getMgdID());
1026
+ await this.handleEvents(mgd.getTimerHandlers(), evt);
1027
+ }
1028
+ }
1029
+ async handleContextInactivityAlert(evt) {
1030
+ let timeNow = Misc.getSystemMilliseconds();
1031
+ let mgd = evt.getTask().getMGData();
1032
+ let lastRequestTime = RemoteCommandsProcessor.GetInstance().GetLastRequestTime;
1033
+ let contextInactivityTimeout = Environment.Instance.getContextInactivityTimeout() / 10;
1034
+ let contextInactivityWarningTime = Environment.Instance.getContextInactivityWarningTime() / 10;
1035
+ let idleTime = (timeNow - lastRequestTime) / 1000;
1036
+ if (contextInactivityTimeout == 0 || contextInactivityWarningTime == 0)
1037
+ return;
1038
+ if (EventsManager.userGrantedForContextActivity && idleTime >= (contextInactivityTimeout - contextInactivityWarningTime)) {
1039
+ let userConfirmation = await GUIManager.Instance.MessageBox(this.confirmationDialogTitle, this.confirmationDialogMsg, Styles.MSGBOX_BUTTON_YES_NO);
1040
+ if (userConfirmation == Styles.MSGBOX_RESULT_YES) {
1041
+ let cmd = CommandFactory.CreateContextTimeoutResetEventCommand();
1042
+ mgd.CmdsToServer.Add(cmd);
1043
+ await RemoteCommandsProcessor.GetInstance().Execute(CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS);
1044
+ }
1045
+ else {
1046
+ EventsManager.userGrantedForContextActivity = false;
1047
+ }
1048
+ }
1049
+ }
1050
+ async handleExpressionHandlers() {
1051
+ let rtEvt = new RunTimeEvent(LastFocusedManager.Instance.getLastFocusedTask(), LastFocusedManager.getLastFocusedControl());
1052
+ rtEvt.setExpression(null);
1053
+ rtEvt.setMainPrgCreator(rtEvt.getTask());
1054
+ for (let i = 0; i < MGDataCollection.Instance.getSize(); i++) {
1055
+ let mgd = MGDataCollection.Instance.getMGData(i);
1056
+ if (mgd !== null && !mgd.IsAborting)
1057
+ await this.handleEvents(mgd.getExpHandlers(), rtEvt);
1058
+ }
1059
+ }
1060
+ handleResize(ctrl, rowsInPage) {
1061
+ ctrl.getForm().setRowsInPage(rowsInPage);
1062
+ }
1063
+ async handleRowDataCurPage(table, desiredTopIndex, sendAll, lastFocusedVal) {
1064
+ let form = table.getForm();
1065
+ await form.setRowData(desiredTopIndex, sendAll);
1066
+ }
1067
+ async handleTransferDataToGui(ctrl) {
1068
+ let form = ctrl.getForm();
1069
+ await form.transferDataToGui();
1070
+ }
1071
+ async fetchRecordsAheadFromServer(ctrl) {
1072
+ let form = ctrl.getForm();
1073
+ await form.FetchRecordsAheadFromServer();
1074
+ }
1075
+ handleEnableEvents(evt, enable) {
1076
+ evt.getTask().ActionManager.enableList(evt.getActEnableList(), enable, true);
1077
+ }
1078
+ async handleCtrlPrefix(evt) {
1079
+ let task = evt.getTask();
1080
+ let currClickedCtrl = RuntimeContextBase.Instance.CurrentClickedCtrl;
1081
+ let form = task.getForm();
1082
+ let displayLine = evt.getDisplayLine();
1083
+ let ctrl = evt.Control;
1084
+ if (form.isLineMode()) {
1085
+ if (displayLine === Int32.MinValue || ctrl.isRadio())
1086
+ displayLine = form.DisplayLine;
1087
+ }
1088
+ else
1089
+ displayLine = Int32.MinValue;
1090
+ let lastParkedCtrl = LastFocusedManager.getLastFocusedControl();
1091
+ if (lastParkedCtrl !== null && lastParkedCtrl.getForm().getTask().getMGData().GetId() === ctrl.getForm().getTask().getMGData().GetId() && lastParkedCtrl.getForm().getTask().getLevel() === Constants.TASK_LEVEL_CONTROL) {
1092
+ if ((ctrl !== lastParkedCtrl || (ctrl.isRepeatable() && displayLine !== ctrl.getDisplayLine(true))) && !lastParkedCtrl.isInControlSuffix()) {
1093
+ await this.handleInternalEventWithMgControlBase(lastParkedCtrl, InternalInterface.MG_ACT_CTRL_SUFFIX);
1094
+ if (this._stopExecution) {
1095
+ if (ctrl.Type === MgControlType.CTRL_TYPE_LIST || ctrl.Type === MgControlType.CTRL_TYPE_RADIO || ctrl.Type === MgControlType.CTRL_TYPE_CHECKBOX || ctrl.isTabControl()) {
1096
+ ctrl.resetPrevVal();
1097
+ await ctrl.RefreshDisplay();
1098
+ }
1099
+ return false;
1100
+ }
1101
+ }
1102
+ else
1103
+ return false;
1104
+ }
1105
+ if (task.InCtrlPrefix)
1106
+ return false;
1107
+ task.InCtrlPrefix = true;
1108
+ let prevCtrl = lastParkedCtrl;
1109
+ if (currClickedCtrl !== null && currClickedCtrl.getForm().getTask().getMgdID() === ctrl.getForm().getTask().getMgdID() && ctrl.onDiffForm(currClickedCtrl))
1110
+ prevCtrl = currClickedCtrl;
1111
+ if (prevCtrl !== null && ctrl.onDiffForm(prevCtrl)) {
1112
+ let prevTask = prevCtrl.getForm().getTask();
1113
+ await prevTask.execSubformRecSuffix(ctrl.getForm().getTask());
1114
+ if (this._stopExecution) {
1115
+ if (ctrl.Type === MgControlType.CTRL_TYPE_LIST || ctrl.Type === MgControlType.CTRL_TYPE_RADIO || ctrl.Type === MgControlType.CTRL_TYPE_CHECKBOX || ctrl.isTabControl()) {
1116
+ ctrl.resetPrevVal();
1117
+ await ctrl.RefreshDisplay();
1118
+ }
1119
+ task.InCtrlPrefix = false;
1120
+ return false;
1121
+ }
1122
+ if (ctrl.getForm().getTask().isAborting()) {
1123
+ task.InCtrlPrefix = false;
1124
+ return false;
1125
+ }
1126
+ await EventsManager.doSyncForSubformParent(task);
1127
+ }
1128
+ if (task.DataView.isEmptyDataview())
1129
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
1130
+ else {
1131
+ task.SubformExecMode = Task_SubformExecModeEnum.SET_FOCUS;
1132
+ let rtEvt = new RunTimeEvent(ctrl, displayLine);
1133
+ rtEvt.setInternal(InternalInterface.MG_ACT_REC_PREFIX);
1134
+ await this.handleEvent(rtEvt, false);
1135
+ }
1136
+ if (this.GetStopExecutionFlag()) {
1137
+ task.InCtrlPrefix = false;
1138
+ return false;
1139
+ }
1140
+ if (!await ctrl.IsParkable() && ctrl !== lastParkedCtrl) {
1141
+ task.InCtrlPrefix = false;
1142
+ if (lastParkedCtrl === null || !await lastParkedCtrl.invoke())
1143
+ await this.HandleNonParkableControls(ctrl.getForm().getTask());
1144
+ return false;
1145
+ }
1146
+ Logger.Instance.WriteSupportToLog(NString.Format('{0} Entering control: control {1}, row {2}', task.GetTaskDetails(), ctrl.Name, displayLine < 0 ? 0 : displayLine), true);
1147
+ task.setLevel(Constants.TASK_LEVEL_CONTROL);
1148
+ ctrl.KeyStrokeOn = false;
1149
+ ctrl.ModifiedByUser = false;
1150
+ task.setCurrField(ctrl.getField());
1151
+ if (ctrl.IsRepeatable)
1152
+ await form.bringRecordToPage();
1153
+ if (lastParkedCtrl !== ctrl) {
1154
+ if ((lastParkedCtrl === null && ctrl.getForm().isSubForm()) || (lastParkedCtrl !== null && (ctrl.getForm().isSubForm() || lastParkedCtrl.getForm().isSubForm()))) {
1155
+ let lastParkedTask = null;
1156
+ if (lastParkedCtrl !== null)
1157
+ lastParkedTask = lastParkedCtrl.getForm().getTask();
1158
+ if (lastParkedTask !== task) {
1159
+ let firstTime = true;
1160
+ let isSonSubform;
1161
+ let parentTask;
1162
+ if (lastParkedTask !== null) {
1163
+ isSonSubform = lastParkedTask.IsSubForm;
1164
+ for (parentTask = lastParkedTask; parentTask !== null && isSonSubform; parentTask = parentTask.getParent()) {
1165
+ if (!firstTime) {
1166
+ isSonSubform = parentTask.IsSubForm;
1167
+ parentTask.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, false);
1168
+ parentTask.ActionManager.enable(InternalInterface.MG_ACT_DELLINE, false);
1169
+ parentTask.enableCreateActs(false);
1170
+ }
1171
+ else
1172
+ firstTime = false;
1173
+ }
1174
+ }
1175
+ isSonSubform = task.IsSubForm;
1176
+ for (parentTask = task.getParent(); (parentTask !== null) && isSonSubform; parentTask = parentTask.getParent()) {
1177
+ isSonSubform = parentTask.IsSubForm;
1178
+ if (parentTask.getEnableZoomHandler())
1179
+ parentTask.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, true);
1180
+ await parentTask.setCreateDeleteActsEnableState();
1181
+ }
1182
+ await task.enableModes();
1183
+ }
1184
+ }
1185
+ }
1186
+ if (task.getEnableZoomHandler() || ctrl.useZoomHandler())
1187
+ task.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, true);
1188
+ if (ctrl.isTextControl() || ctrl.isChoiceControl())
1189
+ ctrl.SetKeyboardLanguage();
1190
+ if (ctrl.Type === MgControlType.CTRL_TYPE_BUTTON)
1191
+ task.ActionManager.enable(InternalInterface.MG_ACT_BUTTON, true);
1192
+ await task.setCreateDeleteActsEnableState();
1193
+ let field = ctrl.getField();
1194
+ if (field !== null && field.NullAllowed && ctrl.isModifiable() && ctrl.Type !== MgControlType.CTRL_TYPE_BUTTON)
1195
+ task.ActionManager.enable(InternalInterface.MG_ACT_RT_EDT_NULL, true);
1196
+ return true;
1197
+ }
1198
+ async commonHandlerBefore(evt) {
1199
+ let evtSave = evt;
1200
+ let task = evt.getTask();
1201
+ let rec = null;
1202
+ let prevRec = null;
1203
+ let val;
1204
+ let oldDisplayLine = Int32.MinValue;
1205
+ if (this._stopExecution)
1206
+ return false;
1207
+ if (task.isAborting())
1208
+ return false;
1209
+ if (evt.getType() === ConstInterface.EVENT_TYPE_SYSTEM) {
1210
+ let actId = this.getMatchingAction(evt.getKbdItm());
1211
+ if (actId !== 0 && evt.Control !== null) {
1212
+ evt = new RunTimeEvent(evt, evt);
1213
+ evt.setInternal(actId);
1214
+ evt.setArgList(null);
1215
+ let mgControl = evt.Control;
1216
+ evtSave.setCtrl(mgControl);
1217
+ if (mgControl === null)
1218
+ return false;
1219
+ }
1220
+ }
1221
+ if (evt.getType() === ConstInterface.EVENT_TYPE_INTERNAL) {
1222
+ let form = task.getForm();
1223
+ let displayLine = evt.getDisplayLine();
1224
+ let dv = task.DataView;
1225
+ rec = dv.getCurrRec();
1226
+ let ctrl = evt.Control;
1227
+ let intEvtCode = evt.getInternalCode();
1228
+ let lastFocusedCtrl = LastFocusedManager.getLastFocusedControl();
1229
+ switch (intEvtCode) {
1230
+ case InternalInterface.MG_ACT_ZOOM:
1231
+ let boolval = await this.selectProg(ctrl);
1232
+ if (boolval)
1233
+ return false;
1234
+ case InternalInterface.MG_ACT_WEB_ON_DBLICK:
1235
+ break;
1236
+ case InternalInterface.MG_ACT_CTRL_FOCUS:
1237
+ await this.handleFocus(ctrl, displayLine, evt.isProduceClick(), evt.ShouldHandleZoom);
1238
+ return false;
1239
+ case InternalInterface.MG_ACT_CTRL_FOCUS_ON_NON_MAGIC_CONTROL:
1240
+ await this.handleFocusOnNonMagicControl(ctrl);
1241
+ return false;
1242
+ case InternalInterface.MG_ACT_CTRL_KEYDOWN:
1243
+ await this.handleKeyDown(task, ctrl, evt);
1244
+ return false;
1245
+ case InternalInterface.MG_ACT_CTRL_MOUSEUP:
1246
+ await this.handleMouseUp(ctrl, displayLine, evt.isProduceClick());
1247
+ return false;
1248
+ case InternalInterface.MG_ACT_SELECTION:
1249
+ await this.onActSelection(ctrl, form, evt);
1250
+ return false;
1251
+ case InternalInterface.MG_ACT_TIMER:
1252
+ await this.handleTimer(evt);
1253
+ return false;
1254
+ case InternalInterface.MG_ACT_RESIZE:
1255
+ this.handleResize(ctrl, displayLine);
1256
+ return false;
1257
+ case InternalInterface.MG_ACT_ROW_DATA_CURR_PAGE:
1258
+ await this.handleRowDataCurPage(ctrl, displayLine, evt.isSendAll(), evt.LastFocusedVal);
1259
+ return false;
1260
+ case InternalInterface.MG_ACT_DV_TO_GUI:
1261
+ await this.handleTransferDataToGui(ctrl);
1262
+ return false;
1263
+ case InternalInterface.MG_ACT_FETCH_RECORDS_AHEAD_FROM_SERVER:
1264
+ await this.fetchRecordsAheadFromServer(ctrl);
1265
+ break;
1266
+ case InternalInterface.MG_ACT_ENABLE_EVENTS:
1267
+ this.handleEnableEvents(evt, true);
1268
+ return false;
1269
+ case InternalInterface.MG_ACT_DISABLE_EVENTS:
1270
+ this.handleEnableEvents(evt, false);
1271
+ return false;
1272
+ case InternalInterface.MG_ACT_TASK_PREFIX:
1273
+ task.setLevel(Constants.TASK_LEVEL_TASK);
1274
+ break;
1275
+ case InternalInterface.MG_ACT_TASK_SUFFIX:
1276
+ task.setLevel(Constants.TASK_LEVEL_TASK);
1277
+ break;
1278
+ case InternalInterface.MG_ACT_REC_PREFIX:
1279
+ if (task.IsSubForm && task.getParent().InCommonHandlerBeforeRP)
1280
+ return false;
1281
+ task.setAfterRetry(ConstInterface.RECOVERY_NONE);
1282
+ task.DataSynced = false;
1283
+ if (!task.isStarted())
1284
+ return false;
1285
+ if (form.getRowsInPage() > Int32.MinValue && displayLine > Int32.MinValue) {
1286
+ while (!dv.recExists(displayLine) && displayLine > 0) {
1287
+ displayLine--;
1288
+ }
1289
+ if (displayLine >= 0) {
1290
+ prevRec = dv.getCurrRec();
1291
+ let oldTaskMode = task.getMode();
1292
+ let oldRecId = prevRec.getId();
1293
+ try {
1294
+ oldDisplayLine = form.DisplayLine;
1295
+ form.PrevDisplayLine = oldDisplayLine;
1296
+ await form.setCurrRowByDisplayLine(displayLine, true, false);
1297
+ if (prevRec != null && !dv.recExistsById(prevRec.getId())) {
1298
+ await form.RefreshDisplay(Constants.TASK_REFRESH_TABLE);
1299
+ await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
1300
+ }
1301
+ rec = dv.getCurrRec();
1302
+ }
1303
+ catch (e) {
1304
+ if (e instanceof RecordOutOfDataViewException) {
1305
+ if (this._stopExecution) {
1306
+ if (oldTaskMode === Constants.TASK_MODE_CREATE && oldDisplayLine > 0 &&
1307
+ !dv.recExistsById(oldRecId)) {
1308
+ let prevLine = form.getPrevLine(oldDisplayLine);
1309
+ await form.restoreOldDisplayLine(prevLine);
1310
+ }
1311
+ else
1312
+ await form.restoreOldDisplayLine(oldDisplayLine);
1313
+ await form.RefreshDisplay(Constants.TASK_REFRESH_FORM);
1314
+ this.setStopExecution(false);
1315
+ lastFocusedCtrl = task.getLastParkedCtrl();
1316
+ task.getLastParkedCtrl();
1317
+ if (lastFocusedCtrl != null)
1318
+ await lastFocusedCtrl.invoke();
1319
+ this.setStopExecution(true);
1320
+ return false;
1321
+ }
1322
+ else
1323
+ Logger.Instance.WriteDevToLog(e.StackTrace);
1324
+ }
1325
+ else
1326
+ throw e;
1327
+ }
1328
+ }
1329
+ else
1330
+ throw new ApplicationException('in EventsManager.commonHandlerBefore(): invalid line number: ' +
1331
+ displayLine);
1332
+ }
1333
+ if (rec == null)
1334
+ throw new ApplicationException('in EventsManager.commonHandlerBefore(): no current record available !');
1335
+ if (!task.IsInteractive && task.getLevel() === Constants.TASK_LEVEL_TASK)
1336
+ task.increaseCounter();
1337
+ if (await task.evalEndCond(ConstInterface.END_COND_EVAL_BEFORE)) {
1338
+ await task.endTask(true, false, false);
1339
+ return false;
1340
+ }
1341
+ if (form.HasTable())
1342
+ await form.bringRecordToPage();
1343
+ if (task.getLevel() !== Constants.TASK_LEVEL_TASK)
1344
+ return false;
1345
+ await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
1346
+ Logger.Instance.WriteDevToLog('RECORD PREFIX: ' + task.queryTaskPath());
1347
+ (dv.getCurrRec()).setForceSaveOrg(false);
1348
+ (dv.getCurrRec()).Synced = false;
1349
+ dv.saveOriginal();
1350
+ if (task.IsSubForm && task.PerformParentRecordPrefix) {
1351
+ let parentTask = task.getParent();
1352
+ while (parentTask.IsSubForm) {
1353
+ if (parentTask.getLevel() === Constants.TASK_LEVEL_TASK) {
1354
+ await this.handleInternalEventWithTask(parentTask, InternalInterface.MG_ACT_REC_PREFIX);
1355
+ parentTask = parentTask.getParent();
1356
+ if (this.GetStopExecutionFlag())
1357
+ break;
1358
+ }
1359
+ else
1360
+ break;
1361
+ }
1362
+ }
1363
+ task.InCommonHandlerBeforeRP = true;
1364
+ if (await task.CheckRefreshSubTasks())
1365
+ await dv.computeSubForms();
1366
+ task.InCommonHandlerBeforeRP = false;
1367
+ task.setLevel(Constants.TASK_LEVEL_RECORD);
1368
+ await task.enableRecordActions();
1369
+ break;
1370
+ case InternalInterface.MG_ACT_REC_SUFFIX:
1371
+ let forceSuffix = false;
1372
+ let isSelectionTable;
1373
+ task.ConfirmUpdateNo = false;
1374
+ if (rec == null)
1375
+ return false;
1376
+ forceSuffix = await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false);
1377
+ if ((rec.Modified || forceSuffix) && rec.getMode() === DataModificationTypes.Delete &&
1378
+ task.getMode() === Constants.TASK_MODE_DELETE)
1379
+ return true;
1380
+ if (task.getLevel() === Constants.TASK_LEVEL_TASK)
1381
+ return false;
1382
+ if (task.getLevel() === Constants.TASK_LEVEL_CONTROL) {
1383
+ task.setInRecordSuffix(true);
1384
+ await this.handleInternalEventWithMgControlBase(task.getLastParkedCtrl(), InternalInterface.MG_ACT_CTRL_SUFFIX);
1385
+ task.setInRecordSuffix(false);
1386
+ if (this._stopExecution)
1387
+ return false;
1388
+ }
1389
+ await task.handleEventOnSlaveTasks(InternalInterface.MG_ACT_REC_SUFFIX);
1390
+ if (this._stopExecution)
1391
+ return false;
1392
+ Logger.Instance.WriteDevToLog('RECORD SUFFIX: ' + task.queryTaskPath());
1393
+ task.setLevel(Constants.TASK_LEVEL_TASK);
1394
+ isSelectionTable = await task.checkProp(PropInterface.PROP_TYPE_SELECTION, false);
1395
+ if (task.getMode() === Constants.TASK_MODE_QUERY && !forceSuffix && !rec.Modified &&
1396
+ !isSelectionTable)
1397
+ return false;
1398
+ if (!rec.Modified && !forceSuffix && (!isSelectionTable || !task.InSelect)) {
1399
+ if (rec.getMode() === DataModificationTypes.Delete) {
1400
+ return await this.executeControlVerification(task);
1401
+ }
1402
+ return false;
1403
+ }
1404
+ if (task.getMode() !== Constants.TASK_MODE_DELETE && rec.Modified) {
1405
+ if (!await this.updateConfirmed(task))
1406
+ return false;
1407
+ }
1408
+ let stopExecution = !await this.executeControlVerification(task);
1409
+ if (stopExecution)
1410
+ return false;
1411
+ break;
1412
+ case InternalInterface.MG_ACT_CTRL_PREFIX:
1413
+ if (await this.handleCtrlPrefix(evt))
1414
+ return true;
1415
+ else {
1416
+ evt.Control.InControl = false;
1417
+ return false;
1418
+ }
1419
+ case InternalInterface.MG_ACT_CANCEL:
1420
+ Manager.CleanMessagePane(task);
1421
+ break;
1422
+ case InternalInterface.MG_ACT_CTRL_SUFFIX:
1423
+ if (ctrl == null || this.getStopExecutionCtrl() != null)
1424
+ return false;
1425
+ if (task.getLevel() !== Constants.TASK_LEVEL_CONTROL)
1426
+ return false;
1427
+ if (!ctrl.isSubform()) {
1428
+ val = Manager.GetCtrlVal(ctrl);
1429
+ task.CurrentEditingControl = null;
1430
+ if (!task.cancelWasRaised() &&
1431
+ (ctrl.Type !== MgControlType.CTRL_TYPE_BROWSER && (!isNullOrUndefined(ctrl._field) && (ctrl._field.getType() === StorageAttribute.DATE || ctrl._field.getType() == StorageAttribute.NUMERIC) || val !== null) && typeof val != 'undefined' &&
1432
+ !await ctrl.validateAndSetValue(val, true))) {
1433
+ this.setStopExecution(true);
1434
+ return false;
1435
+ }
1436
+ }
1437
+ if (!this._stopExecution)
1438
+ Manager.CleanMessagePane(task);
1439
+ ctrl.InControl = false;
1440
+ ctrl.ClipBoardDataExists = false;
1441
+ ctrl.ValidateControl = true;
1442
+ ctrl.setInControlSuffix(true);
1443
+ break;
1444
+ }
1445
+ }
1446
+ return true;
1447
+ }
1448
+ async selectProg(ctrl) {
1449
+ let cmd;
1450
+ let value;
1451
+ let mgVal;
1452
+ let progExecuted = false;
1453
+ let task = ctrl.getForm().getTask();
1454
+ if (ctrl.HasSelectProgram()) {
1455
+ if (ctrl.IsParkable()) {
1456
+ value = Manager.GetCtrlVal(ctrl);
1457
+ if (!ctrl.validateAndSetValue(value, false))
1458
+ this.setStopExecution(true);
1459
+ else {
1460
+ let encodedVal = null;
1461
+ mgVal = await ctrl.getMgValue(value);
1462
+ var rec = task.DataView.getCurrRec();
1463
+ encodedVal = rec.getXMLForValue(ctrl.getField().getId(), mgVal);
1464
+ cmd = CommandFactory.CreateSelectProgramCommand(task.getTaskTag(), null, Int32.MinValue, ctrl.getDitIdx(), encodedVal);
1465
+ task.getMGData().CmdsToServer.Add(cmd);
1466
+ let commandsProcessorServer = CommandsProcessorManager.GetCommandsProcessor();
1467
+ await commandsProcessorServer.Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
1468
+ progExecuted = true;
1469
+ }
1470
+ }
1471
+ }
1472
+ return progExecuted;
1473
+ }
1474
+ async executeControlVerification(task) {
1475
+ let table = task.getHandlersTab();
1476
+ for (let i = 0; i < table.getSize(); i++) {
1477
+ let handler = table.getHandler(i);
1478
+ let evt = handler.getEvent();
1479
+ if (evt.getInternalCode() === InternalInterface.MG_ACT_CTRL_VERIFICATION) {
1480
+ let control = ((task.getForm() !== null) ? task.getForm().getCtrlByCtrlName(handler.getCtrlName()) : null);
1481
+ if (!isNullOrUndefined(control)) {
1482
+ let runTimeEvent = new RunTimeEvent(control);
1483
+ runTimeEvent.setInternal(InternalInterface.MG_ACT_CTRL_VERIFICATION);
1484
+ await this.handleEvent(runTimeEvent, false);
1485
+ if (this._stopExecution) {
1486
+ LastFocusedManager.setLastFocusedControl(task, control);
1487
+ this.setStopExecutionCtrl(null);
1488
+ this.setStopExecutionCtrl(control);
1489
+ return false;
1490
+ }
1491
+ }
1492
+ }
1493
+ }
1494
+ return true;
1495
+ }
1496
+ async onActSelection(ctrl, form, evt) {
1497
+ let displayLine = evt.getDisplayLine();
1498
+ if (displayLine === Int32.MinValue)
1499
+ displayLine = form.DisplayLine;
1500
+ let simulate = ctrl.Type === MgControlType.CTRL_TYPE_CHECKBOX || ctrl.Type === MgControlType.CTRL_TYPE_LIST || ctrl.Type === MgControlType.CTRL_TYPE_RADIO || ctrl.Type === MgControlType.CTRL_TYPE_BUTTON || (ctrl.Type === MgControlType.CTRL_TYPE_TAB && !evt.isProduceClick());
1501
+ if (simulate)
1502
+ await this.simulateSelection(ctrl, evt.getValue(), displayLine, evt.isProduceClick());
1503
+ else
1504
+ await this.handleSelection(ctrl, displayLine, evt.getValue());
1505
+ }
1506
+ async onSubformClose(task, evt) {
1507
+ if ((evt.getArgList() != null) && (evt.getArgList().getSize() === 1)) {
1508
+ let subformCtrl = null;
1509
+ let closingSubformName = await evt.getArgList().getArgValue(0, StorageAttribute.ALPHA, 0);
1510
+ if (closingSubformName == null)
1511
+ return;
1512
+ for (let parentTask = task; parentTask.getForm() != null && parentTask.getMgdID() === task.getMgdID(); parentTask = parentTask.getParent()) {
1513
+ subformCtrl = parentTask.getForm().getCtrlByName(closingSubformName.trim(), MgControlType.CTRL_TYPE_SUBFORM);
1514
+ if (subformCtrl != null) {
1515
+ let subformTask = subformCtrl.getSubformTask();
1516
+ if (subformTask != null && !subformTask.IsRoute()) {
1517
+ {
1518
+ await this.performSubformClose(subformCtrl);
1519
+ }
1520
+ break;
1521
+ }
1522
+ }
1523
+ }
1524
+ }
1525
+ }
1526
+ async performSubformClose(subformCtrl) {
1527
+ let subformTask = subformCtrl.getSubformTask();
1528
+ let parentTask = subformCtrl.getForm().getTask();
1529
+ let mgd = subformTask.getMGData();
1530
+ this.pushNewExecStacks();
1531
+ await subformTask.endTask(true, false, false, true);
1532
+ this.popNewExecStacks();
1533
+ if (!this._stopExecution) {
1534
+ parentTask.TaskService.RemoveRecomputes(parentTask);
1535
+ await subformTask.stop();
1536
+ subformCtrl.resetSubformTask();
1537
+ await CommandsProcessorManager.GetCommandsProcessor().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
1538
+ Commands.addClosesubform(CommandType.CLOSE_SUB_FORM, subformCtrl, subformTask.getTaskTag(), subformCtrl.getName(), subformTask.getForm().buildFormName());
1539
+ if (subformCtrl.IsModal())
1540
+ mgd.abort();
1541
+ }
1542
+ }
1543
+ createEventArguments(evt) {
1544
+ if (evt.getArgList() === null) {
1545
+ if (evt.getType() === ConstInterface.EVENT_TYPE_INTERNAL) {
1546
+ switch (evt.getInternalCode()) {
1547
+ default:
1548
+ break;
1549
+ }
1550
+ }
1551
+ }
1552
+ }
1553
+ async DoTaskLevelRecordSuffix(task, refDoSuffix) {
1554
+ let shouldReturn = false;
1555
+ if (task.getLevel() === Constants.TASK_LEVEL_RECORD) {
1556
+ refDoSuffix.value = false;
1557
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
1558
+ if (this.GetStopExecutionFlag())
1559
+ shouldReturn = true;
1560
+ }
1561
+ return shouldReturn;
1562
+ }
1563
+ async DoTaskLevelRecordPrefix(task) {
1564
+ if (!this.GetStopExecutionFlag()) {
1565
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
1566
+ }
1567
+ }
1568
+ async commonHandler(evt) {
1569
+ let task = evt.getTask();
1570
+ let mgData = task.getMGData();
1571
+ let form = task.getForm();
1572
+ let ctrl = evt.Control;
1573
+ let lastParkedCtrl;
1574
+ let doSuffix = true;
1575
+ let oldMode;
1576
+ let server = Task.CommandsProcessor;
1577
+ if (this._stopExecution)
1578
+ return;
1579
+ if (evt.getType() === ConstInterface.EVENT_TYPE_USER)
1580
+ evt = new RunTimeEvent(evt.getUserEvent(), evt);
1581
+ try {
1582
+ this.pushRtEvent(evt);
1583
+ if (evt.getType() === ConstInterface.EVENT_TYPE_SYSTEM) {
1584
+ let actId = this.getMatchingAction(evt.getKbdItm());
1585
+ if (actId !== 0) {
1586
+ evt = new RunTimeEvent(evt, evt);
1587
+ evt.setInternal(actId);
1588
+ evt.setArgList(null);
1589
+ }
1590
+ }
1591
+ let cmd;
1592
+ if (evt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && !evt.isImmediate() && this.ActAllowed(evt.getInternalCode()) && !this._processingTopMostEndTask) {
1593
+ let cmdsToServer = mgData.CmdsToServer;
1594
+ let dv = task.DataView;
1595
+ let rec = dv.getCurrRec();
1596
+ let intEvtCode = evt.getInternalCode();
1597
+ switch (intEvtCode) {
1598
+ case InternalInterface.MG_ACT_SUBFORM_CLOSE:
1599
+ await this.onSubformClose(task, evt);
1600
+ break;
1601
+ case InternalInterface.MG_ACT_BUTTON:
1602
+ case InternalInterface.MG_ACT_CTRL_HIT:
1603
+ if (ctrl.Type === MgControlType.CTRL_TYPE_BUTTON &&
1604
+ (intEvtCode === InternalInterface.MG_ACT_BUTTON || !evt.isGuiTriggeredEvent() || ctrl.isParkable(true))) {
1605
+ let aRtEvt = new RunTimeEvent(ctrl);
1606
+ if (ctrl.getRtEvtTask() != null)
1607
+ aRtEvt.setTask(ctrl.getRtEvtTask());
1608
+ if (ConstInterface.EVENT_TYPE_NONE !== aRtEvt.getType()) {
1609
+ if (ctrl.useZoomHandler()) {
1610
+ let taskToEnable = aRtEvt.getTask();
1611
+ if (taskToEnable != null)
1612
+ taskToEnable.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, true);
1613
+ }
1614
+ aRtEvt.setArgList(ctrl.ArgList);
1615
+ await aRtEvt.setPublicName();
1616
+ this.addToTail(aRtEvt);
1617
+ this.checkAndSaveRouteEventIfCtxRemovedFromSrvr(aRtEvt);
1618
+ }
1619
+ }
1620
+ else if (ctrl.Type === MgControlType.CTRL_TYPE_TAB) {
1621
+ this.addInternalEventWithCtrlAndCode(ctrl, InternalInterface.MG_ACT_ZOOM);
1622
+ }
1623
+ else if (ctrl.Type === MgControlType.CTRL_TYPE_RADIO) {
1624
+ ctrl.setControlToFocus();
1625
+ }
1626
+ break;
1627
+ case InternalInterface.MG_ACT_TOGGLE_INSERT:
1628
+ RuntimeContextBase.Instance.ToggleInsertMode();
1629
+ break;
1630
+ case InternalInterface.MG_ACT_CLOSE:
1631
+ let rtEvt = new RunTimeEvent(evt, evt);
1632
+ rtEvt.setInternal(InternalInterface.MG_ACT_EXIT);
1633
+ this.addToTail(rtEvt);
1634
+ break;
1635
+ case InternalInterface.MG_ACT_EXIT:
1636
+ let taskToEnd = (task.isMainProg() ? MGDataCollection.Instance.StartupMgData.getFirstTask() : task);
1637
+ await taskToEnd.endTask(evt.reversibleExit(), false, evt.ExitDueToError());
1638
+ break;
1639
+ case InternalInterface.MG_ACT_EXIT_SYSTEM:
1640
+ await MGDataCollection.Instance.StartupMgData.getFirstTask().endTask(evt.reversibleExit(), false, false);
1641
+ break;
1642
+ case InternalInterface.MG_ACT_TBL_NXTLINE:
1643
+ if (form != null)
1644
+ await form.moveInView(Constants.MOVE_UNIT_ROW, Constants.MOVE_DIRECTION_NEXT);
1645
+ break;
1646
+ case InternalInterface.MG_ACT_TBL_PRVLINE:
1647
+ if (form != null)
1648
+ await form.moveInView(Constants.MOVE_UNIT_ROW, Constants.MOVE_DIRECTION_PREV);
1649
+ break;
1650
+ case InternalInterface.MG_ACT_TBL_NXTPAGE:
1651
+ if (form != null)
1652
+ await form.moveInView(Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_NEXT);
1653
+ break;
1654
+ case InternalInterface.MG_ACT_TBL_PRVPAGE:
1655
+ if (form != null)
1656
+ await form.moveInView(Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_PREV);
1657
+ break;
1658
+ case InternalInterface.MG_ACT_TBL_BEGPAGE:
1659
+ if (form != null)
1660
+ await form.moveInView(Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_BEGIN);
1661
+ break;
1662
+ case InternalInterface.MG_ACT_TBL_ENDPAGE:
1663
+ if (form != null)
1664
+ await form.moveInView(Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_END);
1665
+ break;
1666
+ case InternalInterface.MG_ACT_TBL_BEGTBL:
1667
+ lastParkedCtrl = task.getLastParkedCtrl();
1668
+ if (lastParkedCtrl == null || !lastParkedCtrl.isListBox()) {
1669
+ if (form != null)
1670
+ await form.moveInView(Constants.MOVE_UNIT_TABLE, Constants.MOVE_DIRECTION_BEGIN);
1671
+ }
1672
+ break;
1673
+ case InternalInterface.MG_ACT_TBL_ENDTBL:
1674
+ lastParkedCtrl = task.getLastParkedCtrl();
1675
+ if (lastParkedCtrl === null || !lastParkedCtrl.isListBox()) {
1676
+ if (form != null)
1677
+ await form.moveInView(Constants.MOVE_UNIT_TABLE, Constants.MOVE_DIRECTION_END);
1678
+ }
1679
+ break;
1680
+ case InternalInterface.MG_ACT_WEB_ON_DBLICK:
1681
+ {
1682
+ let ctrlType = ctrl.Type;
1683
+ let putAction = InternalInterface.MG_ACT_NONE;
1684
+ if (ctrlType !== MgControlType.CTRL_TYPE_TABLE && ctrlType !== MgControlType.CTRL_TYPE_LABEL &&
1685
+ ctrlType !== MgControlType.CTRL_TYPE_IMAGE) {
1686
+ if (ctrl.getForm().getTask().ActionManager.isEnabled(InternalInterface.MG_ACT_SELECT))
1687
+ putAction = InternalInterface.MG_ACT_SELECT;
1688
+ else {
1689
+ if (ctrl.getForm().getTask().ActionManager.isEnabled(InternalInterface.MG_ACT_ZOOM))
1690
+ putAction = InternalInterface.MG_ACT_ZOOM;
1691
+ }
1692
+ if (putAction !== InternalInterface.MG_ACT_NONE)
1693
+ this.addInternalEventWithCtrlAndCode(ctrl, putAction);
1694
+ }
1695
+ }
1696
+ break;
1697
+ case InternalInterface.MG_ACT_DELLINE:
1698
+ if (await this.HandleActionDelline(task, dv, rec, false))
1699
+ return;
1700
+ break;
1701
+ case InternalInterface.MG_ACT_CRELINE:
1702
+ case InternalInterface.MG_ACT_CRELINE_ABOVE:
1703
+ if (task.DataView.isEmptyDataview()) {
1704
+ await this.gotoCreateMode(task);
1705
+ break;
1706
+ }
1707
+ if (task.getInCreateLine())
1708
+ break;
1709
+ task.setInCreateLine(true);
1710
+ try {
1711
+ if (task.getLevel() === Constants.TASK_LEVEL_CONTROL) {
1712
+ await this.handleInternalEventWithMgControlBase(task.getLastParkedCtrl(), InternalInterface.MG_ACT_CTRL_SUFFIX);
1713
+ if (this.GetStopExecutionFlag())
1714
+ return;
1715
+ }
1716
+ if (task.getMode() === Constants.TASK_MODE_CREATE && rec != null && !rec.Modified) {
1717
+ if (await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false)) {
1718
+ doSuffix = false;
1719
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
1720
+ if (this.GetStopExecutionFlag() || task.isAborting())
1721
+ return;
1722
+ }
1723
+ else {
1724
+ task.setLevel(Constants.TASK_LEVEL_TASK);
1725
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
1726
+ if (!this.GetStopExecutionFlag() && form != null) {
1727
+ let lastParkedControl = task.getLastParkedCtrl();
1728
+ if (lastParkedControl !== null)
1729
+ await lastParkedControl.invoke();
1730
+ }
1731
+ return;
1732
+ }
1733
+ }
1734
+ let refDoSuffix = new RefParam(doSuffix);
1735
+ if (await this.DoTaskLevelRecordSuffix(task, refDoSuffix))
1736
+ return;
1737
+ doSuffix = refDoSuffix.value;
1738
+ if (form != null) {
1739
+ if ((task.getMode() !== Constants.TASK_MODE_CREATE) || !task.ConfirmUpdateNo)
1740
+ await form.addRec(doSuffix, intEvtCode == InternalInterface.MG_ACT_CRELINE_ABOVE ? true : false);
1741
+ }
1742
+ await this.DoTaskLevelRecordPrefix(task);
1743
+ await this.HandleActEnterRowEditing(task);
1744
+ }
1745
+ finally {
1746
+ task.setInCreateLine(false);
1747
+ }
1748
+ break;
1749
+ case InternalInterface.MG_ACT_CANCEL:
1750
+ await this.HandleActCancel(evt, task, form, ctrl, rec, true);
1751
+ break;
1752
+ case InternalInterface.MG_ACT_ENTER_ROW_EDITING:
1753
+ await this.HandleActEnterRowEditing(task);
1754
+ break;
1755
+ case InternalInterface.MG_ACT_RT_QUIT:
1756
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_RT_QUIT);
1757
+ break;
1758
+ case InternalInterface.MG_ACT_RTO_CREATE:
1759
+ if (task.getMode() === Constants.TASK_MODE_CREATE ||
1760
+ await (task.getProp(PropInterface.PROP_TYPE_ALLOW_OPTION)).getValueBoolean()) {
1761
+ await this.gotoCreateMode(task);
1762
+ }
1763
+ break;
1764
+ case InternalInterface.MG_ACT_RTO_QUERY:
1765
+ if (task.getMode() !== Constants.TASK_MODE_QUERY &&
1766
+ (await (task.getProp(PropInterface.PROP_TYPE_ALLOW_OPTION)).getValueBoolean()) === false)
1767
+ break;
1768
+ await task.enableModes();
1769
+ oldMode = task.getOriginalTaskMode();
1770
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
1771
+ if (!this.GetStopExecutionFlag()) {
1772
+ task.setMode(Constants.TASK_MODE_QUERY);
1773
+ if (oldMode !== Constants.TASK_MODE_CREATE) {
1774
+ await dv.currRecCompute(true);
1775
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
1776
+ if (ctrl != null)
1777
+ await ctrl.invoke();
1778
+ await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
1779
+ }
1780
+ else {
1781
+ task.setPreventRecordSuffix(true);
1782
+ task.setPreventControlChange(true);
1783
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_RT_REFRESH_VIEW);
1784
+ if (ctrl != null)
1785
+ await ctrl.invoke();
1786
+ task.setPreventRecordSuffix(false);
1787
+ task.setPreventControlChange(false);
1788
+ if (!dv.isEmpty() && (dv.getCurrRec()).getMode() !== DataModificationTypes.Insert)
1789
+ task.setMode(Constants.TASK_MODE_QUERY);
1790
+ else
1791
+ task.setMode(Constants.TASK_MODE_CREATE);
1792
+ await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
1793
+ }
1794
+ task.setOriginalTaskMode(Constants.TASK_MODE_QUERY);
1795
+ await task.setCreateDeleteActsEnableState();
1796
+ }
1797
+ break;
1798
+ case InternalInterface.MG_ACT_RTO_MODIFY:
1799
+ if (task.getMode() !== Constants.TASK_MODE_MODIFY &&
1800
+ (await (task.getProp(PropInterface.PROP_TYPE_ALLOW_OPTION)).getValueBoolean()) === false)
1801
+ break;
1802
+ await task.enableModes();
1803
+ oldMode = task.getOriginalTaskMode();
1804
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
1805
+ if (!this.GetStopExecutionFlag()) {
1806
+ task.setMode(Constants.TASK_MODE_MODIFY);
1807
+ if (oldMode !== Constants.TASK_MODE_CREATE) {
1808
+ await dv.currRecCompute(true);
1809
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
1810
+ if (ctrl != null)
1811
+ await ctrl.invoke();
1812
+ }
1813
+ else {
1814
+ task.setPreventRecordSuffix(true);
1815
+ task.setPreventControlChange(true);
1816
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_RT_REFRESH_VIEW);
1817
+ if (ctrl != null)
1818
+ await ctrl.invoke();
1819
+ task.setPreventRecordSuffix(false);
1820
+ task.setPreventControlChange(false);
1821
+ if (!dv.isEmpty() && (dv.getCurrRec()).getMode() !== DataModificationTypes.Insert)
1822
+ task.setMode(Constants.TASK_MODE_MODIFY);
1823
+ else
1824
+ task.setMode(Constants.TASK_MODE_CREATE);
1825
+ await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
1826
+ }
1827
+ task.setOriginalTaskMode(Constants.TASK_MODE_MODIFY);
1828
+ await task.setCreateDeleteActsEnableState();
1829
+ }
1830
+ break;
1831
+ case InternalInterface.MG_ACT_SELECT:
1832
+ try {
1833
+ task.InSelect = true;
1834
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
1835
+ }
1836
+ finally {
1837
+ task.InSelect = false;
1838
+ }
1839
+ if (!this._stopExecution) {
1840
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_EXIT);
1841
+ }
1842
+ break;
1843
+ case InternalInterface.MG_ACT_SUBFORM_REFRESH:
1844
+ if ((evt.getArgList() != null) && (evt.getArgList().getSize() === 1)) {
1845
+ let subformCtrl = null;
1846
+ let RefreshedSubformName = await evt.getArgList().getArgValue(0, StorageAttribute.ALPHA, 0);
1847
+ if (RefreshedSubformName == null)
1848
+ break;
1849
+ for (let parentTask = task; parentTask.getForm() != null && parentTask.getMgdID() === task.getMgdID(); parentTask = parentTask.getParent()) {
1850
+ subformCtrl = parentTask.getForm().getCtrlByName(RefreshedSubformName.trim(), MgControlType.CTRL_TYPE_SUBFORM);
1851
+ if (subformCtrl != null) {
1852
+ let subformTask = subformCtrl.getSubformTask();
1853
+ if (subformTask == null) {
1854
+ if (await (subformCtrl.getProp(PropInterface.PROP_TYPE_SUBFORM_TYPE)).getValueInt() !== SubformType.None)
1855
+ await this.OpenSubform(parentTask, subformCtrl);
1856
+ }
1857
+ else
1858
+ await parentTask.SubformRefresh(subformTask, true);
1859
+ break;
1860
+ }
1861
+ }
1862
+ }
1863
+ else if ((evt.getArgList() != null) && (evt.getArgList().getSize() === 2)) {
1864
+ let subformTask = task, parentTask;
1865
+ let taskTag = await evt.getArgList().getArgValue(1, StorageAttribute.NUMERIC, 0);
1866
+ while (subformTask.IsSubForm) {
1867
+ parentTask = subformTask.getParent();
1868
+ if (subformTask.getTaskTag() === taskTag) {
1869
+ await parentTask.SubformRefresh(subformTask, true);
1870
+ break;
1871
+ }
1872
+ subformTask = parentTask;
1873
+ }
1874
+ }
1875
+ break;
1876
+ case InternalInterface.MG_ACT_SUBFORM_OPEN:
1877
+ await this.OpenSubform(task, evt.Control);
1878
+ break;
1879
+ case InternalInterface.MG_ACT_RTO_SEARCH:
1880
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
1881
+ if (!this.GetStopExecutionFlag()) {
1882
+ cmd = CommandFactory.CreateEventCommand(task.getTaskTag(), intEvtCode);
1883
+ task.getTaskCache().clearCache();
1884
+ await task.DataviewManager.Execute(cmd);
1885
+ if (!form.isScreenMode()) {
1886
+ dv.setTopRecIdx(0);
1887
+ if (form.HasTable()) {
1888
+ await form.restoreOldDisplayLine(form.recordIdx2DisplayLine(dv.getCurrRecIdx()));
1889
+ }
1890
+ }
1891
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
1892
+ if (ctrl != null)
1893
+ await ctrl.invoke();
1894
+ }
1895
+ break;
1896
+ case InternalInterface.MG_ACT_RT_REFRESH_SCREEN:
1897
+ case InternalInterface.MG_ACT_RT_REFRESH_VIEW:
1898
+ case InternalInterface.MG_ACT_RT_REFRESH_RECORD:
1899
+ await this.handleRefreshEvents(evt);
1900
+ break;
1901
+ case InternalInterface.MG_ACT_ACT_CLOSE_APPL:
1902
+ cmd =
1903
+ CommandFactory.CreateEventCommand(MGDataCollection.Instance.StartupMgData.getFirstTask().getTaskTag(), InternalInterface.MG_ACT_BROWSER_ESC);
1904
+ cmdsToServer.Add(cmd);
1905
+ await server.Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
1906
+ break;
1907
+ case InternalInterface.MG_ACT_CONTEXT_REMOVE:
1908
+ let currRecord = LastFocusedManager.Instance.getLastFocusedTask().DataView.getCurrRec();
1909
+ if (ClientManager.TransCacheExists() || (currRecord != null && currRecord.Modified)) {
1910
+ console.log('Pending transaction/record is modified, discarded \'Context Remove\' event.');
1911
+ }
1912
+ else {
1913
+ if (Environment.Instance.getClientContextInactivityTimeout() > 0) {
1914
+ await this.ExecuteClientContextInactivityTimer();
1915
+ }
1916
+ if (!EventsManager.clientContextInactivityTimerAborted) {
1917
+ let contextTerminationEventCommand = CommandFactory.CreateContextTerminationEventCommand(MGDataCollection.Instance.StartupMgData.getFirstTask().getTaskTag());
1918
+ MGDataCollection.Instance.getCurrMGData().CmdsToServer.Add(contextTerminationEventCommand);
1919
+ RemoteCommandsProcessor.GetInstance().Execute(CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS);
1920
+ console.log('Removed context from server');
1921
+ RuntimeContextBase.Instance.RemovingContextFromServer = true;
1922
+ }
1923
+ else {
1924
+ console.log('Discarded \'Context Remove\' event as user event occurred.');
1925
+ EventsManager.clientContextInactivityTimerAborted = false;
1926
+ break;
1927
+ }
1928
+ }
1929
+ break;
1930
+ case InternalInterface.MG_ACT_SERVER_TERMINATION:
1931
+ case InternalInterface.MG_ACT_DUMP_ENVIRONMENT:
1932
+ cmd = CommandFactory.CreateEventCommand(task.getTaskTag(), intEvtCode);
1933
+ cmdsToServer.Add(cmd);
1934
+ await CommandsProcessorManager.GetCommandsProcessor().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
1935
+ break;
1936
+ case InternalInterface.MG_ACT_RT_EDT_NULL:
1937
+ if (this._currField != null && this._currField.NullAllowed) {
1938
+ await this._currField.setValueAndStartRecompute(this._currField.getMagicDefaultValue(), true, true, true, false);
1939
+ await this._currField.updateDisplay();
1940
+ }
1941
+ break;
1942
+ case InternalInterface.MG_ACT_ROLLBACK:
1943
+ await EventsManager.HandleRollbackAction(task, cmdsToServer, RollbackEventCommand_RollbackType.ROLLBACK);
1944
+ break;
1945
+ case InternalInterface.MG_ACT_OK:
1946
+ case InternalInterface.MG_ACT_INDEX_CHANGE:
1947
+ case InternalInterface.MG_ACT_COL_SORT:
1948
+ if ((intEvtCode === InternalInterface.MG_ACT_INDEX_CHANGE && task.DataviewManager.HasRemoteData) ||
1949
+ (intEvtCode === InternalInterface.MG_ACT_COL_SORT && ctrl.getField() != null)) {
1950
+ let lastFocusedTask = LastFocusedManager.Instance.getLastFocusedTask();
1951
+ let focusedCtrl = LastFocusedManager.getLastFocusedControl(LastFocusedManager.LastFocusMgdID);
1952
+ if (focusedCtrl != null)
1953
+ await this.handleInternalEventWithMgControlBase(focusedCtrl, InternalInterface.MG_ACT_CTRL_SUFFIX);
1954
+ if (!this.GetStopExecutionFlag())
1955
+ await task.ExecuteNestedRS(lastFocusedTask);
1956
+ if (!this.GetStopExecutionFlag() && task.getLevel() !== Constants.TASK_LEVEL_TASK)
1957
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
1958
+ if (!this.GetStopExecutionFlag()) {
1959
+ task.getTaskCache().clearCache();
1960
+ if (intEvtCode === InternalInterface.MG_ACT_INDEX_CHANGE) {
1961
+ let taskForm = task.getForm();
1962
+ if (taskForm.HasTable())
1963
+ form.clearTableColumnSortMark(true);
1964
+ cmd = await CommandFactory.CreateIndexChangeCommand(task.getTaskTag(), task.DataView.GetCurrentRecId(), evt.getArgList());
1965
+ }
1966
+ else {
1967
+ cmd = CommandFactory.CreateColumnSortCommand(task.getTaskTag(), evt.Direction, ctrl.getDitIdx(), ctrl.getField().getId(), task.DataView.GetCurrentRecId());
1968
+ }
1969
+ await task.DataviewManager.Execute(cmd);
1970
+ dv.setTopRecIdx(0);
1971
+ await form.restoreOldDisplayLine(0);
1972
+ if (!(task === LastFocusedManager.Instance.getLastFocusedTask() || !task.pathContains(LastFocusedManager.Instance.getLastFocusedTask()))) {
1973
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
1974
+ if (!this.GetStopExecutionFlag() && !task.getPreventControlChange())
1975
+ await lastFocusedTask.ExecuteNestedRS(task);
1976
+ if (!this.GetStopExecutionFlag() && focusedCtrl != null)
1977
+ await focusedCtrl.invoke();
1978
+ }
1979
+ else
1980
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
1981
+ }
1982
+ }
1983
+ break;
1984
+ case InternalInterface.MG_ACT_COL_CLICK:
1985
+ if (!this.GetStopExecutionFlag() && evt.isGuiTriggeredEvent() && ctrl.isColumnSortable()) {
1986
+ let columnChildControl = ctrl.getColumnChildControl();
1987
+ if (columnChildControl != null) {
1988
+ let aRtEvt = new RunTimeEvent(columnChildControl, evt.Direction, 0);
1989
+ aRtEvt.setInternal(InternalInterface.MG_ACT_COL_SORT);
1990
+ this.addToTail(aRtEvt);
1991
+ }
1992
+ }
1993
+ break;
1994
+ }
1995
+ }
1996
+ }
1997
+ finally {
1998
+ this.popRtEvent();
1999
+ }
2000
+ }
2001
+ async HandleActEnterRowEditing(task) {
2002
+ if (task.getMode() === Constants.TASK_MODE_QUERY)
2003
+ task.WriteToMessagePane(`Cannot enter Row Editing when in Query Mode.`);
2004
+ else {
2005
+ let myform = task.getForm();
2006
+ await myform.startRowEditing(myform.DisplayLine);
2007
+ }
2008
+ }
2009
+ async HandleStopRowEditing(task) {
2010
+ let myform = task.getForm();
2011
+ await myform.stopRowEditing(myform.DisplayLine);
2012
+ }
2013
+ async OpenSubform(task, subformControl) {
2014
+ task.TaskService.RemoveRecomputes(task);
2015
+ let cmd = CommandFactory.CreateSubformOpenCommand(task.getTaskTag(), subformControl.getDitIdx());
2016
+ task.getMGData().CmdsToServer.Add(cmd);
2017
+ await Task.CommandsProcessor.Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
2018
+ }
2019
+ static async HandleRollbackAction(task, cmdsToServer, rollbackType) {
2020
+ let commandsProcessor = Task.CommandsProcessor;
2021
+ ClientRefreshCommand.ClientIsInRollbackCommand = true;
2022
+ task = task.TaskService.GetOwnerTransactionTask(task);
2023
+ let cmd = CommandFactory.CreateRollbackEventCommand(task.getTaskTag(), rollbackType);
2024
+ cmdsToServer.Add(cmd);
2025
+ await commandsProcessor.Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
2026
+ ClientRefreshCommand.ClientIsInRollbackCommand = false;
2027
+ }
2028
+ async HandleActCancel(evt, task, form, ctrl, rec, isMG_ACT_CANCEL) {
2029
+ if (task.InHandleActCancel)
2030
+ return;
2031
+ task.InHandleActCancel = true;
2032
+ let oldMode = task.getMode();
2033
+ let saveDisplayLine = task.getForm().DisplayLine;
2034
+ if (oldMode !== Constants.TASK_MODE_QUERY && !rec.Updated) {
2035
+ if (isMG_ACT_CANCEL) {
2036
+ if (rec.Modified || (task.getLastParkedCtrl() !== null && task.getLastParkedCtrl().ModifiedByUser)) {
2037
+ if (await task.checkProp(PropInterface.PROP_TYPE_CONFIRM_CANCEL, false)) {
2038
+ let confirmed = await GUIManager.Instance.confirm_bool(MsgInterface.CONFIRM_STR_CANCEL);
2039
+ if (!confirmed) {
2040
+ task.InHandleActCancel = false;
2041
+ return;
2042
+ }
2043
+ }
2044
+ }
2045
+ }
2046
+ let oldRecMode = rec.getMode();
2047
+ if (GuiEnvironment.Environment.GetSpecialCancelOnCreate() && task.getMode() == Constants.TASK_MODE_CREATE
2048
+ && task.getOriginalTaskMode() == Constants.TASK_MODE_CREATE) {
2049
+ let enable = await task.checkProp(PropInterface.PROP_TYPE_ALLOW_MODIFY, true);
2050
+ if (enable) {
2051
+ let allowEmptyDataView = await task.checkProp(PropInterface.PROP_TYPE_ALLOW_EMPTY_DATAVIEW, true);
2052
+ if (task.DataView.getSize() == 1 && allowEmptyDataView) {
2053
+ task.setMode('M');
2054
+ task.DataView.setEmptyDataview(true);
2055
+ }
2056
+ }
2057
+ }
2058
+ if (isMG_ACT_CANCEL) {
2059
+ if (task.isTransactionOnLevel(ConstInterface.TRANS_RECORD_PREFIX) && evt.RollbackInCancel()) {
2060
+ await EventsManager.HandleRollbackAction(task, task.getMGData().CmdsToServer, RollbackEventCommand_RollbackType.CANCEL);
2061
+ }
2062
+ }
2063
+ await EventsManager.HandleCancelEdit(evt, task, form, rec, oldRecMode);
2064
+ }
2065
+ else {
2066
+ task.setLevel(Constants.TASK_LEVEL_TASK);
2067
+ let lastFocusedControl = LastFocusedManager.getLastFocusedControl();
2068
+ if (lastFocusedControl !== null) {
2069
+ lastFocusedControl.getForm().getTask().setLevel(Constants.TASK_LEVEL_TASK);
2070
+ }
2071
+ if (!evt.isQuit()) {
2072
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
2073
+ await this.HandleParkabilityOnRowChange(task);
2074
+ }
2075
+ }
2076
+ if (evt.isQuit())
2077
+ await this.handleInternalEventWithMgControlBase(ctrl, InternalInterface.MG_ACT_EXIT);
2078
+ await form.stopRowEditing(saveDisplayLine);
2079
+ task.InHandleActCancel = false;
2080
+ }
2081
+ static async HandleCancelEdit(evt, task, form, rec, oldRecMode) {
2082
+ if (rec.Synced && oldRecMode === DataModificationTypes.Insert)
2083
+ rec.setMode(oldRecMode);
2084
+ if (form !== null) {
2085
+ if (task.getLastParkedCtrl() !== null)
2086
+ task.getLastParkedCtrl().resetPrevVal();
2087
+ await form.cancelEdit(true, evt.isQuit());
2088
+ }
2089
+ }
2090
+ async HandleActionDelline(task, dv, rec, nonInteractiveDelete) {
2091
+ let lastParkedCtrl;
2092
+ let myform = task.getForm();
2093
+ let saveIsRowEditing = myform.getIsRowEditingFromGui(myform.DisplayLine);
2094
+ let oldRecMode;
2095
+ if (await task.checkProp(PropInterface.PROP_TYPE_ALLOW_DELETE, true)) {
2096
+ lastParkedCtrl = task.getLastParkedCtrl();
2097
+ if (lastParkedCtrl !== null)
2098
+ await this.handleInternalEventWithMgControlBase(lastParkedCtrl, InternalInterface.MG_ACT_CTRL_SUFFIX);
2099
+ if (!this.GetStopExecutionFlag()) {
2100
+ oldRecMode = rec.getMode();
2101
+ rec.clearMode();
2102
+ rec.setMode(DataModificationTypes.Delete);
2103
+ if (oldRecMode === DataModificationTypes.Insert)
2104
+ rec.setSendToServer(false);
2105
+ if (rec.Modified || await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false)) {
2106
+ task.setMode(Constants.TASK_MODE_MODIFY);
2107
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
2108
+ if (this._stopExecution) {
2109
+ if (!rec.SendToServer) {
2110
+ await dv.addCurrToModified();
2111
+ rec.setSendToServer(true);
2112
+ }
2113
+ rec.clearMode();
2114
+ rec.setMode(oldRecMode);
2115
+ this.setStopExecution(false);
2116
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
2117
+ this.setStopExecution(true);
2118
+ return true;
2119
+ }
2120
+ }
2121
+ rec.setInDeleteProcess(true);
2122
+ task.setMode(Constants.TASK_MODE_DELETE);
2123
+ let skipConfirmDialog = nonInteractiveDelete;
2124
+ if (!skipConfirmDialog) {
2125
+ if (task.mustConfirmInDeleteMode() || await task.checkProp(PropInterface.PROP_TYPE_CONFIRM_UPDATE, false)) {
2126
+ let confirmed = await GUIManager.Instance.confirm_bool(MsgInterface.CONFIRM_STR_DELETE);
2127
+ if (!confirmed) {
2128
+ rec.clearMode();
2129
+ rec.setMode(oldRecMode);
2130
+ task.setMode(Constants.TASK_MODE_MODIFY);
2131
+ if (lastParkedCtrl !== null)
2132
+ await this.handleInternalEventWithMgControlBase(lastParkedCtrl, InternalInterface.MG_ACT_CTRL_PREFIX);
2133
+ if (saveIsRowEditing) {
2134
+ let myform = task.getForm();
2135
+ await myform.startRowEditing(myform.DisplayLine);
2136
+ }
2137
+ return true;
2138
+ }
2139
+ }
2140
+ }
2141
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
2142
+ rec.setInDeleteProcess(false);
2143
+ if (this._stopExecution) {
2144
+ if (!rec.SendToServer) {
2145
+ await dv.addCurrToModified();
2146
+ rec.setSendToServer(true);
2147
+ }
2148
+ rec.clearMode();
2149
+ rec.setMode(oldRecMode);
2150
+ this.setStopExecution(false);
2151
+ task.setMode(Constants.TASK_MODE_MODIFY);
2152
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
2153
+ this.setStopExecution(true);
2154
+ return true;
2155
+ }
2156
+ if (oldRecMode === DataModificationTypes.Insert) {
2157
+ rec.clearMode();
2158
+ rec.setMode(oldRecMode);
2159
+ }
2160
+ let newCurrRec = dv.getCurrRec();
2161
+ try {
2162
+ if (rec !== newCurrRec)
2163
+ await dv.setCurrRec(rec.getId(), false);
2164
+ if (!task.isAborting())
2165
+ await this.delCurrRec(task, false);
2166
+ }
2167
+ finally {
2168
+ if (rec !== newCurrRec) {
2169
+ await dv.setCurrRec(newCurrRec.getId(), false);
2170
+ if (dv.getSize() === 1)
2171
+ task.setMode(Constants.TASK_MODE_CREATE);
2172
+ }
2173
+ if (nonInteractiveDelete)
2174
+ task.setMode(Constants.TASK_MODE_DELETE);
2175
+ }
2176
+ }
2177
+ }
2178
+ return false;
2179
+ }
2180
+ async handleRefreshEvents(evt) {
2181
+ let task = evt.getTask();
2182
+ let form = task.getForm();
2183
+ let dv = task.DataView;
2184
+ let intEvtCode = evt.getInternalCode();
2185
+ let cmd = null;
2186
+ if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_RECORD)
2187
+ this._isInRecordFlushEvent = true;
2188
+ if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_VIEW && task.getMode() === Constants.TASK_MODE_CREATE && !await task.checkProp(PropInterface.PROP_TYPE_ALLOW_MODIFY, true)) {
2189
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_EXIT);
2190
+ }
2191
+ else {
2192
+ await task.ExecuteNestedRS(LastFocusedManager.Instance.getLastFocusedTask());
2193
+ if (!this.GetStopExecutionFlag()) {
2194
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
2195
+ }
2196
+ if (!this.GetStopExecutionFlag() && !task.InEndTask && !task.isAborting()) {
2197
+ if (intEvtCode !== InternalInterface.MG_ACT_RT_REFRESH_SCREEN) {
2198
+ let currentRow = 0;
2199
+ if (!evt.getRefreshType()) {
2200
+ if (evt.RtViewRefreshUseCurrentRow() && task.IsInteractive) {
2201
+ currentRow = form.getCurrRecPosInForm();
2202
+ }
2203
+ cmd = CommandFactory.CreateInternalRefreshCommand(task.getTaskTag(), intEvtCode, dv.CurrentRecId, currentRow);
2204
+ }
2205
+ else {
2206
+ if (task.IsInteractive)
2207
+ currentRow = form.getCurrRecPosInForm();
2208
+ let refetchRecord = true;
2209
+ if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_RECORD && evt.getArgList() !== null && evt.getArgList().getSize() !== 0) {
2210
+ let refetchRecStr;
2211
+ refetchRecStr = await evt.getArgList().getArgValue(0, StorageAttribute.BOOLEAN, 0);
2212
+ refetchRecord = (isNullOrUndefined(refetchRecStr) || refetchRecStr === '1');
2213
+ }
2214
+ if (refetchRecord)
2215
+ cmd = await CommandFactory.CreateRealRefreshCommand(task.getTaskTag(), intEvtCode, currentRow, evt.getArgList(), dv.CurrentRecId);
2216
+ }
2217
+ }
2218
+ else {
2219
+ let id;
2220
+ if (task.getForm() === null)
2221
+ id = 0;
2222
+ else if (task.getForm().isScreenMode())
2223
+ id = (task.DataView.getCurrRec()).getId();
2224
+ else
2225
+ id = task.DataView.getRecByIdx(task.DataView.getTopRecIdx()).getId();
2226
+ cmd = CommandFactory.CreateScreenRefreshCommand(task.getTaskTag(), id, dv.CurrentRecId);
2227
+ }
2228
+ if (intEvtCode !== InternalInterface.MG_ACT_RT_REFRESH_SCREEN)
2229
+ task.getTaskCache().clearCache();
2230
+ if (cmd !== null)
2231
+ await task.DataviewManager.Execute(cmd);
2232
+ this._isInRecordFlushEvent = false;
2233
+ if (!this.GetStopExecutionFlag() && !task.InEndTask && !task.isAborting()) {
2234
+ if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_VIEW && !form.isScreenMode()) {
2235
+ dv.setTopRecIdx(0);
2236
+ if (form.HasTable()) {
2237
+ form.clearTableColumnSortMark(true);
2238
+ await form.restoreOldDisplayLine(form.recordIdx2DisplayLine(dv.getCurrRecIdx()));
2239
+ }
2240
+ }
2241
+ if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_RECORD && task.getMode() !== Constants.TASK_MODE_QUERY && !task.getAfterRetry()) {
2242
+ if (task.getMode() === Constants.TASK_MODE_CREATE) {
2243
+ task.setMode(Constants.TASK_MODE_MODIFY);
2244
+ (task.DataView.getCurrRec()).setOldRec();
2245
+ }
2246
+ await dv.currRecCompute(true);
2247
+ }
2248
+ else if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_SCREEN && task.getMode() !== Constants.TASK_MODE_QUERY && !task.getAfterRetry()) {
2249
+ await dv.currRecCompute(true);
2250
+ }
2251
+ this.setIsInViewRefresh(true);
2252
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
2253
+ if (!this.GetStopExecutionFlag() && !task.getPreventControlChange()) {
2254
+ if (!(task === LastFocusedManager.Instance.getLastFocusedTask() || !task.pathContains(LastFocusedManager.Instance.getLastFocusedTask())))
2255
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
2256
+ }
2257
+ }
2258
+ }
2259
+ }
2260
+ }
2261
+ async gotoCreateMode(task) {
2262
+ let cmd;
2263
+ await task.enableModes();
2264
+ await task.ExecuteNestedRS(LastFocusedManager.Instance.getLastFocusedTask());
2265
+ if (!this.GetStopExecutionFlag())
2266
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
2267
+ if (!this.GetStopExecutionFlag()) {
2268
+ cmd = CommandFactory.CreateEventCommand(task.getTaskTag(), InternalInterface.MG_ACT_RTO_CREATE);
2269
+ await task.DataviewManager.Execute(cmd);
2270
+ if (task.getLevel() === Constants.TASK_LEVEL_TASK)
2271
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
2272
+ await this.HandleNonParkableControls(task);
2273
+ await task.setCreateDeleteActsEnableState();
2274
+ task.setOriginalTaskMode(Constants.TASK_MODE_CREATE);
2275
+ await this.HandleActEnterRowEditing(task);
2276
+ }
2277
+ }
2278
+ async commonHandlerAfter(evt, rcBefore) {
2279
+ let task = evt.getTask();
2280
+ let dv;
2281
+ let rec = null;
2282
+ let ctrl;
2283
+ let recModified = false;
2284
+ let recModeIsDelete = false;
2285
+ let forceSuffix;
2286
+ if (this._stopExecution && evt.getInternalCode() !== InternalInterface.MG_ACT_REC_SUFFIX && evt.getInternalCode() !== InternalInterface.MG_ACT_CTRL_SUFFIX)
2287
+ return;
2288
+ if (evt.getType() === ConstInterface.EVENT_TYPE_INTERNAL) {
2289
+ dv = task.DataView;
2290
+ rec = dv.getCurrRec();
2291
+ ctrl = evt.Control;
2292
+ switch (evt.getInternalCode()) {
2293
+ case InternalInterface.MG_ACT_REC_PREFIX:
2294
+ if (rcBefore) {
2295
+ if (await task.CheckRefreshSubTasks())
2296
+ await task.doSubformRecPrefixSuffix();
2297
+ await task.handleEventOnSlaveTasks(InternalInterface.MG_ACT_REC_PREFIX);
2298
+ await task.enableModes();
2299
+ }
2300
+ break;
2301
+ case InternalInterface.MG_ACT_REC_SUFFIX:
2302
+ task.isFirstRecordCycle(false);
2303
+ if (task.getPreventRecordSuffix()) {
2304
+ task.setPreventRecordSuffix(false);
2305
+ return;
2306
+ }
2307
+ task.DoSubformPrefixSuffix = false;
2308
+ if (this._stopExecution) {
2309
+ if (rec.getMode() === DataModificationTypes.Delete)
2310
+ rec.clearMode();
2311
+ if (task.getLevel() !== Constants.TASK_LEVEL_CONTROL) {
2312
+ let last = this.getStopExecutionCtrl();
2313
+ if (last === null)
2314
+ last = task.getLastParkedCtrl();
2315
+ this.setStopExecution(false);
2316
+ this.setStopExecutionCtrl(null);
2317
+ if (last != null) {
2318
+ task.setLevel(Constants.TASK_LEVEL_RECORD);
2319
+ let inCtrlPrefix = task.InCtrlPrefix;
2320
+ task.InCtrlPrefix = false;
2321
+ await this.handleInternalEventWithMgControlBase(last, InternalInterface.MG_ACT_CTRL_PREFIX);
2322
+ task.InCtrlPrefix = inCtrlPrefix;
2323
+ }
2324
+ this.setStopExecution(true);
2325
+ }
2326
+ return;
2327
+ }
2328
+ else {
2329
+ await this.HandleStopRowEditing(task);
2330
+ }
2331
+ if (rec != null) {
2332
+ recModified = rec.Modified;
2333
+ if (!this._stopExecution && rec.isCauseInvalidation()) {
2334
+ task.getForm().invalidateTable();
2335
+ rec.setCauseInvalidation(false);
2336
+ }
2337
+ recModeIsDelete = (rec.getMode() === DataModificationTypes.Delete);
2338
+ forceSuffix = await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false);
2339
+ if (recModeIsDelete && task.getMode() === Constants.TASK_MODE_DELETE ||
2340
+ !recModeIsDelete && !rec.inDeleteProcess() && (recModified || forceSuffix)) {
2341
+ rec.setMode(DataModificationTypes.Update);
2342
+ await dv.addCurrToModified();
2343
+ dv.setChanged(true);
2344
+ if (recModified && task.getMode() === Constants.TASK_MODE_QUERY) {
2345
+ if (rec.realModified() &&
2346
+ !Environment.Instance.allowUpdateInQueryMode(task.getCompIdx())) {
2347
+ await dv.cancelEdit(EventsManager.REAL_ONLY, false);
2348
+ task.WriteToMessagePanebyMsgId(MsgInterface.RT_STR_UPDATE_IN_QUERY);
2349
+ await task.getForm().RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
2350
+ }
2351
+ }
2352
+ }
2353
+ if (!this.isForceExitPreRecordUpdate(task) &&
2354
+ (!task.isAborting() || MGDataCollection.Instance.GetTaskByID(task.getTaskTag()) != null)) {
2355
+ if ((!recModeIsDelete || task.getMode() === Constants.TASK_MODE_DELETE))
2356
+ await this.commitRecord(task, evt.reversibleExit());
2357
+ }
2358
+ if (!task.transactionFailed(ConstInterface.TRANS_RECORD_PREFIX) && !task.isAborting()) {
2359
+ if ((rec.getMode() === DataModificationTypes.Delete &&
2360
+ task.getMode() === Constants.TASK_MODE_DELETE) ||
2361
+ rec.getMode() !== DataModificationTypes.Delete)
2362
+ if (await task.evalEndCond(ConstInterface.END_COND_EVAL_AFTER))
2363
+ await task.endTask(true, false, false);
2364
+ }
2365
+ }
2366
+ break;
2367
+ case InternalInterface.MG_ACT_CTRL_PREFIX:
2368
+ if (rcBefore) {
2369
+ if (await ctrl.IsParkable() || ctrl === LastFocusedManager.getLastFocusedControl()) {
2370
+ ctrl.InControl = true;
2371
+ if (ctrl.ShouldRefreshOnControlEnter())
2372
+ await ctrl.getField().updateDisplay();
2373
+ task.setLastParkedCtrl(ctrl);
2374
+ RuntimeContextBase.Instance.CurrentClickedCtrl = null;
2375
+ await ctrl.SetFocus(ctrl, ctrl.getDisplayLine(false), true);
2376
+ this.setStopExecutionCtrl(null);
2377
+ MgControl.ReturnToCtrl = ctrl;
2378
+ task.InCtrlPrefix = false;
2379
+ }
2380
+ else {
2381
+ task.InCtrlPrefix = false;
2382
+ await this.HandleNonParkableControls(ctrl.getForm().getTask());
2383
+ }
2384
+ }
2385
+ break;
2386
+ case InternalInterface.MG_ACT_CTRL_SUFFIX:
2387
+ if (!this.GetStopExecutionFlag()) {
2388
+ if (ctrl.isChoiceControl()) {
2389
+ ctrl.SetKeyboardLanguage();
2390
+ }
2391
+ if (ctrl.Type === MgControlType.CTRL_TYPE_BUTTON)
2392
+ task.ActionManager.enable(InternalInterface.MG_ACT_BUTTON, false);
2393
+ if (task.getEnableZoomHandler() || ctrl.useZoomHandler())
2394
+ task.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, false);
2395
+ task.ActionManager.enable(InternalInterface.MG_ACT_RT_EDT_NULL, false);
2396
+ }
2397
+ if (rcBefore) {
2398
+ if (this.GetStopExecutionFlag()) {
2399
+ ctrl.InControl = true;
2400
+ return;
2401
+ }
2402
+ let fld = ctrl.getField();
2403
+ if (fld != null && (ctrl.Type === MgControlType.CTRL_TYPE_TEXT))
2404
+ await fld.updateDisplay();
2405
+ task.setLevel(Constants.TASK_LEVEL_RECORD);
2406
+ ctrl.setInControlSuffix(false);
2407
+ ctrl.IsInteractiveUpdate = false;
2408
+ if (ctrl.PropertyExists(PropInterface.PROP_TYPE_CUSTOM_VALIDATORS))
2409
+ await ctrl.getProp(PropInterface.PROP_TYPE_CUSTOM_VALIDATORS).RefreshDisplay(true);
2410
+ ctrl.ValidateControl = false;
2411
+ LastFocusedManager.setLastFocusedControl(task, null);
2412
+ if (await task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE))
2413
+ await task.endTask(true, false, false);
2414
+ }
2415
+ break;
2416
+ case InternalInterface.MG_ACT_TASK_PREFIX:
2417
+ task.setLevel(Constants.TASK_LEVEL_TASK);
2418
+ break;
2419
+ case InternalInterface.MG_ACT_TASK_SUFFIX:
2420
+ task.setLevel(Constants.TASK_LEVEL_NONE);
2421
+ break;
2422
+ case InternalInterface.MG_ACT_CYCLE_NEXT_REC:
2423
+ let form = task.getForm();
2424
+ if (!task.isMainProg() && form != null) {
2425
+ await form.moveInView(form.isLineMode()
2426
+ ? Constants.MOVE_UNIT_ROW
2427
+ : Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_NEXT);
2428
+ if (task.getExecEndTask())
2429
+ await task.endTask(true, false, false);
2430
+ }
2431
+ break;
2432
+ case InternalInterface.MG_ACT_CYCLE_NEXT_DELETE_REC:
2433
+ if (task.DataView.isEmptyDataview())
2434
+ (task).setExecEndTask();
2435
+ else
2436
+ await this.HandleActionDelline(task, dv, rec, true);
2437
+ if (task.getExecEndTask())
2438
+ await task.endTask(true, false, false);
2439
+ break;
2440
+ case InternalInterface.MG_ACT_SET_EXTERNAL_VALUE:
2441
+ let refreshDisplay = await evt.getArgList().getArgValue(1, StorageAttribute.BOOLEAN, 0) === '1' ? true : false;
2442
+ await ctrl.validateAndSetValueIfAllowed(evt.getValue(), refreshDisplay);
2443
+ break;
2444
+ }
2445
+ }
2446
+ }
2447
+ async handleNonReversibleEvent(task, eventCode) {
2448
+ let rtEvt = new RunTimeEvent(task);
2449
+ let exitCommand = (eventCode === InternalInterface.MG_ACT_EXIT || eventCode === InternalInterface.MG_ACT_CLOSE);
2450
+ rtEvt.setInternal(eventCode);
2451
+ if (exitCommand)
2452
+ this._isNonReversibleExit = true;
2453
+ try {
2454
+ rtEvt.setNonReversibleExit();
2455
+ rtEvt.setCtrl(task.getLastParkedCtrl());
2456
+ rtEvt.setArgList(null);
2457
+ await this.handleEvent(rtEvt, false);
2458
+ }
2459
+ finally {
2460
+ if (exitCommand)
2461
+ this._isNonReversibleExit = false;
2462
+ }
2463
+ }
2464
+ async handleInternalEventWithTaskAndEventSubtype(task, eventCode, eventSubType) {
2465
+ let lastParkedCtrl = task.getLastParkedCtrl();
2466
+ let rtEvt;
2467
+ if (eventCode < InternalInterface.MG_ACT_TOT_CNT && task != null && !(eventSubType === EventSubType.CancelIsQuit) && !task.ActionManager.isEnabled(eventCode))
2468
+ return;
2469
+ if (lastParkedCtrl !== null)
2470
+ await this.handleInternalEventWithMgControl(lastParkedCtrl, eventCode, eventSubType);
2471
+ else {
2472
+ if (eventCode === InternalInterface.MG_ACT_RT_QUIT)
2473
+ await this.handleInternalEventWithTaskAndEventSubtype(task, InternalInterface.MG_ACT_CANCEL, EventSubType.CancelIsQuit);
2474
+ else {
2475
+ rtEvt = new RunTimeEvent(task);
2476
+ rtEvt.setInternal(eventCode);
2477
+ rtEvt.SetEventSubType(eventSubType);
2478
+ if (InternalInterface.BuiltinEvent(eventCode))
2479
+ await this.handleEvent(rtEvt, false);
2480
+ else
2481
+ await this.commonHandler(rtEvt);
2482
+ }
2483
+ }
2484
+ }
2485
+ async handleInternalEventWithMgControl(ctrl, eventCode, eventSubType) {
2486
+ let rtEvt;
2487
+ if (eventCode === InternalInterface.MG_ACT_RT_QUIT)
2488
+ await this.handleInternalEventWithMgControl(ctrl, InternalInterface.MG_ACT_CANCEL, EventSubType.CancelIsQuit);
2489
+ else {
2490
+ rtEvt = new RunTimeEvent(ctrl);
2491
+ rtEvt.setInternal(eventCode);
2492
+ rtEvt.SetEventSubType(eventSubType);
2493
+ if (eventCode === InternalInterface.MG_ACT_RT_REFRESH_VIEW)
2494
+ rtEvt.setIsRealRefresh(false);
2495
+ if (InternalInterface.BuiltinEvent(eventCode))
2496
+ await this.handleEvent(rtEvt, false);
2497
+ else
2498
+ await this.commonHandler(rtEvt);
2499
+ }
2500
+ }
2501
+ getCurrField() {
2502
+ return this._currField;
2503
+ }
2504
+ getCurrCtrl() {
2505
+ return this._currCtrl;
2506
+ }
2507
+ getCurrTask() {
2508
+ if (this._currField == null)
2509
+ return null;
2510
+ return this._currField.getTask();
2511
+ }
2512
+ setStopExecution(stop, clearEventsOnStopExecution) {
2513
+ if (arguments.length === 1)
2514
+ this.setStopExecution_0(stop);
2515
+ else
2516
+ this.setStopExecution_1(stop, clearEventsOnStopExecution);
2517
+ }
2518
+ setStopExecution_0(stop) {
2519
+ this.setStopExecution(stop, ClearEventsOnStopExecution.ALL);
2520
+ }
2521
+ setStopExecution_1(stop, clearEventsOnStopExecution) {
2522
+ if (stop)
2523
+ if (clearEventsOnStopExecution == ClearEventsOnStopExecution.ALL)
2524
+ this._eventsQueue.clear();
2525
+ else if (clearEventsOnStopExecution == ClearEventsOnStopExecution.SERVER) {
2526
+ let tmpVec = new List();
2527
+ let rtEvt;
2528
+ let i;
2529
+ while (!this._eventsQueue.isEmpty()) {
2530
+ rtEvt = this._eventsQueue.poll();
2531
+ if (rtEvt.isFromServer()) {
2532
+ rtEvt.resetFromServer();
2533
+ tmpVec.push(rtEvt);
2534
+ }
2535
+ }
2536
+ for (i = 0; i < tmpVec.length; i++)
2537
+ this._eventsQueue.put(tmpVec.get_Item(i));
2538
+ }
2539
+ this._stopExecution = stop;
2540
+ }
2541
+ setStopExecutionCtrl(ctrl) {
2542
+ if (this._stopExecutionCtrl === null || ctrl === null)
2543
+ this._stopExecutionCtrl = ctrl;
2544
+ }
2545
+ async delCurrRec(task, inForceDel) {
2546
+ let dv = task.DataView;
2547
+ task.setMode(Constants.TASK_MODE_MODIFY);
2548
+ await task.getForm().delCurrRec();
2549
+ if (!task.DataView.isEmptyDataview()) {
2550
+ if (dv.getCurrRecIdx() >= 0) {
2551
+ if ((dv.getCurrRec()).getMode() !== DataModificationTypes.Delete && !inForceDel) {
2552
+ let ctrl = task.getLastParkedCtrl();
2553
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
2554
+ if (!this.GetStopExecutionFlag())
2555
+ if (ctrl === null)
2556
+ await this.HandleNonParkableControls(task);
2557
+ else
2558
+ await this.handleInternalEventWithMgControlBase(ctrl, InternalInterface.MG_ACT_CTRL_PREFIX);
2559
+ }
2560
+ }
2561
+ else if (!task.getInCreateLine())
2562
+ await this.handleNonReversibleEvent(task, InternalInterface.MG_ACT_EXIT);
2563
+ }
2564
+ else {
2565
+ await this.HandleNonParkableControls(task);
2566
+ await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
2567
+ }
2568
+ }
2569
+ async updateConfirmed(task) {
2570
+ let confirm;
2571
+ let answer;
2572
+ let ans;
2573
+ if (task == null)
2574
+ return false;
2575
+ confirm = await task.checkProp(PropInterface.PROP_TYPE_CONFIRM_UPDATE, false);
2576
+ if (!this._isInRecordFlushEvent && confirm && !task.DataSynced) {
2577
+ ans = await GUIManager.Instance.confirm(MsgInterface.CRF_STR_CONF_UPD, Styles.MSGBOX_ICON_QUESTION | Styles.MSGBOX_BUTTON_YES_NO_CANCEL);
2578
+ if (ans === Styles.MSGBOX_RESULT_YES)
2579
+ answer = 'Y';
2580
+ else if (ans === Styles.MSGBOX_RESULT_NO)
2581
+ answer = 'N';
2582
+ else
2583
+ answer = 'C';
2584
+ }
2585
+ else
2586
+ answer = 'Y';
2587
+ switch (answer) {
2588
+ case 'Y':
2589
+ break;
2590
+ case 'N':
2591
+ await task.getForm().cancelEdit(false, false);
2592
+ await task.getForm().RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
2593
+ task.ConfirmUpdateNo = true;
2594
+ return false;
2595
+ case 'C':
2596
+ this.setStopExecution(true);
2597
+ this.setStopExecutionCtrl(LastFocusedManager.getLastFocusedControl());
2598
+ await FocusManager.SetFocus(LastFocusedManager.getLastFocusedControl(), -1);
2599
+ return false;
2600
+ default:
2601
+ Logger.Instance.WriteExceptionToLogWithMsg('in ClientManager.Instance.updateConfirmed() illegal confirmation code: ' +
2602
+ confirm);
2603
+ break;
2604
+ }
2605
+ return true;
2606
+ }
2607
+ setCompMainPrgTab(compMainPrgTable) {
2608
+ this._compMainPrgTab = compMainPrgTable;
2609
+ }
2610
+ setEndOfWork(endOfWork_) {
2611
+ this._endOfWork = endOfWork_;
2612
+ }
2613
+ getEndOfWork() {
2614
+ return this._endOfWork;
2615
+ }
2616
+ getCompMainPrgTab() {
2617
+ return this._compMainPrgTab;
2618
+ }
2619
+ inNonReversibleExit() {
2620
+ return this._isNonReversibleExit;
2621
+ }
2622
+ pushRtEvent(rtEvt) {
2623
+ this._rtEvents.push(rtEvt);
2624
+ }
2625
+ popRtEvent() {
2626
+ if (this._rtEvents.count() === 0)
2627
+ return null;
2628
+ return this._rtEvents.pop();
2629
+ }
2630
+ storeLastSavedRouteEventOnLocalStorage() {
2631
+ let dataStorage = window.localStorage;
2632
+ if (this.getLastSavedRouteEvent() != null) {
2633
+ let rtEvt = this.getLastSavedRouteEvent();
2634
+ dataStorage.setItem(ConstInterface.LAST_ROUTE_EVENT, '1');
2635
+ dataStorage.setItem(ConstInterface.LAST_ROUTE_EVENT_SRC_TSK, JSON.stringify(rtEvt.getTask().TaskDefinitionId));
2636
+ if (rtEvt.getArgList().getSize() > 0) {
2637
+ let str = new StringBuilder();
2638
+ rtEvt.getArgList().buildXML(str);
2639
+ dataStorage.setItem(ConstInterface.LAST_ROUTE_EVENT_ARG_LIST, str.toString());
2640
+ }
2641
+ }
2642
+ }
2643
+ restoreLastSavedRouteEventFromLocalStorage() {
2644
+ let dataStorage = window.localStorage;
2645
+ let lastRouteEvent = dataStorage.getItem(ConstInterface.LAST_ROUTE_EVENT);
2646
+ if (lastRouteEvent === '1') {
2647
+ let srcTaskDefinitionStr = dataStorage.getItem(ConstInterface.LAST_ROUTE_EVENT_SRC_TSK);
2648
+ let routeArgListStr = dataStorage.getItem(ConstInterface.LAST_ROUTE_EVENT_ARG_LIST);
2649
+ let taskDefinitionId = new TaskDefinitionId();
2650
+ taskDefinitionId.fromJSON(srcTaskDefinitionStr);
2651
+ let srcTask = MGDataCollection.Instance.getCurrMGData().getTaskByTaskDefinitionID(taskDefinitionId);
2652
+ let args = null;
2653
+ if (routeArgListStr != null) {
2654
+ args = new ArgumentsList();
2655
+ args.fillList(routeArgListStr, srcTask);
2656
+ }
2657
+ EventsManager.Instance.AddLastSavedRouteEvent(srcTask, args);
2658
+ }
2659
+ }
2660
+ getLastSavedRouteEvent() {
2661
+ return this.lastSavedRouteEvent;
2662
+ }
2663
+ setLastSavedRouteEvent(rtEvt) {
2664
+ if (rtEvt == null)
2665
+ this.lastSavedRouteEvent = null;
2666
+ else
2667
+ this.lastSavedRouteEvent = rtEvt.replicate();
2668
+ }
2669
+ getLastRtEvent() {
2670
+ if (this._rtEvents.count() === 0)
2671
+ return null;
2672
+ return this._rtEvents.peek();
2673
+ }
2674
+ setIgnoreUnknownAbort(val) {
2675
+ this._ignoreUnknownAbort = val;
2676
+ }
2677
+ ignoreUnknownAbort() {
2678
+ return this._ignoreUnknownAbort;
2679
+ }
2680
+ async failTaskOverlay(taskId, mgd) {
2681
+ let cmd;
2682
+ if (taskId !== null) {
2683
+ this.setIgnoreUnknownAbort(true);
2684
+ try {
2685
+ cmd = CommandFactory.CreateNonReversibleExitCommand(taskId, false);
2686
+ mgd.CmdsToServer.Add(cmd);
2687
+ await RemoteCommandsProcessor.GetInstance().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
2688
+ }
2689
+ finally {
2690
+ this.setIgnoreUnknownAbort(false);
2691
+ }
2692
+ }
2693
+ }
2694
+ isEventScopeTrans() {
2695
+ return this._eventScope === EventScope.TRANS;
2696
+ }
2697
+ setEventScopeTrans() {
2698
+ this._eventScope = EventScope.TRANS;
2699
+ }
2700
+ clearEventScope() {
2701
+ this._eventScope = EventScope.NONE;
2702
+ }
2703
+ GetEventTime() {
2704
+ return this._eventsQueue.GetTime();
2705
+ }
2706
+ getMatchingAction(kbItm) {
2707
+ let act = 0;
2708
+ if (kbItm == null)
2709
+ return act;
2710
+ if (act === 0) {
2711
+ if (kbItm.getAction() !== 0)
2712
+ act = kbItm.getAction();
2713
+ else if (kbItm.getKeyCode() === 45 && kbItm.getModifier() === Modifiers.MODIFIER_NONE && kbItm.getStates() === 0)
2714
+ act = InternalInterface.MG_ACT_TOGGLE_INSERT;
2715
+ }
2716
+ return (act);
2717
+ }
2718
+ getExecStack() {
2719
+ return this._execStack.peek();
2720
+ }
2721
+ pushExecStack(taskId, handlerId, operIdx) {
2722
+ this._execStack.peek().push(MGDataCollection.Instance.getTaskIdById(taskId), handlerId, operIdx);
2723
+ }
2724
+ popExecStack() {
2725
+ return this._execStack.peek().pop();
2726
+ }
2727
+ pushNewExecStacks() {
2728
+ this._serverExecStack.push(null);
2729
+ this._execStack.push(new ExecutionStack());
2730
+ }
2731
+ popNewExecStacks() {
2732
+ this._serverExecStack.pop();
2733
+ this._execStack.pop();
2734
+ }
2735
+ pushServerExecStack(taskId, handlerId, operIdx) {
2736
+ if (this._serverExecStack.peek() === null) {
2737
+ this._serverExecStack.pop();
2738
+ this._serverExecStack.push(new ExecutionStack());
2739
+ }
2740
+ this._serverExecStack.peek().push(taskId, handlerId, operIdx);
2741
+ }
2742
+ clearServerExecStack() {
2743
+ if (this._serverExecStack.peek() !== null) {
2744
+ this._serverExecStack.peek().clear();
2745
+ }
2746
+ }
2747
+ reverseServerExecStack() {
2748
+ if (this._serverExecStack.peek() !== null)
2749
+ this._serverExecStack.peek().reverse();
2750
+ }
2751
+ getNextOperIdx(oper, clearWhenFound) {
2752
+ let tmpServerExecStackEntry = null;
2753
+ let nextOperIdx = -1;
2754
+ if (this._serverExecStack.count() !== 0 && this._serverExecStack.peek() !== null && !this._serverExecStack.peek().empty()) {
2755
+ if (this._serverExecStack.peek().size() > this._execStack.peek().size()) {
2756
+ let tmpServerExecStack = new ExecutionStack(this._serverExecStack.peek());
2757
+ while (tmpServerExecStack.size() > this._execStack.peek().size()) {
2758
+ tmpServerExecStackEntry = tmpServerExecStack.pop();
2759
+ }
2760
+ if (this._execStack.peek().Equals(tmpServerExecStack) && tmpServerExecStackEntry.TaskId === oper.getTaskTag() && tmpServerExecStackEntry.HandlerId === oper.getHandlerId() && tmpServerExecStackEntry.OperIdx >= oper.getServerId()) {
2761
+ nextOperIdx = tmpServerExecStackEntry.OperIdx;
2762
+ if (clearWhenFound && this._serverExecStack.peek().size() === this._execStack.peek().size() + 1) {
2763
+ this._serverExecStack.peek().clear();
2764
+ }
2765
+ }
2766
+ else
2767
+ nextOperIdx = EventsManager.MAX_OPER;
2768
+ }
2769
+ else {
2770
+ nextOperIdx = EventsManager.MAX_OPER;
2771
+ }
2772
+ }
2773
+ return nextOperIdx;
2774
+ }
2775
+ setProcessingTopMostEndTask(inProcessingTopMostEndTask) {
2776
+ this._processingTopMostEndTask = inProcessingTopMostEndTask;
2777
+ }
2778
+ getProcessingTopMostEndTask() {
2779
+ return this._processingTopMostEndTask;
2780
+ }
2781
+ setAllowEvents(AllowEvents) {
2782
+ this._allowEvents = AllowEvents;
2783
+ }
2784
+ setNonInteractiveAllowEvents(AllowEvents) {
2785
+ if (AllowEvents)
2786
+ this._allowEvents = EventsAllowedType.NON_INTERACTIVE;
2787
+ else
2788
+ this._allowEvents = EventsAllowedType.NONE;
2789
+ }
2790
+ getAllowEvents() {
2791
+ return this._allowEvents;
2792
+ }
2793
+ NoEventsAllowed() {
2794
+ return this._allowEvents === EventsAllowedType.NONE;
2795
+ }
2796
+ async handleCtrlModify(ctrl, act) {
2797
+ if (ctrl == null || !ctrl.isModifiable())
2798
+ return;
2799
+ switch (act) {
2800
+ case InternalInterface.MG_ACT_RT_EDT_NULL:
2801
+ case InternalInterface.MG_ACT_CTRL_MODIFY:
2802
+ case InternalInterface.MG_ACT_SELECTION:
2803
+ break;
2804
+ default:
2805
+ return;
2806
+ }
2807
+ let rtEvt;
2808
+ rtEvt = new RunTimeEvent(ctrl);
2809
+ rtEvt.setInternal(InternalInterface.MG_ACT_CTRL_MODIFY);
2810
+ await this.handleEvent(rtEvt, false);
2811
+ }
2812
+ ActAllowed(act) {
2813
+ let allowed = true;
2814
+ switch (this.getAllowEvents()) {
2815
+ case EventsAllowedType.ALL:
2816
+ allowed = true;
2817
+ break;
2818
+ case EventsAllowedType.NONE:
2819
+ allowed = (act === InternalInterface.MG_ACT_CRELINE);
2820
+ break;
2821
+ case EventsAllowedType.NON_INTERACTIVE:
2822
+ switch (act) {
2823
+ case InternalInterface.MG_ACT_EXIT_SYSTEM:
2824
+ case InternalInterface.MG_ACT_EXIT:
2825
+ case InternalInterface.MG_ACT_CLOSE:
2826
+ case InternalInterface.MG_ACT_CRELINE:
2827
+ case InternalInterface.MG_ACT_CRELINE_ABOVE:
2828
+ case InternalInterface.MG_ACT_ROLLBACK:
2829
+ allowed = true;
2830
+ break;
2831
+ default:
2832
+ allowed = false;
2833
+ break;
2834
+ }
2835
+ break;
2836
+ }
2837
+ return allowed;
2838
+ }
2839
+ async commitRecord(task, isReversibleExit) {
2840
+ let dv = task.DataView;
2841
+ let rec = dv.getCurrRec();
2842
+ let forceSuffix = await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false);
2843
+ let isSelectionTable = await task.checkProp(PropInterface.PROP_TYPE_SELECTION, false);
2844
+ let isNewRec = rec.isNewRec();
2845
+ let savePrevCurrRec = true;
2846
+ let recModified = rec.Modified;
2847
+ if (!dv.recInModifiedTab(rec.getId()))
2848
+ rec.clearFlagsHistory();
2849
+ await task.TaskTransactionManager.checkAndCommit(isReversibleExit, ConstInterface.TRANS_RECORD_PREFIX, task.ConfirmUpdateNo);
2850
+ if (task.transactionFailed(ConstInterface.TRANS_RECORD_PREFIX)) {
2851
+ try {
2852
+ task.DataSynced = true;
2853
+ this.setStopExecution(false);
2854
+ await task.handleEventOnSlaveTasks(InternalInterface.MG_ACT_REC_PREFIX);
2855
+ }
2856
+ finally {
2857
+ this.setStopExecution(true);
2858
+ }
2859
+ }
2860
+ else if (task.isAborting())
2861
+ this.setStopExecution(true);
2862
+ else {
2863
+ if (recModified)
2864
+ rec.setLateCompute(true);
2865
+ if (!this._stopExecution)
2866
+ task.setLevel(Constants.TASK_LEVEL_TASK);
2867
+ rec.resetUpdated();
2868
+ rec.resetModified();
2869
+ if (!recModified && !forceSuffix && (!isSelectionTable || !task.InSelect)) {
2870
+ if (isNewRec) {
2871
+ dv.setPrevCurrRec();
2872
+ savePrevCurrRec = false;
2873
+ rec.setNewRec();
2874
+ await task.getForm().cancelEdit(false, false);
2875
+ await this.HandleStopRowEditing(task);
2876
+ }
2877
+ else if (!rec.getForceSaveOrg())
2878
+ await dv.cancelEdit(EventsManager.REAL_ONLY, true);
2879
+ else
2880
+ dv.saveOriginal();
2881
+ }
2882
+ else
2883
+ dv.saveOriginal();
2884
+ }
2885
+ if (savePrevCurrRec)
2886
+ dv.setPrevCurrRec();
2887
+ }
2888
+ incLocateTimerCB(taskObj) {
2889
+ let task = taskObj;
2890
+ let rtEvt = new RunTimeEvent(task, true);
2891
+ rtEvt.setInternal(InternalInterface.MG_ACT_INCREMENTAL_LOCATE);
2892
+ rtEvt.setMainPrgCreator(task);
2893
+ rtEvt.setCtrl(task.getLastParkedCtrl());
2894
+ this.addToTail(rtEvt);
2895
+ }
2896
+ static async doSyncForSubformParent(task) {
2897
+ let parentTask = task.getParent();
2898
+ let parentDv = parentTask.DataView;
2899
+ let parentRec = parentDv.getCurrRec();
2900
+ if (task.IsSubForm && parentRec != null && parentRec.Modified && !parentDv.isEmptyDataview()) {
2901
+ parentRec.setMode(DataModificationTypes.Update);
2902
+ await parentDv.addCurrToModified(false);
2903
+ ((parentDv.getCurrRec())).Synced = true;
2904
+ parentDv.setChanged(true);
2905
+ let dataViewExecuteLocalUpdatesCommand = CommandFactory.CreateDataViewCommand(parentTask.getTaskTag(), DataViewCommandType.ExecuteLocalUpdates);
2906
+ await parentTask.DataviewManager.Execute(dataViewExecuteLocalUpdatesCommand);
2907
+ }
2908
+ }
2909
+ async ProcessAbortingError(ex) {
2910
+ let eMsg;
2911
+ let errForConsole;
2912
+ let errForMsgBox;
2913
+ if (ex instanceof ServerError)
2914
+ eMsg = ex.GetMessage();
2915
+ else
2916
+ eMsg = ((ex.Message !== null) ? ex.Message : ex.GetType());
2917
+ errForConsole = StrUtil.getConsoleErorString(eMsg);
2918
+ errForMsgBox = StrUtil.getMsgBoxErorString(eMsg);
2919
+ if (ex.InnerException !== null)
2920
+ Logger.Instance.WriteExceptionToLog(ex.InnerException, errForConsole);
2921
+ else {
2922
+ if (!(ex instanceof ServerError) || Logger.Instance.LogLevel !== Logger_LogLevels.Basic) {
2923
+ Logger.Instance.WriteExceptionToLogWithMsg(errForConsole);
2924
+ }
2925
+ }
2926
+ let sendUnloadToServer = RuntimeContextBase.Instance.ContextID !== RuntimeContextBase.noContextId;
2927
+ MGDataCollection.Instance.currMgdID = 0;
2928
+ let messageString = LanguageData.Instance.getConstMessage(MsgInterface.BRKTAB_STR_ERROR);
2929
+ let style = 16;
2930
+ if (ex.Message.startsWith('<HTML')) {
2931
+ this.processHTMLContent(ex.Message);
2932
+ }
2933
+ else {
2934
+ if (this.ShowErrorInMessageBox(ex)) {
2935
+ await GUIManager.Instance.MessageBox(messageString, errForMsgBox, style);
2936
+ }
2937
+ if (ex instanceof ServerError) {
2938
+ if (ex.GetCode() == ServerError.ERR_WEBCLIENT_PROGRAM_RELOADED ||
2939
+ ex.GetCode() == ServerError.ERR_EXECUTED_PROGRAM_CHANGED) {
2940
+ Commands.addGlobalCommand(CommandType.RELOAD_PAGE);
2941
+ Commands.beginInvoke();
2942
+ }
2943
+ }
2944
+ }
2945
+ if (ex instanceof ServerError) {
2946
+ if (ex.GetCode() === ServerError.ERR_CTX_NOT_FOUND ||
2947
+ ex.GetCode() === ServerError.ERR_WEBCLIENT_PROGRAM_RELOADED ||
2948
+ ex.GetCode() === ServerError.ERR_EXECUTED_PROGRAM_CHANGED) {
2949
+ sendUnloadToServer = false;
2950
+ }
2951
+ }
2952
+ if (sendUnloadToServer) {
2953
+ try {
2954
+ let cmd = CommandFactory.CreateUnloadCommand();
2955
+ MGDataCollection.Instance.getMGData(0).CmdsToServer.Add(cmd);
2956
+ await CommandsProcessorManager.GetCommandsProcessor().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
2957
+ }
2958
+ catch (ex3) {
2959
+ if (ex3 instanceof ApplicationException) {
2960
+ Logger.Instance.WriteExceptionToLog(ex3);
2961
+ }
2962
+ else
2963
+ throw ex3;
2964
+ }
2965
+ }
2966
+ GUIManager.Instance.abort();
2967
+ }
2968
+ processHTMLContent(htmlContent) {
2969
+ Commands.addShowHTMLError(CommandType.SHOW_HTML_ERROR, htmlContent);
2970
+ Commands.beginInvoke();
2971
+ }
2972
+ ShowErrorInMessageBox(ex) {
2973
+ if (!(ex instanceof ServerError))
2974
+ return true;
2975
+ if ((ex.GetCode() == ServerError.ERR_EXECUTED_PROGRAM_CHANGED ||
2976
+ ex.GetCode() == ServerError.ERR_WEBCLIENT_PROGRAM_RELOADED) &&
2977
+ RuntimeContextBase.Instance.ContextID === RuntimeContextBase.noContextId)
2978
+ return false;
2979
+ return true;
2980
+ }
2981
+ getIsInViewRefresh() {
2982
+ return this.isInViewRefresh;
2983
+ }
2984
+ setIsInViewRefresh(inViewRefresh) {
2985
+ this.isInViewRefresh = inViewRefresh;
2986
+ }
2987
+ }
2988
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXZlbnRzTWFuYWdlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2VuZ2luZS9zcmMvZXZlbnQvRXZlbnRzTWFuYWdlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsU0FBUyxFQUNULFNBQVMsRUFDVCxpQkFBaUIsRUFDakIsTUFBTSxFQUNOLGdCQUFnQixFQUNoQixhQUFhLEVBQ2IsSUFBSSxFQUNKLFlBQVksRUFDWixRQUFRLEVBQ1IsT0FBTyxFQUNQLGdCQUFnQixFQUNoQixPQUFPLEVBQ1AsV0FBVyxFQUNaLE1BQU0sa0JBQWtCLENBQUM7QU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W5kbGVTdG9wRXhlY3V0aW9uKHJ0RXZ0KSlcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICB9IGZpbmFsbHkge1xyXG4gICAgICAgICAgICAvLyByZXN0b3JpbmcgdGhlIGNvbnRleHRcclxuICAgICAgICAgICAgaGFuZGxlci5nZXRUYXNrKCkuU2V0Q29udGV4dFRhc2soaGFuZGxlckNvbnRleHRUYXNrKTtcclxuICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICBpZiAoIXByb3BhZ2F0ZSlcclxuICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgaWYgKHJ0RXZ0Q2hhbmdlZClcclxuICAgICAgICAgICAgaGFuZGxlciA9IHBvcy5nZXROZXh0KHJ0RXZ0KTtcclxuICAgICAgICAgIC8vIGdldCB0aGUgbmV4dCBoYW5kbGVyIGZvciB0aGUgY3VycmVudCBldmVudFxyXG4gICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICBoYW5kbGVyID0gcG9zLmdldE5leHQoKTtcclxuICAgICAgICAgIGlmIChoYW5kbGVyICE9PSBudWxsKVxyXG4gICAgICAgICAgICBGbG93TW9uaXRvclF1ZXVlLkluc3RhbmNlLmFkZFRhc2tFdmVudChydEV2dC5nZXRCcmtMZXZlbCh0cnVlKSwgRmxvd01vbml0b3JJbnRlcmZhY2UuRkxXTVRSX1BST1BBR0FURSwgdGFzay5HZXRUYXNrRGV0YWlscygpKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHByb3BhZ2F0ZSAmJiAhZW5kVGFza0Vycm9yKVxyXG4gICAgICAgICAgYXdhaXQgdGhpcy5jb21tb25IYW5kbGVyKHJ0RXZ0KTtcclxuICAgICAgfVxyXG4gICAgICBpZiAoIWVuZFRhc2tFcnJvcikge1xyXG4gICAgICAgIGF3YWl0IHRoaXMuY29tbW9uSGFuZGxlckFmdGVyKHJ0RXZ0LCBiUmNCZWZvcmUpO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gPFRhc2s+bGFzdFBhcmtlZEN0cmwuZ2V0Rm9ybSgpLmdldFRhc2soKTtcclxuXHJcbiAgICAgICAgaWYgKGxhc3RQYXJrZWRUYXNrICE9PSB0YXNrKSB7XHJcbiAgICAgICAgICBsZXQgZmlyc3RUaW1lOiBib29sZWFuID0gdHJ1ZTtcclxuICAgICAgICAgIGxldCBpc1NvblN1YmZvcm06IGJvb2xlYW47XHJcbiAgICAgICAgICBsZXQgcGFyZW50VGFzazogVGFzaztcclxuXHJcbiAgICAgICAgICBpZiAobGFzdFBhcmtlZFRhc2sgIT09IG51bGwpIHtcclxuICAgICAgICAgICAgaXNTb25TdWJmb3JtID0gbGFzdFBhcmtlZFRhc2suSXNTdWJGb3JtO1xyXG5cclxuICAgICAgICAgICAgZm9yIChwYXJlbnRUYXNrID0gbGFzdFBhcmtlZFRhc2s7IHBhcmVudFRhc2sgIT09IG51bGwgJiYgaXNTb25TdWJmb3JtOyBwYXJlbnRUYXNrID0gPFRhc2s+cGFyZW50VGFzay5nZXRQYXJlbnQoKSkge1xyXG4gICAgICAgICAgICAgIGlmICghZmlyc3RUaW1lKSB7XHJcbiAgICAgICAgICAgICAgICBpc1NvblN1YmZvcm0gPSBwYXJlbnRUYXNrLklzU3ViRm9ybTtcclxuICAgICAgICAgICAgICAgIHBhcmVudFRhc2suQWN0aW9uTWFuYWdlci5lbmFibGUoSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1pPT00sIGZhbHNlKTtcclxuICAgICAgICAgICAgICAgIHBhcmVudFRhc2suQWN0aW9uTWFuYWdlci5lbmFibGUoSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX0RFTExJTkUsIGZhbHNlKTtcclxuICAgICAgICAgICAgICAgIHBhcmVudFRhc2suZW5hYmxlQ3JlYXRlQWN0cyhmYWxzZSk7XHJcbiAgICAgICAgICAgICAgfSBlbHNlXHJcbiAgICAgICAgICAgICAgICBmaXJzdFRpbWUgPSBmYWxzZTtcclxuICAgICAgICA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aXQncyBDb21tb25IYW5kbGVyQmVmb3JlIGZvciBSUC5cclxuICAgICAgICAgIGlmICh0YXNrLklzU3ViRm9ybSAmJiAoPFRhc2s+dGFzay5nZXRQYXJlbnQoKSkuSW5Db21tb25IYW5kbGVyQmVmb3JlUlApXHJcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuXHJcbiAgICAgICAgICAvLyBSZWNvdmVyeSBmcm9tIHRyYW5zYWN0aW9uIHJlc3RhcnQgd2FzIGNvbXBsZXRlZC4gV2UgbWF5IG5vdyBjbGVhciB0aGUgZmxhZ1xyXG4gICAgICAgICAgdGFzay5zZXRBZnRlclJldHJ5KENvbnN0SW50ZXJmYWNlLlJFQ09WRVJZX05PTkUpO1xyXG4gICAgICAgICAgdGFzay5EYXRhU3luY2VkID0gZmFsc2U7XHJcblxyXG4gICAgICAgICAgaWYgKCF0YXNrLmlzU3RhcnRlZCgpKVxyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcblxyXG5cclxuICAgICAgICAgIC8vIGlmIHRoZSBmb3JtIGNvbnRhaW5zIGEgdGFibGUgYW5kIHRoZSBjb250cm9sIHdhcyBpbiB0aGUgdGFibGVcclxuICAgICAgICAgIC8vIG1vdmUgdG8gdGhlIG5ldyByb3dcclxuICAgICAgICAgIGlmIChmb3JtLmdldFJvd3NJblBhZ2UoKSA+IEludDMyLk1pblZhbHVlICYmIGRpc3BsYXlMaW5lID4gSW50MzIuTWluVmFsdWUpIHtcclxuICAgICAgICAgICAgLy8gZW5zdXJlIGEgdmFsaWQgcm93XHJcbiAgICAgICAgICAgIHdoaWxlICghZHYucmVjRXhpc3RzKGRpc3BsYXlMaW5lKSAmJiBkaXNwbGF5TGluZSA+IDApIHtcclxuICAgICAgICAgICAgICBkaXNwbGF5TGluZS0tO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChkaXNwbGF5TGluZSA+PSAwKSB7XHJcbiAgICAgICAgICAgICAgcHJldlJlYyA9IGR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AgIC8vIHN0YXRlbWVudCkuIEl0IGNhbiBoYXBwZW4gd2hlbiB0aGUgdXNlciBjbGlja3Mgb24gYSBsaW5lIHdoaWNoXHJcbiAgICAgICAgICAgICAgICAgIC8vIGJlY29tZXMgYmxhbmsgZHVlIHRvIHRoZSBkZWxldGlvbiBvZiB0aGUgcHJldmlvdXMgcmVjb3JkLlxyXG4gICAgICAgICAgICAgICAgICBhd2FpdCBmb3JtLlJlZnJlc2hEaXNwbGF5KENvbnN0YW50cy5UQVNLX1JFRlJFU0hfQ1VSUl9SRUMpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgcmVjID0gZHYuZ2V0Q3VyclJlYygpO1xyXG4gICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcclxuICAgICAgICAgICAgICAgIGlmIChlIGluc3RhbmNlb2YgUmVjb3JkT3V0T2ZEYXRhVmlld0V4Y2VwdGlvbikge1xyXG4gICAgICAgICAgICAgICAgICBpZiAodGhpcy5fc3RvcEV4ZWN1dGlvbikge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvbGRUYXNrTW9kZSA9PT0gQ29uc3RhbnRzLlRBU0tfTU9ERV9DUkVBVEUgJiYgb2xkRGlzcGxheUxpbmUgPiAwICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAhZHYucmVjRXhpc3RzQnlJZChvbGRSZWNJZCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgIGxldCBwcmV2TGluZTogbnVtYmVyID0gZm9ybS5nZXRQcmV2TGluZShvbGREaXNwbGF5TGluZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBmb3JtLnJlc3RvcmVPbGREaXNwbGF5TGluZShwcmV2TGluZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBmb3JtLnJlc3RvcmVPbGREaXNwbGF5TGluZShvbGREaXNwbGF5TGluZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgYXdhaXQgZm9ybS5SZWZyZXNoRGlzcGxheShDb25zdGFudHMuVEFTS19SRUZSRVNIX0ZPUk0pO1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0U3RvcEV4ZWN1dGlvbihmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgbGFzdEZvY3VzZWRDdHJsID0gPE1nQ29udHJvbD50YXNrLmdldExhc3RQYXJrZWRDdHJsKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgdGFzay5nZXRMYXN0UGFya2VkQ3RybCgpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChsYXN0Rm9jdXNlZEN0cmwgIT0gbnVsbClcclxuICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IGxhc3RGb2N1c2VkQ3RybC5pbnZva2UoKTtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFN0b3BFeGVjdXRpb24odHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgICB9IGVsc2VcclxuICAgICAgICAgICAgICAgICAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVEZXZUb0xvZyhlLlN0YWNrVHJhY2UpO1xyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHRocm93IGU7XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9IGVsc2VcclxuICAgICAgICAgICAgICB0aHJvdyBuZXcgQXBwbGljYXRpb25FeGNlcHRpb24oJ2luIEV2ZW50c01hbmFnZXIuY29tbW9uSGFuZGxlckJlZm9yZSgpOiBpbnZhbGlkIGxpbmUgbnVtYmVyOiAnICtcclxuICAgICAgICAgICAgICAgIGRpc3BsYXlMaW5lKTtcclxuICAgICAgICAgIH1cclxuICAgICAgICAgIGlmIChyZWMgPT0gbnVsbClcclxuICAgICAgICAgICAgdGhyb3cgbmV3IEFwcGxpY2F0aW9uRXhjZXB0aW9uKFx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b25UYWJsZTogYm9vbGVhbjtcclxuXHJcbiAgICAgICAgICB0YXNrLkNvbmZpcm1VcGRhdGVObyA9IGZhbHNlO1xyXG5cclxuICAgICAgICAgIC8vIE5vIHJlY29yZCAtPiBubyBzdWZmaXhcclxuICAgICAgICAgIGlmIChyZWMgPT0gbnVsbClcclxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG5cclxuICAgICAgICAgIGZvcmNlU3VmZml4ID0gYXdhaXQgdGFzay5jaGVja1Byb3AoUHJvcEludGVyZmFjZS5QUk9QX1RZUEVfRk9SQ0VfU1VGRklYLCBmYWxzZSk7XHJcblxyXG4gICAgICAgICAgLy8gZG8gbm90IGV4ZWN1dGUgdGhlIFwiYmVmb3JlIHJlY29yZCBzdWZmaXhcIiB3aGVuIGRlbGV0aW5nIHRoZSByZWNvcmQgYW5kXHJcbiAgICAgICAgICAvLyB0aGUgdGFzayBtb2RlIGlzIGRlbGV0ZSAodGhlIHNlY29uZCByb3VuZClcclxuICAgICAgICAgIGlmICgocmVjLk1vZGlmaWVkIHx8IGZvcmNlU3VmZml4KSAmJiByZWMuZ2V0TW9kZSgpID09PSBEYXRhTW9kaWZpY2F0aW9uVHlwZXMuRGVsZXRlICYmXHJcbiAgICAgICAgICAgIHRhc2suZ2V0TW9kZSgpID09PSBDb25zdGFudHMuVEFTS19NT0RFX0RFTEVURSlcclxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcblxyXG4gICAgICAgICAgLy8gdG8gcHJldmVudCBkb3VibGUgc3VmZml4IG9uIHRoZSBzYW1lIHJlY29yZFxyXG4gICAgICAgICAgaWYgKHRhc2suZ2V0TGV2ZWwoKSA9PT0gQ29uc3RhbnRzLlRBU0tfTEVWRUxfVEFTSylcclxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG5cclxuICAgICAgICAgIGlmICh0YXNrLmdldExldmVsKCkgPT09IENvbnN0YW50cy5UQVNLX0xFVkVMX0NPTlRST0wpIHtcclxuICAgICA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yBlcnJvclxyXG4gICAgICAgICAgaWYgKHN0b3BFeGVjdXRpb24pXHJcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DVFJMX1BSRUZJWDpcclxuICAgICAgICAgIGlmIChhd2FpdCB0aGlzLmhhbmRsZUN0cmxQcmVmaXgoZXZ0KSlcclxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgLy8gZGlkIG5vdCBzdWNjZWVkIGluIGVudGVyaW5nIHRoZSBjdHJsXHJcbiAgICAgICAgICAgIGV2dC5Db250cm9sLkluQ29udHJvbCA9IGZhbHNlO1xyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICB9XHJcblxyXG4gICAgICAgIGNhc2UgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX0NBTkNFTDpcclxuICAgICAgICAgIE1hbmFnZXIuQ2xlYW5NZXNzYWdlUGFuZSh0YXNrKTsgLy8gUUNSICMzNzEzMjFcclxuICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DVFJMX1NVRkZJWDpcclxuXHJcbiAgICAgICAgICAvLyBpZiB3ZSBoYXZlIGEgc3RvcGV4ZWN1dGlvbiBjdHJsIHdlIHNob3VsZCBub3QgZXhlY3V0ZSBDUy5cclxuICAgICAgICAgIGlmIChjdHJsID09IG51bGwgfHwgdGhpcy5nZXRTdG9wRXhlY3V0aW9uQ3RybCgpICE9IG51bGwpXHJcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuXHJcbiAgICAgICAgICAvLyB0byBwcmV2ZW50IGRvdWJsZSBzdWZmaXggb24gdGhlIHNhbWUgY29udHJvbFxyXG4gICAgICAgICAgaWYgKHRhc2suZ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Wl0IGZvcm0ubW92ZUluVmlldyhDb25zdGFudHMuTU9WRV9VTklUX1JPVywgQ29uc3RhbnRzLk1PVkVfRElSRUNUSU9OX05FWFQpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9UQkxfUFJWTElORTpcclxuICAgICAgICAgICAgaWYgKGZvcm0gIT0gbnVsbClcclxuICAgICAgICAgICAgICBhd2FpdCBmb3JtLm1vdmVJblZpZXcoQ29uc3RhbnRzLk1PVkVfVU5JVF9ST1csIENvbnN0YW50cy5NT1ZFX0RJUkVDVElPTl9QUkVWKTtcclxuICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfVEJMX05YVFBBR0U6XHJcbiAgICAgICAgICAgIGlmIChmb3JtICE9IG51bGwpXHJcbiAgICAgICAgICAgICAgYXdhaXQgZm9ybS5tb3ZlSW5WaWV3KENvbnN0YW50cy5NT1ZFX1VOSVRfUEFHRSwgQ29uc3RhbnRzLk1PVkVfRElSRUNUSU9OX05FWFQpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9UQkxfUFJWUEFHRTpcclxuICAgICAgICAgICAgaWYgKGZvcm0gIT0gbnVsbClcclxuICAgICAgICAgICAgICBhd2FpdCBmb3JtLm1vdmVJblZpZXcoQ29uc3RhbnRzLk1PVkVfVU5JVF9QQUdFLCBDb25zdGFudHMuTU9WRV9ESVJFQ1RJT05fUFJFVik7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgIGNhc2UgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1RCTF9CRUdQQUdFOlxyXG4gICAgICAgICAgICBpZiAoZm9ybSAhPSBudWxsKVxyXG4gICAgICAgICAgICAgIGF3YWl0I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5NR19BQ1RfREVMTElORTpcclxuICAgICAgICAgICAgaWYgKGF3YWl0IHRoaXMuSGFuZGxlQWN0aW9uRGVsbGluZSh0YXNrLCBkdiwgcmVjLCBmYWxzZSkpXHJcbiAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DUkVMSU5FOlxyXG4gICAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfQ1JFTElORV9BQk9WRTpcclxuICAgICAgICAgICAgaWYgKHRhc2suRGF0YVZpZXcuaXNFbXB0eURhdGF2aWV3KCkpIHtcclxuICAgICAgICAgICAgICBhd2FpdCB0aGlzLmdvdG9DcmVhdGVNb2RlKHRhc2spO1xyXG5cclxuICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAodGFzay5nZXRJbkNyZWF0ZUxpbmUoKSlcclxuICAgICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICAgIHRhc2suc2V0SW5DcmVhdGVMaW5lKHRydWUpO1xyXG5cclxuICAgICAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgICBpZiAodGFzay5nZXRMZXZlbCgpID09PSBDb25zdGFudHMuVEFTS19MRVZFTF9DT05UUk9MKSB7XHJcbiAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLmhhbmRsZUludGVybmFsRXZlbnRXaXRoTWdDb250cm9sQmFzZSh0YXNrLmdldExhc3RQYXJrZWRDdHJsKCksIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DVFJMX1NVRkZJWCk7XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5HZXRTdG9wRXhlY3V0aW9uRmxhZygpKVxyXG4gICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAvLyB2ZXJpZnkgdGhhdCB0aGUgY3VycmVudCByZWNvcmQgaXMgbm90IGFscmVhZHkgYSBuZXcgb25lXHJcbiAgICAgICAgICAgICAgaWYgKHRhc2suZ2V0TW9kZSgpID09PSBDb25zdGFudHMuVEFTS19NT0RFX0NSRUFURSAmJiByZWMgIT0gbnVsbCAmJiAhcmVjLk1vZGlmaWVkKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoYXdhaXQgdGFzay5jaGVja1Byb3AoUHJvcEludGVyZmFjZS5QUk9QX1RZUEVfRk9SQ0VfU1VGRklYLCBmYWxzZSkpIHtcclxuICAgICAgICAgICAgICAgICAgZG9TdWZmaXggPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5oYW5kbGVJbnRlcm5hbEV2ZW50V2l0aFRhc2sodGFzaywgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1JFQ19TVUZGSVgpO1xyXG4gICAgICAgICAgICAgICAgICBpZiAodGhpcy5HZXRTdG9wRXhlY3V0aW9uRmxhZygpIHx8IHRhc2suaXNBYm9ydGluZygpKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgIHRhc2suc2V0TGV2ZWwoQ29uc3RhbnRzLlRBU0tfTEVWRUxfVEFTSyk7XHJcbiAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHRhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SRUNfUFJFRklYKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5HZXRTdG9wRXhlY3V0aW9uRmxhZygpICYmIGZvcm0gIT0gbnVsbCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIERlZmVjdCAxNTIzNTU6IFBhcmsgb24gbGFzdFBhcmtlZENvbnRyb2wgaWYgbmV4dFNjcmVlbiBldmVudCBvY2N1cnMgaWYgYWxyZWFkeSBpbiBjcmVhdGUgbW9kZSBhbmQgcmVjb3JkIG5vdCBtb2RpZmllZFxyXG4gICAgICAgICAgICAgICAgICAgIGxldCBsYXN0UGFya2VkQ29udHJvbDogTWdDb250cm9sID0gPE1nQ29udHJvbD50YXNrLmdldExhc3RQYXJrZWRDdHJsKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxhc3RQYXJrZWRDb250cm9sICE9PSBudWxsKVxyXG4gICAgICAgICAgICAgICAgICAgICAgYXdhaXQgbGFzdFBhcmtlZENvbnRyb2wuaW52b2tlKCk7XHJcbiAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICBsZXQgcmVmRG9TdWZmaXg6IFJlZlBhcmFtPGJvb2xlYW4+ID0gbmV3IFJlZlBhcmFtKGRvU3VmZml4KTtcclxuICAgICAgICAgICAgICBpZiAoYXdhaXQgdGhpcy5Eb1Rhc2tMZXZlbFJlY29yZFN1ZmZpeCh0YXNrLCByZWZEb1N1ZmZpeCkpXHJcbiAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgZG9TdWZmaXggPSByZWZEb1N1ZmZpeC52YWx1ZTtcclxuXHJcbiAgICAgICAgICAgICAgaWYgKGZvcm0gIT0gbnVsbCkge1xyXG5cclxuICAgICAgICAgICAgICAgIGlmICgodGFzay5nZXRNb2RlKCkgIT09IENvbnN0YW50cy5UQVNLX01PREVfQ1JFQVRFKSB8fCAhdGFzay5Db25maXJtVXBkYXRlTm8pXHJcbiAgICAgICAgICAgICAgICAgIGF3YWl0IGZvcm0uYWRkUmVjKGRvU3VmZml4LCBpbnRFdnRDb2RlID09IEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DUkVMSU5FX0FCT1ZFID8gdHJ1ZSA6IGZhbHNlKTtcclxuICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgIGF3YWl0IHRoaXMuRG9UYXNrTGV2ZWxSZWNvcmRQcmVmaXgodGFzayk7XHJcbiAgICAgICAgICAgICAgYXdhaXQgdGhpcy5IYW5kbGVBY3RFbnRlclJvd0VkaXRpbmcodGFzayk7XHJcblxyXG4gICAgICAgICAgICB9IGZpbmFsbHkge1xyXG4gICAgICAgICAgICAgIHRhc2suc2V0SW5DcmVhdGVMaW5lKGZhbHNlKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DQU5DRUw6XHJcbiAgICAgICAgICAgIGF3YWl0IHRoaXMuSGFuZGxlQWN0Q2FuY2VsKGV2dCwgdGFzaywgZm9ybSwgY3RybCwgcmVjLCB0cnVlKTtcclxuICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfRU5URVJfUk9XX0VESVRJTkc6XHJcbiAgICAgICAgICAgIGF3YWl0IHRoaXMuSGFuZGxlQWN0RW50ZXJSb3dFZGl0aW5nKHRhc2spO1xyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SVF9RVUlUOlxyXG4gICAgICAgICAgICBhd2FpdCB0aGlzLmhhbmRsZUludGVybmFsRXZlbnRXaXRoVGFzayh0YXNrLCBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfUlRfUVVJVCk7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgIGNhc2UgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1JUT19DUkVBVEU6XHJcbiAgICAgICAgICAgIGlmICh0YXNrLmdldE1vZGUoKSA9PT0gQ29uc3RhbnRzLlRBU0tf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GF3YWl0IGR2LmN1cnJSZWNDb21wdXRlKHRydWUpO1xyXG4gICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5oYW5kbGVJbnRlcm5hbEV2ZW50V2l0aFRhc2sodGFzaywgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1JFQ19QUkVGSVgpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGN0cmwgIT0gbnVsbClcclxuICAgICAgICAgICAgICAgICAgYXdhaXQgY3RybC5pbnZva2UoKTtcclxuICAgICAgICAgICAgICAgIGF3YWl0IGZvcm0uUmVmcmVzaERpc3BsYXkoQ29uc3RhbnRzLlRBU0tfUkVGUkVTSF9DVVJSX1JFQyk7XHJcbiAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vIHdlIGFscmVhZHkgZXhlY3V0ZWQgcmVjb3JkIHN1ZmZpeCAtIHNvIHdlIG5lZWQgdG8gcHJldmVudCB0aGUgdmlldyByZWZyZXNoXHJcbiAgICAgICAgICAgICAgICAvLyBmcm9tIGV4ZWN1dGluZyBpdCBhZ2FpblxyXG4gICAgICAgICAgICAgICAgdGFzay5zZXRQcmV2ZW50UmVjb3JkU3VmZml4KHRydWUpO1xyXG4gICAgICAgICAgICAgICAgdGFzay5zZXRQcmV2ZW50Q29udHJvbENoYW5nZSh0cnVlKTtcclxuICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHRhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SVF9SRUZSRVNIX1ZJRVcpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGN0cmwgIT0gbnVsbClcclxuICAgICAgICAgICAgICAgICAgYXdhaXQgY3RybC5pbnZva2UoKTtcclxuICAgICAgICAgICAgICAgIHRhc2suc2V0UHJldmVudFJlY29yZFN1ZmZpeChmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICB0YXNrLnNldFByZXZlbnRDb250cm9sQ2hhbmdlKGZhbHNlKTtcclxuICAgICAgICAgICAgICAgIGlmICghZHYuaXNFbXB0eSgpICYmIChkdi5nZXRDdXJyUmVjKCkpLmdldE1vZGUoKSAhPT0gRGF0YU1vZGlmaWNhdGlvblR5cGVzLkluc2VydClcclxuICAgICAgICAgICAgICAgICAgdGFzay5zZXRNb2RlKENvbnN0YW50cy5UQVNLX01PREVfUVVFUlkpO1xyXG4gICAgICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICAgICAgICB0YXNrLnNldE1vZGUoQ29uc3RhbnRzLlRBU0tfTU9ERV9DUkVBVEUpO1xyXG4gICAgICAgICAgICAgICAgYXdhaXQgZm9ybS5SZWZyZXNoRGlzcGxheShDb25zdGFudHMuVEFTS19SRUZSRVNIX0NVUlJfUkVDKTtcclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgdGFzay5zZXRPcmlnaW5hbFRhc2tNb2RlKENvbnN0YW50cy5UQVNLX01PREVfUVVFUlkpO1xyXG4gICAgICAgICAgICAgIGF3YWl0IHRhc2suc2V0Q3JlYXRlRGVsZXRlQWN0c0VuYWJsZVN0YXRlKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfUlRPX01PRElGWTpcclxuICAgICAgICAgICAgaWYgKHRhc2suZ2V0TW9kZSgpICE9PSBDb25zdGFudHMuVEFTS19NT0RFX01PRElGWSAmJlxyXG4gICAgICAgICAgICAgIChhd2FpdCAodGFzay5nZXRQcm9wKFByb3BJbnRlcmZhY2UuUFJPUF9UWVBFX0FMTE9XX09QVElPTikpLmdldFZhbHVlQm9vbGVhbigpKSA9PT0gZmFsc2UpXHJcbiAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGF3YWl0IHRhc2suZW5hYmxlTW9kZXMoKTtcclxuICAgICAgICAgICAgb2xkTW9kZSA9IHRhc2suZ2V0T3JpZ2luYWxUYXNrTW9kZSgpO1xyXG4gICAgICAgICAgICBhd2FpdCB0aGlzLmhhbmRsZUludGVybmFsRXZlbnRXaXRoVGFzayh0YXNrLCBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfUkVDX1NVRkZJWCk7XHJcbiAgICAgICAgICAgIGlmICghdGhpcy5HZXRTdG9wRXhlY3V0aW9uRmxhZygpKSB7XHJcbiAgICAgICAgICAgICAgdGFzay5zZXRNb2RlKENvbnN0YW50cy5UQVNLX01PREVfTU9ESUZZKTtcclxuXHJcbiAgICAgICAgICAgICAgaWYgKG9sZE1vZGUgIT09IENvbnN0YW50cy5UQVNLX01PREVfQ1JFQVRFKSB7XHJcbiAgICAgICAgICAgICAgICBhd2FpdCBkdi5jdXJyUmVjQ29tcHV0ZSh0cnVlKTtcclxuICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHRhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SRUNfUFJFRklYKTtcclxuICAgICAgICAgICAgICAgIGlmIChjdHJsICE9IG51bGwpXHJcbiAgICAgICAgICAgICAgICAgIGF3YWl0IGN0cmwuaW52b2tlKCk7XHJcbiAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vIHdlIGFscmVhZHkgZXhlY3V0ZWQgcmVjb3JkIHN1ZmZpeCAtIHNvIHdlIG5lZWQgdG8gcHJldmVudCB0aGUgdmlldyByZWZyZXNoXHJcbiAgICAgICAgICAgICAgICAvLyBmcm9tIGV4ZWN1dGluZyBpdCBhZ2FpblxyXG4gICAgICAgICAgICAgICAgdGFzay5zZXRQcmV2ZW50UmVjb3JkU3VmZml4KHRydWUpO1xyXG4gICAgICAgICAgICAgICAgdGFzay5zZXRQcmV2ZW50Q29udHJvbENoYW5nZSh0cnVlKTtcclxuICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHRhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SVF9SRUZSRVNIX1ZJRVcpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGN0cmwgIT0gbnVsbClcclxuICAgICAgICAgICAgICAgICAgYXdhaXQgY3RybC5pbnZva2UoKTtcclxuICAgICAgICAgICAgICAgIHRhc2suc2V0UHJldmVudFJlY29yZFN1ZmZpeChmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICB0YXNrLnNldFByZXZlbnRDb250cm9sQ2hhbmdlKGZhbHNlKTtcclxuICAgICAgICAgICAgICAgIGlmICghZHYuaXNFbXB0eSgpICYmIChkdi5nZXRDdXJyUmVjKCkpLmdldE1vZGUoKSAhPT0gRGF0YU1vZGlmaWNhdGlvblR5cGVzLkluc2VydClcclxuICAgICAgICAgICAgICAgICAgdGFzay5zZXRNb2RlKENvbnN0YW50cy5UQVNLX01PREVfTU9ESUZZKTtcclxuICAgICAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAgICAgICAgdGFzay5zZXRNb2RlKENvbnN0YW50cy5UQVNLX01PREVfQ1JFQVRFKTtcclxuICAgICAgICAgICAgICAgIGF3YWl0IGZvcm0uUmVmcmVzaERpc3BsYXkoQ29uc3RhbnRzLlRBU0tfUkVGUkVTSF9DVVJSX1JFQyk7XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIHRhc2suc2V0T3JpZ2luYWxUYXNrTW9kZShDb25zdGFudHMuVEFTS19NT0RFX01PRElGWSk7XHJcbiAgICAgICAgICAgICAgYXdhaXQgdGFzay5zZXRDcmVhdGVEZWxldGVBY3RzRW5hYmxlU3RhdGUoKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9TRUxFQ1Q6XHJcbiAgICAgICAgICAgIC8qIHByZ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SAhPSBudWxsKSAmJiAoZXZ0LmdldEFyZ0xpc3QoKS5nZXRTaXplKCkgPT09IDIpKSB7XHJcbiAgICAgICAgICAgICAgbGV0IHN1YmZvcm1UYXNrOiBUYXNrID0gdGFzaywgcGFyZW50VGFzaztcclxuICAgICAgICAgICAgICBsZXQgdGFza1RhZzogc3RyaW5nID0gYXdhaXQgZXZ0LmdldEFyZ0xpc3QoKS5nZXRBcmdWYWx1ZSgxLCBTdG9yYWdlQXR0cmlidXRlLk5VTUVSSUMsIDApO1xyXG5cclxuICAgICAgICAgICAgICB3aGlsZSAoc3ViZm9ybVRhc2suSXNTdWJGb3JtKSB7XHJcbiAgICAgICAgICAgICAgICBwYXJlbnRUYXNrID0gc3ViZm9ybVRhc2suZ2V0UGFyZW50KCk7XHJcbiAgICAgICAgICAgICAgICBpZiAoc3ViZm9ybVRhc2suZ2V0VGFza1RhZygpID09PSB0YXNrVGFnKSB7XHJcbiAgICAgICAgICAgICAgICAgIGF3YWl0IHBhcmVudFRhc2suU3ViZm9ybVJlZnJlc2goc3ViZm9ybVRhc2ssIHRydWUpO1xyXG4gICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHN1YmZvcm1UYXNrID0gcGFyZW50VGFzaztcclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfU1VCRk9STV9PUEVOOlxyXG4gICAgICAgICAgICBhd2FpdCB0aGlzLk9wZW5TdWJmb3JtKHRhc2ssIDxNZ0NvbnRyb2w+ZXZ0LkNvbnRyb2wpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SVE9fU0VBUkNIOlxyXG4gICAgICAgICAgICBhd2FpdCB0aGlzLm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YXN0Rm9jdXNlZENvbnRyb2wodGFzaywgbnVsbCk7XHJcblxyXG4gICAgICAgICAgICBpZiAoYXdhaXQgdGFzay5ldmFsRW5kQ29uZChDb25zdEludGVyZmFjZS5FTkRfQ09ORF9FVkFMX0lNTUlESUFURSkpXHJcbiAgICAgICAgICAgICAgYXdhaXQgdGFzay5lbmRUYXNrKHRydWUsIGZhbHNlLCBmYWxzZSk7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfVEFTS19QUkVGSVg6XHJcbiAgICAgICAgICB0YXNrLnNldExldmVsKENvbnN0YW50cy5UQVNLX0xFVkVMX1RBU0spO1xyXG4gICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgIGNhc2UgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1RBU0tfU1VGRklYOlxyXG4gICAgICAgICAgdGFzay5zZXRMZXZlbChDb25zdGFudHMuVEFTS19MRVZFTF9OT05FKTtcclxuICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAvLyBzaW11bGF0ZXMgdXNlciBhc2tpbmcgZm9yIHRoZSBuZXh0IHJlYy5cclxuICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DWUNMRV9ORVhUX1JFQzpcclxuICAgICAgICAgIGxldCBmb3JtID0gPE1nRm9ybT50YXNrLmdldEZvcm0oKTtcclxuICAgICAgICAgIGlmICghdGFzay5pc01haW5Qcm9nKCkgJiYgZm9ybSAhPSBudWxsKSB7XHJcbiAgICAgICAgICAgIGF3YWl0IGZvcm0ubW92ZUluVmlldyhmb3JtLmlzTGluZU1vZGUoKVxyXG4gICAgICAgICAgICAgID8gQ29uc3RhbnRzLk1PVkVfVU5JVF9ST1dcclxuICAgICAgICAgICAgICA6IENvbnN0YW50cy5NT1ZFX1VOSVRfUEFHRSxcclxuICAgICAgICAgICAgICBD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