@magic-xpa/engine 4.1100.0-dev4110.98 → 4.1100.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (492) hide show
  1. package/README.md +7 -7
  2. package/{esm2020 → esm2022}/index.mjs +188 -188
  3. package/{esm2020 → esm2022}/magic-xpa-engine.mjs +1 -1
  4. package/esm2022/src/AccessHelper.mjs +15 -0
  5. package/esm2022/src/ClientManager.mjs +421 -0
  6. package/esm2022/src/CommandsProcessorBase.mjs +56 -0
  7. package/{esm2020 → esm2022}/src/CommandsProcessorManager.mjs +25 -25
  8. package/esm2022/src/CommandsTable.mjs +162 -0
  9. package/esm2022/src/ConstInterface.mjs +517 -0
  10. package/{esm2020 → esm2022}/src/CurrentClientVersion.mjs +2 -2
  11. package/esm2022/src/FlowMonitorInterface.mjs +16 -0
  12. package/esm2022/src/GUIManager.mjs +62 -0
  13. package/esm2022/src/GlobalCommandsManager.mjs +34 -0
  14. package/esm2022/src/GuiEventsProcessor.mjs +156 -0
  15. package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
  16. package/esm2022/src/ServerConfig.mjs +122 -0
  17. package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
  18. package/esm2022/src/bridge/MagicBridge.mjs +41 -0
  19. package/esm2022/src/commands/ClientOriginatedCommandTaskTag.mjs +12 -0
  20. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserLocateDataViewCommand.mjs +8 -8
  21. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserRangeDataviewCommand.mjs +9 -9
  22. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserSortDataViewCommand.mjs +9 -9
  23. package/esm2022/src/commands/ClientToServer/BrowserEscEventCommand.mjs +26 -0
  24. package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
  25. package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +59 -59
  26. package/esm2022/src/commands/ClientToServer/ColumnSortEventCommand.mjs +29 -0
  27. package/esm2022/src/commands/ClientToServer/CommandFactory.mjs +261 -0
  28. package/esm2022/src/commands/ClientToServer/CommandSerializationHelper.mjs +67 -0
  29. package/esm2022/src/commands/ClientToServer/ComputeEventCommand.mjs +26 -0
  30. package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTerminationEventCommand.mjs +24 -21
  31. package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTimeoutResetCommand.mjs +23 -20
  32. package/{esm2020 → esm2022}/src/commands/ClientToServer/ControlItemsRefreshCommand.mjs +8 -8
  33. package/esm2022/src/commands/ClientToServer/DataViewOutputCommand.mjs +13 -0
  34. package/{esm2020 → esm2022}/src/commands/ClientToServer/DataviewCommand.mjs +44 -44
  35. package/esm2022/src/commands/ClientToServer/EvaluateCommand.mjs +40 -0
  36. package/{esm2020 → esm2022}/src/commands/ClientToServer/EventCommand.mjs +43 -40
  37. package/esm2022/src/commands/ClientToServer/ExecOperCommand.mjs +70 -0
  38. package/esm2022/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +25 -0
  39. package/{esm2020 → esm2022}/src/commands/ClientToServer/GlobalParamsQueryCommand.mjs +10 -10
  40. package/{esm2020 → esm2022}/src/commands/ClientToServer/ICommandTaskTag.mjs +1 -1
  41. package/esm2022/src/commands/ClientToServer/IndexChangeEventCommand.mjs +24 -0
  42. package/esm2022/src/commands/ClientToServer/IniputForceWriteCommand.mjs +26 -0
  43. package/{esm2020 → esm2022}/src/commands/ClientToServer/NonReversibleExitEventCommand.mjs +26 -23
  44. package/{esm2020 → esm2022}/src/commands/ClientToServer/QueryCommand.mjs +20 -20
  45. package/esm2022/src/commands/ClientToServer/RecomputeCommand.mjs +30 -0
  46. package/esm2022/src/commands/ClientToServer/RefreshEventCommand.mjs +30 -0
  47. package/esm2022/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +27 -0
  48. package/esm2022/src/commands/ClientToServer/RollbackEventCommand.mjs +43 -0
  49. package/esm2022/src/commands/ClientToServer/SelectProgramCommand.mjs +19 -0
  50. package/{esm2020 → esm2022}/src/commands/ClientToServer/SetTransactionStateDataviewCommand.mjs +9 -9
  51. package/esm2022/src/commands/ClientToServer/SubformOpenEventCommand.mjs +24 -0
  52. package/esm2022/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +27 -0
  53. package/esm2022/src/commands/ClientToServer/TransactionCommand.mjs +34 -0
  54. package/{esm2020 → esm2022}/src/commands/ClientToServer/UnloadCommand.mjs +18 -15
  55. package/esm2022/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +18 -0
  56. package/esm2022/src/commands/DataViewCommandBase.mjs +8 -0
  57. package/{esm2020 → esm2022}/src/commands/IClientCommand.mjs +1 -1
  58. package/esm2022/src/commands/IClientTargetedCommand.mjs +13 -0
  59. package/{esm2020 → esm2022}/src/commands/IClientToServerCommandInfo.mjs +2 -2
  60. package/esm2022/src/commands/ServerToClient/AbortCommand.mjs +65 -0
  61. package/{esm2020 → esm2022}/src/commands/ServerToClient/AddLocateCommand.mjs +21 -21
  62. package/{esm2020 → esm2022}/src/commands/ServerToClient/AddRangeCommand.mjs +62 -62
  63. package/{esm2020 → esm2022}/src/commands/ServerToClient/AddSortCommand.mjs +33 -33
  64. package/esm2022/src/commands/ServerToClient/ClientRefreshCommand.mjs +25 -0
  65. package/esm2022/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +24 -0
  66. package/esm2022/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +45 -0
  67. package/esm2022/src/commands/ServerToClient/OpenURLCommand.mjs +221 -0
  68. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetLocateCommand.mjs +14 -14
  69. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetRangeCommand.mjs +14 -14
  70. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetSortCommand.mjs +14 -14
  71. package/esm2022/src/commands/ServerToClient/ResultCommand.mjs +37 -0
  72. package/esm2022/src/commands/ServerToClient/VerifyCommand.mjs +83 -0
  73. package/{esm2020 → esm2022}/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +132 -132
  74. package/{esm2020 → esm2022}/src/communications/IConnectionStateManager.mjs +1 -1
  75. package/esm2022/src/communications/InteractiveCommunicationsFailureHandler.mjs +15 -0
  76. package/{esm2020 → esm2022}/src/data/DataSourceIdKey.mjs +2 -2
  77. package/esm2022/src/data/DataView.mjs +1613 -0
  78. package/{esm2020 → esm2022}/src/data/DataViewBase.mjs +3 -3
  79. package/esm2022/src/data/DataviewManager.mjs +28 -0
  80. package/esm2022/src/data/DataviewManagerBase.mjs +15 -0
  81. package/esm2022/src/data/DvCache.mjs +67 -0
  82. package/esm2022/src/data/Field.mjs +646 -0
  83. package/esm2022/src/data/FieldBase.mjs +15 -0
  84. package/esm2022/src/data/FieldsTable.mjs +103 -0
  85. package/{esm2020 → esm2022}/src/data/IRecordsTable.mjs +1 -1
  86. package/{esm2020 → esm2022}/src/data/Key.mjs +88 -88
  87. package/esm2022/src/data/Record.mjs +880 -0
  88. package/{esm2020 → esm2022}/src/data/RecordOutOfDataViewException.mjs +15 -15
  89. package/esm2022/src/data/RecordsTable.mjs +267 -0
  90. package/{esm2020 → esm2022}/src/data/TaskTransactionManager.mjs +107 -103
  91. package/{esm2020 → esm2022}/src/data/XMLBasedDcValuesBuilder.mjs +74 -74
  92. package/{esm2020 → esm2022}/src/enums.mjs +23 -23
  93. package/esm2022/src/env/EnvVariablesTable.mjs +340 -0
  94. package/esm2022/src/env/Environment.mjs +487 -0
  95. package/{esm2020 → esm2022}/src/env/ILanguageData.mjs +1 -1
  96. package/esm2022/src/env/LanguageData.mjs +227 -0
  97. package/{esm2020 → esm2022}/src/env/MirrorString.mjs +65 -65
  98. package/esm2022/src/event/ActionManager.mjs +91 -0
  99. package/esm2022/src/event/Event.mjs +1333 -0
  100. package/esm2022/src/event/EventHandler.mjs +766 -0
  101. package/esm2022/src/event/EventHandlerPosition.mjs +204 -0
  102. package/esm2022/src/event/EventsManager.mjs +2988 -0
  103. package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
  104. package/esm2022/src/event/RunTimeEvent.mjs +399 -0
  105. package/{esm2020 → esm2022}/src/event/RunTimeEventBase.mjs +3 -3
  106. package/esm2022/src/event/UserEventsTable.mjs +47 -0
  107. package/esm2022/src/exp/ExpTable.mjs +57 -0
  108. package/esm2022/src/exp/Expression.mjs +200 -0
  109. package/esm2022/src/exp/ExpressionDict.mjs +727 -0
  110. package/esm2022/src/exp/ExpressionEvaluator.mjs +4206 -0
  111. package/esm2022/src/exp/ExpressionLocalJpn.mjs +314 -0
  112. package/{esm2020 → esm2022}/src/exp/GlobalParamsTable.mjs +85 -85
  113. package/esm2022/src/exp/YesNoExp.mjs +36 -0
  114. package/esm2022/src/gui/CreatedFormVector.mjs +23 -0
  115. package/esm2022/src/gui/FormsTable.mjs +66 -0
  116. package/esm2022/src/gui/MgControl.mjs +363 -0
  117. package/esm2022/src/gui/MgForm.mjs +1224 -0
  118. package/esm2022/src/http/HttpManager.mjs +97 -0
  119. package/esm2022/src/http/client/HttpClientAsync.mjs +68 -0
  120. package/{esm2020 → esm2022}/src/http/client/HttpClientBase.mjs +132 -132
  121. package/esm2022/src/http/client/HttpClientEvents.mjs +39 -0
  122. package/esm2022/src/http/client/HttpClientSync.mjs +42 -0
  123. package/esm2022/src/http/client/HttpUtility.mjs +84 -0
  124. package/{esm2020 → esm2022}/src/http/client/ICommunicationsFailureHandler.mjs +1 -1
  125. package/{esm2020 → esm2022}/src/remote/AddUserLocateRemoteDataViewCommand.mjs +18 -18
  126. package/{esm2020 → esm2022}/src/remote/AddUserRangeRemoteDataViewCommand.mjs +18 -18
  127. package/{esm2020 → esm2022}/src/remote/AddUserSortRemoteDataViewCommand.mjs +18 -18
  128. package/esm2022/src/remote/RemoteCommandsProcessor.mjs +883 -0
  129. package/{esm2020 → esm2022}/src/remote/RemoteControlItemsRefreshCommand.mjs +25 -25
  130. package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandBase.mjs +24 -24
  131. package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandFactory.mjs +60 -60
  132. package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandUpdateNonModifiable.mjs +15 -15
  133. package/{esm2020 → esm2022}/src/remote/RemoteDataviewManager.mjs +17 -17
  134. package/{esm2020 → esm2022}/src/remote/RemoteInitDataViewCommand.mjs +10 -10
  135. package/{esm2020 → esm2022}/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +16 -16
  136. package/{esm2020 → esm2022}/src/remote/ResetUserRangeRemoteDataviewCommand.mjs +12 -12
  137. package/{esm2020 → esm2022}/src/remote/ResetUserSortRemoteDataviewCommand.mjs +15 -15
  138. package/esm2022/src/remote/ServerError.mjs +40 -0
  139. package/{esm2020 → esm2022}/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +19 -19
  140. package/esm2022/src/rt/Argument.mjs +265 -0
  141. package/esm2022/src/rt/ArgumentsList.mjs +103 -0
  142. package/esm2022/src/rt/Boundary.mjs +152 -0
  143. package/esm2022/src/rt/CompMainPrgTable.mjs +63 -0
  144. package/esm2022/src/rt/DataviewHeaderBase.mjs +98 -0
  145. package/{esm2020 → esm2022}/src/rt/DataviewHeaderFactory.mjs +6 -6
  146. package/esm2022/src/rt/DataviewHeaders.mjs +53 -0
  147. package/{esm2020 → esm2022}/src/rt/DataviewHeadersSaxHandler.mjs +38 -38
  148. package/{esm2020 → esm2022}/src/rt/ExecutionStack.mjs +94 -94
  149. package/{esm2020 → esm2022}/src/rt/ExecutionStackEntry.mjs +17 -17
  150. package/{esm2020 → esm2022}/src/rt/HandlersTable.mjs +96 -96
  151. package/{esm2020 → esm2022}/src/rt/IDataSourceViewDefinition.mjs +1 -1
  152. package/{esm2020 → esm2022}/src/rt/IDataviewHeader.mjs +1 -1
  153. package/{esm2020 → esm2022}/src/rt/IResultValue.mjs +1 -1
  154. package/esm2022/src/rt/LastFocusedManager.mjs +65 -0
  155. package/esm2022/src/rt/Operation.mjs +735 -0
  156. package/esm2022/src/rt/OperationTable.mjs +67 -0
  157. package/esm2022/src/rt/Recompute.mjs +355 -0
  158. package/{esm2020 → esm2022}/src/rt/RecomputeTable.mjs +62 -62
  159. package/{esm2020 → esm2022}/src/rt/RemoteDataviewHeader.mjs +108 -108
  160. package/esm2022/src/rt/ResultValue.mjs +10 -0
  161. package/esm2022/src/rt/TableCache.mjs +177 -0
  162. package/esm2022/src/rt/TableCacheManager.mjs +67 -0
  163. package/esm2022/src/rt/Transaction.mjs +53 -0
  164. package/esm2022/src/security/UserDetails.mjs +71 -0
  165. package/{esm2020 → esm2022}/src/tasks/IMGDataCollection.mjs +1 -1
  166. package/esm2022/src/tasks/MGData.mjs +552 -0
  167. package/esm2022/src/tasks/MGDataCollection.mjs +252 -0
  168. package/esm2022/src/tasks/RCTimer.mjs +63 -0
  169. package/{esm2020 → esm2022}/src/tasks/RemoteTaskService.mjs +44 -44
  170. package/esm2022/src/tasks/Task.mjs +2499 -0
  171. package/esm2022/src/tasks/TaskBase.mjs +83 -0
  172. package/{esm2020 → esm2022}/src/tasks/TaskServiceBase.mjs +24 -24
  173. package/esm2022/src/tasks/TasksTable.mjs +80 -0
  174. package/esm2022/src/tasks/sort/Sort.mjs +5 -0
  175. package/{esm2020 → esm2022}/src/tasks/sort/SortCollection.mjs +67 -67
  176. package/{esm2020 → esm2022}/src/util/ConstUtils.mjs +13 -13
  177. package/esm2022/src/util/FlowMonitorQueue.mjs +451 -0
  178. package/{esm2020 → esm2022}/src/util/HeapSort.mjs +69 -69
  179. package/{esm2020 → esm2022}/src/util/IMirrorXML.mjs +1 -1
  180. package/{esm2020 → esm2022}/src/util/IServerConfig.mjs +1 -1
  181. package/{esm2020 → esm2022}/src/util/MgBlockingQueue.mjs +1 -1
  182. package/esm2022/src/util/MgPriorityBlockingQueue.mjs +74 -0
  183. package/esm2022/src/util/MgPriorityQueue.mjs +66 -0
  184. package/{esm2020 → esm2022}/src/util/ParamParseResult.mjs +7 -7
  185. package/esm2022/src/util/PrmMap.mjs +152 -0
  186. package/esm2022/src/util/ReturnResult.mjs +46 -0
  187. package/esm2022/src/util/ReturnResultBase.mjs +18 -0
  188. package/esm2022/src/util/Scrambler.mjs +89 -0
  189. package/esm2022/src/util/UniqueIDUtils.mjs +13 -0
  190. package/{esm2020 → esm2022}/src/util/cookie.service.mjs +92 -92
  191. package/{fesm2020 → fesm2022}/magic-xpa-engine.mjs +29888 -29690
  192. package/fesm2022/magic-xpa-engine.mjs.map +1 -0
  193. package/index.d.ts +187 -187
  194. package/package.json +8 -14
  195. package/src/AccessHelper.d.ts +20 -20
  196. package/src/ClientManager.d.ts +35 -32
  197. package/src/CommandsProcessorBase.d.ts +23 -23
  198. package/src/CommandsProcessorManager.d.ts +6 -6
  199. package/src/CommandsTable.d.ts +22 -22
  200. package/src/ConstInterface.d.ts +516 -515
  201. package/src/CurrentClientVersion.d.ts +1 -1
  202. package/src/FlowMonitorInterface.d.ts +15 -15
  203. package/src/GUIManager.d.ts +17 -17
  204. package/src/GlobalCommandsManager.d.ts +17 -17
  205. package/src/GuiEventsProcessor.d.ts +24 -24
  206. package/src/ICommandsTable.d.ts +9 -9
  207. package/src/ServerConfig.d.ts +35 -34
  208. package/src/bridge/IGuiEvent.d.ts +19 -19
  209. package/src/bridge/MagicBridge.d.ts +16 -16
  210. package/src/commands/ClientOriginatedCommandTaskTag.d.ts +8 -8
  211. package/src/commands/ClientToServer/AddUserLocateDataViewCommand.d.ts +4 -4
  212. package/src/commands/ClientToServer/AddUserRangeDataviewCommand.d.ts +6 -6
  213. package/src/commands/ClientToServer/AddUserSortDataViewCommand.d.ts +6 -6
  214. package/src/commands/ClientToServer/BrowserEscEventCommand.d.ts +9 -8
  215. package/src/commands/ClientToServer/ClientOriginatedCommand.d.ts +8 -8
  216. package/src/commands/ClientToServer/ClientOriginatedCommandSerializer.d.ts +6 -6
  217. package/src/commands/ClientToServer/ColumnSortEventCommand.d.ts +11 -10
  218. package/src/commands/ClientToServer/CommandFactory.d.ts +64 -64
  219. package/src/commands/ClientToServer/CommandSerializationHelper.d.ts +20 -20
  220. package/src/commands/ClientToServer/ComputeEventCommand.d.ts +9 -8
  221. package/src/commands/ClientToServer/ContextTerminationEventCommand.d.ts +8 -7
  222. package/src/commands/ClientToServer/ContextTimeoutResetCommand.d.ts +8 -7
  223. package/src/commands/ClientToServer/ControlItemsRefreshCommand.d.ts +6 -6
  224. package/src/commands/ClientToServer/DataViewOutputCommand.d.ts +9 -9
  225. package/src/commands/ClientToServer/DataviewCommand.d.ts +32 -32
  226. package/src/commands/ClientToServer/EvaluateCommand.d.ts +16 -15
  227. package/src/commands/ClientToServer/EventCommand.d.ts +16 -15
  228. package/src/commands/ClientToServer/ExecOperCommand.d.ts +24 -23
  229. package/src/commands/ClientToServer/FetchDataControlValuesEventCommand.d.ts +9 -8
  230. package/src/commands/ClientToServer/GlobalParamsQueryCommand.d.ts +5 -5
  231. package/src/commands/ClientToServer/ICommandTaskTag.d.ts +3 -3
  232. package/src/commands/ClientToServer/IndexChangeEventCommand.d.ts +9 -8
  233. package/src/commands/ClientToServer/IniputForceWriteCommand.d.ts +11 -10
  234. package/src/commands/ClientToServer/NonReversibleExitEventCommand.d.ts +9 -8
  235. package/src/commands/ClientToServer/QueryCommand.d.ts +8 -8
  236. package/src/commands/ClientToServer/RecomputeCommand.d.ts +12 -11
  237. package/src/commands/ClientToServer/RefreshEventCommand.d.ts +13 -12
  238. package/src/commands/ClientToServer/RefreshScreenEventCommand.d.ts +11 -10
  239. package/src/commands/ClientToServer/RollbackEventCommand.d.ts +15 -14
  240. package/src/commands/ClientToServer/SelectProgramCommand.d.ts +7 -6
  241. package/src/commands/ClientToServer/SetTransactionStateDataviewCommand.d.ts +5 -5
  242. package/src/commands/ClientToServer/SubformOpenEventCommand.d.ts +9 -8
  243. package/src/commands/ClientToServer/SubformRefreshEventCommand.d.ts +10 -9
  244. package/src/commands/ClientToServer/TransactionCommand.d.ts +14 -12
  245. package/src/commands/ClientToServer/UnloadCommand.d.ts +8 -7
  246. package/src/commands/ClientToServer/WriteMessageToServerLogCommand.d.ts +6 -6
  247. package/src/commands/DataViewCommandBase.d.ts +6 -6
  248. package/src/commands/IClientCommand.d.ts +2 -2
  249. package/src/commands/IClientTargetedCommand.d.ts +12 -12
  250. package/src/commands/IClientToServerCommandInfo.d.ts +4 -3
  251. package/src/commands/ServerToClient/AbortCommand.d.ts +11 -11
  252. package/src/commands/ServerToClient/AddLocateCommand.d.ts +6 -6
  253. package/src/commands/ServerToClient/AddRangeCommand.d.ts +10 -10
  254. package/src/commands/ServerToClient/AddSortCommand.d.ts +9 -9
  255. package/src/commands/ServerToClient/ClientRefreshCommand.d.ts +7 -7
  256. package/src/commands/ServerToClient/ClientTargetedCommandBase.d.ts +12 -12
  257. package/src/commands/ServerToClient/EnhancedVerifyCommand.d.ts +13 -13
  258. package/src/commands/ServerToClient/OpenURLCommand.d.ts +21 -21
  259. package/src/commands/ServerToClient/ResetLocateCommand.d.ts +6 -6
  260. package/src/commands/ServerToClient/ResetRangeCommand.d.ts +6 -6
  261. package/src/commands/ServerToClient/ResetSortCommand.d.ts +6 -6
  262. package/src/commands/ServerToClient/ResultCommand.d.ts +10 -10
  263. package/src/commands/ServerToClient/VerifyCommand.d.ts +17 -17
  264. package/src/commands/ServerToClient/XMLBasedCommandBuilder.d.ts +11 -11
  265. package/src/communications/IConnectionStateManager.d.ts +4 -4
  266. package/src/communications/InteractiveCommunicationsFailureHandler.d.ts +6 -6
  267. package/src/data/DataSourceIdKey.d.ts +2 -2
  268. package/src/data/DataView.d.ts +162 -162
  269. package/src/data/DataViewBase.d.ts +12 -12
  270. package/src/data/DataviewManager.d.ts +14 -14
  271. package/src/data/DataviewManagerBase.d.ts +11 -11
  272. package/src/data/DvCache.d.ts +15 -15
  273. package/src/data/Field.d.ts +103 -103
  274. package/src/data/FieldBase.d.ts +23 -23
  275. package/src/data/FieldsTable.d.ts +27 -27
  276. package/src/data/IRecordsTable.d.ts +7 -7
  277. package/src/data/Key.d.ts +15 -15
  278. package/src/data/Record.d.ts +157 -156
  279. package/src/data/RecordOutOfDataViewException.d.ts +10 -10
  280. package/src/data/RecordsTable.d.ts +38 -38
  281. package/src/data/TaskTransactionManager.d.ts +17 -17
  282. package/src/data/XMLBasedDcValuesBuilder.d.ts +11 -11
  283. package/src/enums.d.ts +21 -21
  284. package/src/env/EnvVariablesTable.d.ts +17 -17
  285. package/src/env/Environment.d.ts +118 -118
  286. package/src/env/ILanguageData.d.ts +3 -3
  287. package/src/env/LanguageData.d.ts +20 -20
  288. package/src/env/MirrorString.d.ts +15 -15
  289. package/src/event/ActionManager.d.ts +14 -14
  290. package/src/event/Event.d.ts +79 -79
  291. package/src/event/EventHandler.d.ts +66 -66
  292. package/src/event/EventHandlerPosition.d.ts +25 -25
  293. package/src/event/EventsManager.d.ts +205 -204
  294. package/src/event/IEventsManager.d.ts +77 -77
  295. package/src/event/RunTimeEvent.d.ts +126 -123
  296. package/src/event/RunTimeEventBase.d.ts +5 -5
  297. package/src/event/UserEventsTable.d.ts +11 -11
  298. package/src/exp/ExpTable.d.ts +11 -11
  299. package/src/exp/Expression.d.ts +37 -37
  300. package/src/exp/ExpressionDict.d.ts +12 -12
  301. package/src/exp/ExpressionEvaluator.d.ts +198 -198
  302. package/src/exp/ExpressionLocalJpn.d.ts +18 -18
  303. package/src/exp/GlobalParamsTable.d.ts +19 -19
  304. package/src/exp/YesNoExp.d.ts +9 -9
  305. package/src/gui/CreatedFormVector.d.ts +10 -10
  306. package/src/gui/FormsTable.d.ts +15 -15
  307. package/src/gui/MgControl.d.ts +60 -60
  308. package/src/gui/MgForm.d.ts +96 -93
  309. package/src/http/HttpManager.d.ts +25 -25
  310. package/src/http/client/HttpClientAsync.d.ts +16 -16
  311. package/src/http/client/HttpClientBase.d.ts +30 -30
  312. package/src/http/client/HttpClientEvents.d.ts +18 -18
  313. package/src/http/client/HttpClientSync.d.ts +17 -17
  314. package/src/http/client/HttpUtility.d.ts +10 -10
  315. package/src/http/client/ICommunicationsFailureHandler.d.ts +5 -5
  316. package/src/remote/AddUserLocateRemoteDataViewCommand.d.ts +8 -8
  317. package/src/remote/AddUserRangeRemoteDataViewCommand.d.ts +8 -8
  318. package/src/remote/AddUserSortRemoteDataViewCommand.d.ts +8 -8
  319. package/src/remote/RemoteCommandsProcessor.d.ts +51 -51
  320. package/src/remote/RemoteControlItemsRefreshCommand.d.ts +8 -8
  321. package/src/remote/RemoteDataViewCommandBase.d.ts +10 -10
  322. package/src/remote/RemoteDataViewCommandFactory.d.ts +6 -6
  323. package/src/remote/RemoteDataViewCommandUpdateNonModifiable.d.ts +8 -8
  324. package/src/remote/RemoteDataviewManager.d.ts +9 -9
  325. package/src/remote/RemoteInitDataViewCommand.d.ts +7 -7
  326. package/src/remote/ResetUserLocateRemoteDataviewCommand.d.ts +7 -7
  327. package/src/remote/ResetUserRangeRemoteDataviewCommand.d.ts +7 -7
  328. package/src/remote/ResetUserSortRemoteDataviewCommand.d.ts +7 -7
  329. package/src/remote/ServerError.d.ts +16 -16
  330. package/src/remote/SetTransactionStateRemoteDataViewCommand.d.ts +8 -8
  331. package/src/rt/Argument.d.ts +36 -36
  332. package/src/rt/ArgumentsList.d.ts +24 -24
  333. package/src/rt/Boundary.d.ts +27 -27
  334. package/src/rt/CompMainPrgTable.d.ts +10 -10
  335. package/src/rt/DataviewHeaderBase.d.ts +34 -34
  336. package/src/rt/DataviewHeaderFactory.d.ts +5 -5
  337. package/src/rt/DataviewHeaders.d.ts +12 -12
  338. package/src/rt/DataviewHeadersSaxHandler.d.ts +10 -10
  339. package/src/rt/ExecutionStack.d.ts +22 -22
  340. package/src/rt/ExecutionStackEntry.d.ts +7 -7
  341. package/src/rt/HandlersTable.d.ts +19 -19
  342. package/src/rt/IDataSourceViewDefinition.d.ts +6 -6
  343. package/src/rt/IDataviewHeader.d.ts +10 -10
  344. package/src/rt/IResultValue.d.ts +4 -4
  345. package/src/rt/LastFocusedManager.d.ts +23 -23
  346. package/src/rt/Operation.d.ts +97 -97
  347. package/src/rt/OperationTable.d.ts +15 -15
  348. package/src/rt/Recompute.d.ts +41 -41
  349. package/src/rt/RecomputeTable.d.ts +9 -9
  350. package/src/rt/RemoteDataviewHeader.d.ts +14 -14
  351. package/src/rt/ResultValue.d.ts +7 -7
  352. package/src/rt/TableCache.d.ts +29 -29
  353. package/src/rt/TableCacheManager.d.ts +10 -10
  354. package/src/rt/Transaction.d.ts +23 -23
  355. package/src/security/UserDetails.d.ts +16 -16
  356. package/src/tasks/IMGDataCollection.d.ts +26 -26
  357. package/src/tasks/MGData.d.ts +63 -63
  358. package/src/tasks/MGDataCollection.d.ts +42 -42
  359. package/src/tasks/RCTimer.d.ts +13 -13
  360. package/src/tasks/RemoteTaskService.d.ts +16 -16
  361. package/src/tasks/Task.d.ts +312 -312
  362. package/src/tasks/TaskBase.d.ts +123 -123
  363. package/src/tasks/TaskServiceBase.d.ts +16 -16
  364. package/src/tasks/TasksTable.d.ts +21 -21
  365. package/src/tasks/sort/Sort.d.ts +4 -4
  366. package/src/tasks/sort/SortCollection.d.ts +11 -11
  367. package/src/util/ConstUtils.d.ts +3 -3
  368. package/src/util/FlowMonitorQueue.d.ts +70 -70
  369. package/src/util/HeapSort.d.ts +6 -6
  370. package/src/util/IMirrorXML.d.ts +6 -6
  371. package/src/util/IServerConfig.d.ts +11 -11
  372. package/src/util/MgBlockingQueue.d.ts +5 -5
  373. package/src/util/MgPriorityBlockingQueue.d.ts +17 -17
  374. package/src/util/MgPriorityQueue.d.ts +13 -13
  375. package/src/util/ParamParseResult.d.ts +6 -6
  376. package/src/util/PrmMap.d.ts +28 -28
  377. package/src/util/ReturnResult.d.ts +18 -18
  378. package/src/util/ReturnResultBase.d.ts +11 -11
  379. package/src/util/Scrambler.d.ts +10 -10
  380. package/src/util/UniqueIDUtils.d.ts +4 -4
  381. package/src/util/cookie.service.d.ts +8 -8
  382. package/esm2020/src/AccessHelper.mjs +0 -9
  383. package/esm2020/src/ClientManager.mjs +0 -399
  384. package/esm2020/src/CommandsProcessorBase.mjs +0 -58
  385. package/esm2020/src/CommandsTable.mjs +0 -162
  386. package/esm2020/src/ConstInterface.mjs +0 -516
  387. package/esm2020/src/FlowMonitorInterface.mjs +0 -16
  388. package/esm2020/src/GUIManager.mjs +0 -62
  389. package/esm2020/src/GlobalCommandsManager.mjs +0 -34
  390. package/esm2020/src/GuiEventsProcessor.mjs +0 -154
  391. package/esm2020/src/ServerConfig.mjs +0 -117
  392. package/esm2020/src/bridge/MagicBridge.mjs +0 -41
  393. package/esm2020/src/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
  394. package/esm2020/src/commands/ClientToServer/BrowserEscEventCommand.mjs +0 -23
  395. package/esm2020/src/commands/ClientToServer/ColumnSortEventCommand.mjs +0 -26
  396. package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
  397. package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
  398. package/esm2020/src/commands/ClientToServer/ComputeEventCommand.mjs +0 -23
  399. package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
  400. package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
  401. package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
  402. package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
  403. package/esm2020/src/commands/ClientToServer/IndexChangeEventCommand.mjs +0 -21
  404. package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
  405. package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
  406. package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
  407. package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
  408. package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
  409. package/esm2020/src/commands/ClientToServer/SelectProgramCommand.mjs +0 -15
  410. package/esm2020/src/commands/ClientToServer/SubformOpenEventCommand.mjs +0 -21
  411. package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
  412. package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
  413. package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
  414. package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
  415. package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
  416. package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
  417. package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
  418. package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
  419. package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
  420. package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
  421. package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
  422. package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
  423. package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
  424. package/esm2020/src/data/DataView.mjs +0 -1610
  425. package/esm2020/src/data/DataviewManager.mjs +0 -28
  426. package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
  427. package/esm2020/src/data/DvCache.mjs +0 -67
  428. package/esm2020/src/data/Field.mjs +0 -646
  429. package/esm2020/src/data/FieldBase.mjs +0 -18
  430. package/esm2020/src/data/FieldsTable.mjs +0 -103
  431. package/esm2020/src/data/Record.mjs +0 -846
  432. package/esm2020/src/data/RecordsTable.mjs +0 -267
  433. package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
  434. package/esm2020/src/env/Environment.mjs +0 -489
  435. package/esm2020/src/env/LanguageData.mjs +0 -226
  436. package/esm2020/src/event/ActionManager.mjs +0 -91
  437. package/esm2020/src/event/Event.mjs +0 -1333
  438. package/esm2020/src/event/EventHandler.mjs +0 -766
  439. package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
  440. package/esm2020/src/event/EventsManager.mjs +0 -2975
  441. package/esm2020/src/event/RunTimeEvent.mjs +0 -392
  442. package/esm2020/src/event/UserEventsTable.mjs +0 -47
  443. package/esm2020/src/exp/ExpTable.mjs +0 -59
  444. package/esm2020/src/exp/Expression.mjs +0 -200
  445. package/esm2020/src/exp/ExpressionDict.mjs +0 -727
  446. package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4208
  447. package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
  448. package/esm2020/src/exp/YesNoExp.mjs +0 -36
  449. package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
  450. package/esm2020/src/gui/FormsTable.mjs +0 -66
  451. package/esm2020/src/gui/MgControl.mjs +0 -353
  452. package/esm2020/src/gui/MgForm.mjs +0 -1181
  453. package/esm2020/src/http/HttpManager.mjs +0 -97
  454. package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
  455. package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
  456. package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
  457. package/esm2020/src/http/client/HttpUtility.mjs +0 -84
  458. package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
  459. package/esm2020/src/remote/ServerError.mjs +0 -40
  460. package/esm2020/src/rt/Argument.mjs +0 -265
  461. package/esm2020/src/rt/ArgumentsList.mjs +0 -103
  462. package/esm2020/src/rt/Boundary.mjs +0 -152
  463. package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
  464. package/esm2020/src/rt/DataviewHeaderBase.mjs +0 -96
  465. package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
  466. package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
  467. package/esm2020/src/rt/Operation.mjs +0 -735
  468. package/esm2020/src/rt/OperationTable.mjs +0 -67
  469. package/esm2020/src/rt/Recompute.mjs +0 -355
  470. package/esm2020/src/rt/ResultValue.mjs +0 -12
  471. package/esm2020/src/rt/TableCache.mjs +0 -177
  472. package/esm2020/src/rt/TableCacheManager.mjs +0 -67
  473. package/esm2020/src/rt/Transaction.mjs +0 -53
  474. package/esm2020/src/security/UserDetails.mjs +0 -71
  475. package/esm2020/src/tasks/MGData.mjs +0 -552
  476. package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
  477. package/esm2020/src/tasks/RCTimer.mjs +0 -63
  478. package/esm2020/src/tasks/Task.mjs +0 -2496
  479. package/esm2020/src/tasks/TaskBase.mjs +0 -87
  480. package/esm2020/src/tasks/TasksTable.mjs +0 -80
  481. package/esm2020/src/tasks/sort/Sort.mjs +0 -7
  482. package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
  483. package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
  484. package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
  485. package/esm2020/src/util/PrmMap.mjs +0 -151
  486. package/esm2020/src/util/ReturnResult.mjs +0 -46
  487. package/esm2020/src/util/ReturnResultBase.mjs +0 -18
  488. package/esm2020/src/util/Scrambler.mjs +0 -89
  489. package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
  490. package/fesm2015/magic-xpa-engine.mjs +0 -30837
  491. package/fesm2015/magic-xpa-engine.mjs.map +0 -1
  492. package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -1,2496 +0,0 @@
1
- import { Debug, HashUtils, List, NNumber, NString, RefParam, Stack, StringBuilder, isNullOrUndefined } from '@magic-xpa/mscorelib';
2
- import { Constants, InternalInterface, Logger, Logger_LogLevels, StorageAttribute, StrUtil, WindowType, XMLConstants, XmlParser } from '@magic-xpa/utils';
3
- import { Commands, DataModificationTypes, DisplayConvertor, Events, GuiDataCollection, Helps, Manager, NUM_TYPE, PIC, PropInterface, RecordUtils, RuntimeContextBase, Styles, TaskDefinitionId } from '@magic-xpa/gui';
4
- import { DataView } from '../data/DataView';
5
- import { DvCache } from '../data/DvCache';
6
- import { DataViewCommandType } from '../commands/ClientToServer/DataviewCommand';
7
- import { CommandsProcessorBase_SendingInstruction } from '../CommandsProcessorBase';
8
- import { TaskServiceBase } from './TaskServiceBase';
9
- import { TaskTransactionManager } from '../data/TaskTransactionManager';
10
- import { DataviewManager } from '../data/DataviewManager';
11
- import { SortCollection } from './sort/SortCollection';
12
- import { MgForm } from '../gui/MgForm';
13
- import { RemoteTaskService } from './RemoteTaskService';
14
- import { ReturnResult } from '../util/ReturnResult';
15
- import { RunTimeEvent } from '../event/RunTimeEvent';
16
- import { CommandFactory } from '../commands/ClientToServer/CommandFactory';
17
- import { DataviewHeaders } from '../rt/DataviewHeaders';
18
- import { Transaction } from '../rt/Transaction';
19
- import { TasksTable } from './TasksTable';
20
- import { HandlersTable } from '../rt/HandlersTable';
21
- import { RecomputeTable } from '../rt/RecomputeTable';
22
- import { ExpTable } from '../exp/ExpTable';
23
- import { UserEventsTable } from '../event/UserEventsTable';
24
- import { FormsTable } from '../gui/FormsTable';
25
- import { FlowMonitorQueue } from '../util/FlowMonitorQueue';
26
- import { ActionManager } from '../event/ActionManager';
27
- import { ConstInterface } from '../ConstInterface';
28
- import { GUIManager } from '../GUIManager';
29
- import { CommandsProcessorManager } from '../CommandsProcessorManager';
30
- import { EventSubType } from '../enums';
31
- import { OpeningTaskDetails, Task_SubformExecModeEnum, TaskBase } from './TaskBase';
32
- import { LanguageData } from '../env/LanguageData';
33
- import { Environment } from '../env/Environment';
34
- import { LastFocusedManager } from '../rt/LastFocusedManager';
35
- import { GlobalCommandsManager } from '../GlobalCommandsManager';
36
- import { EventsAllowedType } from '../event/IEventsManager';
37
- import { AccessHelper } from '../AccessHelper';
38
- import { MGDataCollection } from './MGDataCollection';
39
- import { RemoteCommandsProcessor } from "../remote/RemoteCommandsProcessor";
40
- import { EventHandlerPosition } from '../event/EventHandlerPosition';
41
- export var Task_Flow;
42
- (function (Task_Flow) {
43
- Task_Flow[Task_Flow["NONE"] = 0] = "NONE";
44
- Task_Flow[Task_Flow["STEP"] = 1] = "STEP";
45
- Task_Flow[Task_Flow["FAST"] = 2] = "FAST";
46
- })(Task_Flow || (Task_Flow = {}));
47
- export var Task_Direction;
48
- (function (Task_Direction) {
49
- Task_Direction[Task_Direction["BACK"] = -1] = "BACK";
50
- Task_Direction[Task_Direction["NONE"] = 0] = "NONE";
51
- Task_Direction[Task_Direction["FORE"] = 1] = "FORE";
52
- })(Task_Direction || (Task_Direction = {}));
53
- export class Task extends TaskBase {
54
- get ParentTask() {
55
- return this._parentTask;
56
- }
57
- set TryingToCommit(value) {
58
- this._tryingToCommit = value;
59
- }
60
- get TryingToCommit() {
61
- return this._tryingToCommit;
62
- }
63
- get TaskService() {
64
- if (this._taskService == null)
65
- this._taskService = new RemoteTaskService();
66
- return this._taskService;
67
- }
68
- static get CommandsProcessor() {
69
- return CommandsProcessorManager.GetCommandsProcessor();
70
- }
71
- get LogicalStudioParentTask() {
72
- if (this.StudioParentTask === null && !super.isMainProg()) {
73
- return GuiDataCollection.MGDataTable.GetMainProgByCtlIdx(this.ContextID, this._ctlIdx);
74
- }
75
- return this.StudioParentTask;
76
- }
77
- get KnownToServer() {
78
- return this._knownToServer;
79
- }
80
- set Transaction(value) {
81
- this.DataviewManager.CurrentDataviewManager.Transaction = value;
82
- }
83
- get Transaction() {
84
- return this.DataviewManager.CurrentDataviewManager.Transaction;
85
- }
86
- get TaskDefinitionId() {
87
- if (this.taskDefinitionId === null) {
88
- this.taskDefinitionId = new TaskDefinitionId(this._ctlIdx, this.ProgramIsn, this.TaskIsn, this._isPrg);
89
- }
90
- return this.taskDefinitionId;
91
- }
92
- static get IsBlockingBatch() {
93
- return false;
94
- }
95
- constructor(parent) {
96
- super();
97
- this._dvCache = null;
98
- this._mgData = null;
99
- this._aborting = false;
100
- this._bExecEndTask = false;
101
- this._isStarted = false;
102
- this._evalOldValues = false;
103
- this._inRecordSuffix = false;
104
- this._cancelWasRaised = false;
105
- this._counter = 0;
106
- this._currStartProgLevel = 0;
107
- this._destinationSubform = false;
108
- this._enableZoomHandler = false;
109
- this._firstRecordCycle = false;
110
- this._originalTaskMode = ' ';
111
- this._inCreateLine = false;
112
- this.InSelect = false;
113
- this.InStartProcess = false;
114
- this._isDestinationCall = false;
115
- this._knownToServer = true;
116
- this._loopStack = null;
117
- this.DelayCommandExecution = false;
118
- this._parentTask = null;
119
- this.ContextTask = null;
120
- this._triggeringTask = null;
121
- this.PathParentTask = null;
122
- this._preventControlChange = false;
123
- this._preventRecordSuffix = false;
124
- this._taskPath = null;
125
- this._tryingToCommit = false;
126
- this._useLoopStack = false;
127
- this._inProcessingTopMostEndTaskSaved = false;
128
- this.InHandleActCancel = false;
129
- this.RuntimeSorts = null;
130
- this.VewFirst = 0;
131
- this.dataViewContent = null;
132
- this.PerformParentRecordPrefix = false;
133
- this.ModeAsParent = false;
134
- this.TaskTransactionManager = null;
135
- this.ExecuteClientSubformRefresh = false;
136
- this.InCommonHandlerBeforeRP = false;
137
- this._taskService = null;
138
- this.hasLocate = false;
139
- this.taskDefinitionId = null;
140
- this.ArgumentsList = null;
141
- this.ConfirmUpdateNo = false;
142
- this.DataSynced = false;
143
- this.UniqueSort = null;
144
- this.RefreshOnVars = null;
145
- this.DvPosDescriptor = null;
146
- this.SubTasks = null;
147
- this.ExpTab = null;
148
- this.UserEvtTab = null;
149
- this.DataviewHeadersTable = null;
150
- this.HandlersTab = null;
151
- this._forms = null;
152
- this.Name = null;
153
- this.PublicName = null;
154
- this.TaskSuffixExecuted = false;
155
- this.RetrunValueExp = 0;
156
- this.SubformControl = null;
157
- if (isNullOrUndefined(parent)) {
158
- this.constructor_0();
159
- return;
160
- }
161
- this.constructor_1(parent);
162
- }
163
- constructor_0() {
164
- this.ActionManager = new ActionManager();
165
- this.DataView = new DataView(this);
166
- this._flowMonitor = FlowMonitorQueue.Instance;
167
- this.ContextTask = this;
168
- this._dvCache = new DvCache(this);
169
- this.PerformParentRecordPrefix = true;
170
- this.DataviewManager = new DataviewManager(this);
171
- this.allowRemoteCmdExecution = true;
172
- this.TaskTransactionManager = new TaskTransactionManager(this);
173
- }
174
- Init() {
175
- this.DataView.Init();
176
- }
177
- constructor_1(parent) {
178
- this.constructor_0();
179
- this.PathParentTask = parent;
180
- this._parentTask = parent;
181
- this._triggeringTask = null;
182
- this.buildTaskPath();
183
- }
184
- static CreateTask() {
185
- let task = new Task();
186
- task.Init();
187
- return task;
188
- }
189
- isAborting() {
190
- return this._aborting;
191
- }
192
- buildTaskPath() {
193
- this._taskPath = new List();
194
- if (this._parentTask._taskPath !== null)
195
- this._taskPath.AddRange(this._parentTask._taskPath.GetEnumerator());
196
- this._taskPath.push(this);
197
- }
198
- async fillData(mgd, openingTaskDetails) {
199
- if (!super.isMainProg()) {
200
- if (this._parentTask === null && openingTaskDetails.CallingTask !== null) {
201
- this._parentTask = openingTaskDetails.CallingTask;
202
- this.buildTaskPath();
203
- openingTaskDetails.CallingTask.addSubTask(this);
204
- }
205
- if (this.PathParentTask === null && openingTaskDetails.PathParentTask !== null) {
206
- this.PathParentTask = openingTaskDetails.PathParentTask;
207
- }
208
- }
209
- if (this._parentTask !== null && this._parentTask.getEnableZoomHandler()) {
210
- this.setEnableZoomHandler();
211
- }
212
- this._mgData = mgd;
213
- this.fillAttributes();
214
- this._mgData.addTask(this);
215
- let parentForm = (this._parentTask !== null) ? this._parentTask.getForm() : null;
216
- while (await this.initInnerObjects(RuntimeContextBase.Instance.Parser.getNextTag(), parentForm)) {
217
- }
218
- this.TaskTransactionManager.PrepareTransactionProperties(this.DataviewManager.RemoteDataviewManager.Transaction, false);
219
- this.HandleTriggerTask();
220
- this.HandlePreviouslyActiveTaskId();
221
- this.CheckAndSetSubForm();
222
- if (this.IsSubForm) {
223
- let subFormCtrl = this.getParent().getForm().getSubFormCtrlForTask(this._taskTag);
224
- if (subFormCtrl !== null) {
225
- subFormCtrl.setSubformTaskId(this._taskTag);
226
- }
227
- if (this.Form !== null) {
228
- this.Form.setSubFormCtrl(subFormCtrl);
229
- }
230
- }
231
- }
232
- HandlePreviouslyActiveTaskId() {
233
- if (this._parentTask !== null && this._parentTask.GetContextTask() !== null && this._mgData !== this._parentTask.getMGData())
234
- this.PreviouslyActiveTaskId = (this._parentTask.GetContextTask()).getTaskTag();
235
- else if (this._parentTask !== null)
236
- this.PreviouslyActiveTaskId = this._parentTask.getTaskTag();
237
- }
238
- HandleTriggerTask() {
239
- this._triggeringTask = this._parentTask;
240
- }
241
- FillTaskTables(taskTablesData) {
242
- if (arguments.length === 1) {
243
- this.FillTaskTables_0();
244
- return;
245
- }
246
- this.FillTaskTables_1();
247
- }
248
- FillTaskTables_0() {
249
- }
250
- fillAttributes() {
251
- let parser = RuntimeContextBase.Instance.Parser;
252
- let endContext = parser.getXMLdata().indexOf(XMLConstants.TAG_CLOSE, parser.getCurrIndex());
253
- if (endContext !== -1 && endContext < parser.getXMLdata().length) {
254
- super.fillAttributes(parser);
255
- if (super.isMainProg())
256
- this._mgData = AccessHelper.mgDataTable.getMGData(0);
257
- }
258
- else {
259
- Logger.Instance.WriteExceptionToLogWithMsg("in Task.fillAttributes() out of string bounds");
260
- }
261
- }
262
- setAttribute(attribute, valueStr) {
263
- let isTagProcessed;
264
- isTagProcessed = super.setAttribute(attribute, valueStr);
265
- if (!isTagProcessed) {
266
- isTagProcessed = true;
267
- switch (attribute) {
268
- case ConstInterface.MG_ATTR_REFRESHON:
269
- if (!(valueStr.trim() === ""))
270
- this.SetRefreshOnVars(valueStr);
271
- break;
272
- case XMLConstants.MG_ATTR_NAME:
273
- this.Name = valueStr;
274
- break;
275
- case ConstInterface.MG_ATTR_DVPOS_DEC:
276
- if (!(valueStr.trim() === ""))
277
- this.setDescriptor(valueStr);
278
- break;
279
- case ConstInterface.MG_ATTR_HAS_LOCATE:
280
- if (+valueStr == 1)
281
- this.hasLocate = true;
282
- break;
283
- case ConstInterface.MG_ATTR_AS_PARENT:
284
- if (+valueStr == 1)
285
- this.ModeAsParent = true;
286
- break;
287
- case ConstInterface.MG_ATTR_TASK_UNIQUE_SORT:
288
- this.UniqueSort = valueStr[0];
289
- break;
290
- case ConstInterface.MG_ATTR_TRANS_ID:
291
- this.setRemoteTransaction(valueStr);
292
- break;
293
- case ConstInterface.MG_ATTR_PUBLIC:
294
- this.PublicName = XmlParser.unescape(valueStr);
295
- break;
296
- case XMLConstants.MG_ATTR_IS_OFFLINE:
297
- this.IsOffline = XmlParser.getBoolean(valueStr);
298
- break;
299
- case XMLConstants.MG_ATTR_RETURN_VALUE_EXP:
300
- this.RetrunValueExp = XmlParser.getInt(valueStr);
301
- break;
302
- case XMLConstants.MG_ATTR_MENUS_FILE_NAME:
303
- break;
304
- default:
305
- isTagProcessed = false;
306
- break;
307
- }
308
- }
309
- if (!isTagProcessed)
310
- Logger.Instance.WriteExceptionToLogWithMsg(NString.Format("Unrecognized attribute: '{0}'", attribute));
311
- return true;
312
- }
313
- async initInnerObjects(foundTagName, parentForm) {
314
- if (foundTagName == null)
315
- return false;
316
- let parser = RuntimeContextBase.Instance.Parser;
317
- switch (foundTagName) {
318
- case XMLConstants.MG_TAG_HELPTABLE:
319
- if (this._helpTab == null)
320
- this._helpTab = new Helps();
321
- if (Events.ShouldLog(Logger_LogLevels.Development))
322
- Events.WriteDevToLog(NString.Format("{0} ...", foundTagName));
323
- this._helpTab.fillData(parser);
324
- break;
325
- case XMLConstants.MG_TAG_DVHEADER:
326
- if (Events.ShouldLog(Logger_LogLevels.Development))
327
- Events.WriteDevToLog(NString.Format("{0} ...", foundTagName));
328
- this.DataView.fillHeaderData(parser);
329
- break;
330
- case XMLConstants.MG_TAG_PROP:
331
- this._propTab.fillData(this, 'T', parser);
332
- break;
333
- case XMLConstants.MG_TAG_FORM:
334
- this.Form = this.FormInitData(parentForm);
335
- break;
336
- case XMLConstants.MG_ATTR_MENU_CONTENT:
337
- break;
338
- case "assemblies":
339
- let endContext = parser.getXMLdata().indexOf('/assemblies', parser.getCurrIndex());
340
- parser.setCurrIndex(endContext);
341
- parser.setCurrIndex2EndOfTag();
342
- break;
343
- case XMLConstants.MG_TAG_FORMS:
344
- this._forms = new FormsTable(this, parentForm);
345
- Logger.Instance.WriteDevToLog(NString.Format("{0} ...", foundTagName));
346
- await this._forms.fillData();
347
- break;
348
- case XMLConstants.MG_TAG_TASK:
349
- if (this.SubTasks == null)
350
- this.SubTasks = new TasksTable();
351
- let subtask = new Task(this);
352
- subtask.Init();
353
- this.SubTasks.addTask(subtask);
354
- let mgd = this._mgData;
355
- if (this.isMainProg())
356
- mgd = AccessHelper.mgDataTable.GetMGDataForStartupProgram();
357
- await subtask.fillData(mgd, new OpeningTaskDetails());
358
- break;
359
- case ConstInterface.MG_TAG_TASKURL:
360
- await Task.ProcessTaskURL();
361
- break;
362
- case ConstInterface.MG_TAG_EXPTABLE:
363
- if (this.ExpTab == null)
364
- this.ExpTab = new ExpTable();
365
- Logger.Instance.WriteDevToLog("goes to exp");
366
- this.ExpTab.fillData(this, parser);
367
- break;
368
- case ConstInterface.MG_TAG_USER_EVENTS:
369
- if (this.UserEvtTab == null)
370
- this.UserEvtTab = new UserEventsTable();
371
- Logger.Instance.WriteDevToLog("goes to user event tab");
372
- this.UserEvtTab.fillData(this, parser);
373
- break;
374
- case ConstInterface.MG_TAG_LINKS:
375
- this.DataviewHeadersTable = new DataviewHeaders(this);
376
- this.DataviewHeadersTable.fillData(parser);
377
- break;
378
- case ConstInterface.MG_TAG_SORTS:
379
- this.RuntimeSorts = new SortCollection();
380
- this.RuntimeSorts.fillData(parser);
381
- break;
382
- case ConstInterface.MG_TAG_TASK_TABLES:
383
- this.FillTaskTables();
384
- break;
385
- case XMLConstants.MG_TAG_RECOMPUTE:
386
- Logger.Instance.WriteDevToLog("goes to recompute");
387
- this.RecomputeFillData(parser);
388
- break;
389
- case ConstInterface.MG_TAG_EVENTHANDLERS:
390
- Logger.Instance.WriteDevToLog("goes to eventhandlers");
391
- if (this.HandlersTab == null)
392
- this.HandlersTab = new HandlersTable();
393
- this.HandlersTab.fillData(this, parser);
394
- this.addExpHandlersToMGData();
395
- break;
396
- default:
397
- if (foundTagName === ("/" + XMLConstants.MG_TAG_TASK)) {
398
- RuntimeContextBase.Instance.Parser.setCurrIndex2EndOfTag();
399
- return false;
400
- }
401
- else {
402
- Logger.Instance.WriteDevToLog("There is no such tag in Task.initInnerObjects . Enter case for " + foundTagName);
403
- return false;
404
- }
405
- }
406
- return true;
407
- }
408
- RecomputeFillData(parser) {
409
- let recomputeTable = new RecomputeTable();
410
- recomputeTable.fillData_1(this.DataView, this, parser);
411
- }
412
- FillTaskTables_1() {
413
- let parser = RuntimeContextBase.Instance.Parser;
414
- let endContext = parser.getXMLdata().indexOf(ConstInterface.MG_TAG_TASK_TABLES_END, parser.getCurrIndex());
415
- endContext = parser.getXMLdata().indexOf(XMLConstants.TAG_CLOSE, endContext) + XMLConstants.TAG_CLOSE.length;
416
- let taskTablesData = parser.getXMLsubstring(endContext);
417
- this.FillTaskTables(taskTablesData);
418
- parser.setCurrIndex(endContext);
419
- }
420
- addExpHandlersToMGData() {
421
- let idx = 0;
422
- for (let i = this.HandlersTab.getSize() - 1; i >= 0; i--) {
423
- let handler = this.HandlersTab.getHandler(i);
424
- let evt = handler.getEvent();
425
- if (evt.getType() === ConstInterface.EVENT_TYPE_EXPRESSION ||
426
- (evt.getType() === ConstInterface.EVENT_TYPE_USER && evt.getUserEventType() === ConstInterface.EVENT_TYPE_EXPRESSION)) {
427
- this._mgData.addExpHandler(handler, idx);
428
- idx++;
429
- }
430
- }
431
- }
432
- SetRefreshOnVars(variables) {
433
- let strTok = StrUtil.tokenize(variables, ",");
434
- let fldNum;
435
- let intVals = new List();
436
- let i;
437
- for (i = 0; i < strTok.length; i++) {
438
- fldNum = NNumber.Parse(strTok[i]);
439
- intVals.push(fldNum);
440
- }
441
- this.RefreshOnVars = new Array(intVals.length);
442
- for (i = 0; i < intVals.length; i++) {
443
- fldNum = intVals.get_Item(i);
444
- this.RefreshOnVars[i] = fldNum;
445
- }
446
- }
447
- setDataSynced(synced) {
448
- this.DataSynced = synced;
449
- }
450
- getField(fldName) {
451
- return this.DataView.getFieldByName(fldName);
452
- }
453
- getExpById(id) {
454
- if (this.ExpTab !== null)
455
- return this.ExpTab.getExpById(id);
456
- else
457
- Logger.Instance.WriteExceptionToLogWithMsg("in Task.GetExpById(): no expression table");
458
- return null;
459
- }
460
- getExpObjectById(id) {
461
- return this.getExpById(id);
462
- }
463
- GetExpressionStorage(expId) {
464
- let result = null;
465
- if (expId > 0) {
466
- let expById = this.getExpById(expId);
467
- Debug.Assert(expById !== null);
468
- result = expById.GetStorageAttribute();
469
- }
470
- return result;
471
- }
472
- async CalculateExpression(expId, resType, length) {
473
- let result = null;
474
- if (expId > 0) {
475
- let expById = this.getExpById(expId);
476
- Debug.Assert(expById !== null);
477
- result = await expById.evaluateWithResultTypeAndLength(resType, length);
478
- }
479
- return result;
480
- }
481
- async insertRecordTable(invalidate, parser) {
482
- if (await this.isCached()) {
483
- let firstTime = this.DataView.getFirstDv();
484
- if (!firstTime && invalidate) {
485
- if (!this.hasLocate) {
486
- if (this.DataView.IncludesFirst()) {
487
- if (!this.DataView.getChanged())
488
- this._dvCache.putInCache(this.DataView.replicate());
489
- else
490
- this._dvCache.removeDvFromCache(this.DataView.getDvPosValue(), true);
491
- }
492
- }
493
- else
494
- this.locatePutInCache();
495
- }
496
- }
497
- await this.DataView.fillData(parser);
498
- if (invalidate)
499
- this.DataView.setChanged(false);
500
- }
501
- getHandlersTab() {
502
- return this.HandlersTab;
503
- }
504
- async buildXML(message) {
505
- this.IsAfterRetryBeforeBuildXML = this.getAfterRetry();
506
- if (this.KnownToServer && !this.IsOffline) {
507
- message.Append(XMLConstants.START_TAG + XMLConstants.MG_TAG_TASK);
508
- message.Append(" " + XMLConstants.MG_ATTR_TASKID + "=\"" + this.getTaskTag() + "\"");
509
- message.Append(" " + ConstInterface.MG_ATTR_TASK_MAINLEVEL + "=\"" + this.getMainLevel() + "\"");
510
- message.Append(XMLConstants.TAG_CLOSE);
511
- await this.DataView.buildXML(message);
512
- if (this.Form != null && this.Form.Opened)
513
- message.Append(this.Form.GetHiddenControlListXML());
514
- message.Append("\n </" + XMLConstants.MG_TAG_TASK + XMLConstants.TAG_CLOSE);
515
- }
516
- }
517
- buildXMLForRngs(message, UserRanges, locate) {
518
- let i;
519
- let fld;
520
- let cellAttr = StorageAttribute.SKIP;
521
- let toBase64 = (Environment.Instance.GetDebugLevel() <= 1);
522
- message.Append(XMLConstants.TAG_CLOSE);
523
- for (i = 0; i < UserRanges.length; i++) {
524
- message.Append(XMLConstants.START_TAG + ConstInterface.USER_RNG);
525
- let rng = UserRanges.get_Item(i);
526
- message.Append(" " + XMLConstants.MG_TAG_FLD + "=\"" + rng.veeIdx + "\"");
527
- fld = this.DataView.getField(rng.veeIdx - 1);
528
- let fldAttr = fld.getType();
529
- if (rng.nullMin)
530
- message.Append(" " + ConstInterface.NULL_MIN_RNG + "=\"1\"");
531
- if (!rng.discardMin && rng.min != null) {
532
- let val = RecordUtils.itemValToXML(rng.min, fldAttr, cellAttr, toBase64);
533
- message.Append(" " + ConstInterface.MIN_RNG + "=\"" + val + "\"");
534
- }
535
- if (rng.nullMax)
536
- message.Append(" " + ConstInterface.NULL_MAX_RNG + "=\"1\"");
537
- if (!rng.discardMax && rng.max != null) {
538
- let val = RecordUtils.itemValToXML(rng.max, fldAttr, cellAttr, toBase64);
539
- message.Append(" " + ConstInterface.MAX_RNG + "=\"" + val + "\"");
540
- }
541
- message.Append(XMLConstants.TAG_TERM);
542
- }
543
- if (locate)
544
- message.Append(XMLConstants.END_TAG + ConstInterface.USER_LOCATES + XMLConstants.TAG_CLOSE);
545
- else
546
- message.Append(XMLConstants.END_TAG + ConstInterface.USER_RANGES + XMLConstants.TAG_CLOSE);
547
- }
548
- buildXMLForSorts(message) {
549
- if (this.UserSorts != null && this.UserSorts.length > 0) {
550
- let i;
551
- for (i = 0; i < this.UserSorts.length; i++) {
552
- message.Append(XMLConstants.TAG_CLOSE);
553
- let srt = this.UserSorts.get_Item(i);
554
- message.Append(XMLConstants.START_TAG + ConstInterface.SORT);
555
- message.Append(" " + XMLConstants.MG_TAG_FLD + "=\"" + srt.fldIdx + "\"");
556
- if (srt.dir)
557
- message.Append(" " + ConstInterface.MG_ATTR_DIR + "=\"1\"");
558
- message.Append(XMLConstants.TAG_TERM);
559
- }
560
- this.UserSorts.Clear();
561
- this.UserSorts = null;
562
- message.Append(XMLConstants.END_TAG + ConstInterface.MG_TAG_SORTS + XMLConstants.TAG_CLOSE);
563
- }
564
- }
565
- getUserEvent(idx) {
566
- Debug.Assert(this.UserEvtTab !== null);
567
- let retEvent = null;
568
- if (this.UserEvtTab !== null)
569
- retEvent = this.UserEvtTab.getEvent(idx);
570
- return retEvent;
571
- }
572
- SetMoveToFirstControl(moveToFirstControl) {
573
- if (moveToFirstControl || !this.IsSubForm) {
574
- if (this.Form !== null) {
575
- let alreadyMoved = this.Form.alreadyMovedToFirstControl();
576
- if (!alreadyMoved)
577
- this.Form.MovedToFirstControl = true;
578
- }
579
- }
580
- }
581
- async Start(moveToFirstControl, callByDestSubForm) {
582
- let nonInteractiveTask = null;
583
- if (!this._isStarted) {
584
- this._isStarted = true;
585
- this.InitializeExecution();
586
- this.InStartProcess = true;
587
- let result = await this.Setup();
588
- if (!result.Success)
589
- return null;
590
- this._inProcessingTopMostEndTaskSaved = AccessHelper.eventsManager.getProcessingTopMostEndTask();
591
- AccessHelper.eventsManager.setProcessingTopMostEndTask(false);
592
- await this.EnableActions();
593
- result = await this.InitializeForm(moveToFirstControl);
594
- if (!result.Success)
595
- return null;
596
- if (!this.IsInteractive && !this._isMainPrg)
597
- nonInteractiveTask = this;
598
- this.DataViewWasRetrieved = true;
599
- let subTasks = this.SubTasks;
600
- if (this.isMainProg())
601
- this.SubTasks = null;
602
- if (this.isMainProg())
603
- this.SubTasks = subTasks;
604
- if (!result.Success)
605
- return null;
606
- if (this._aborting)
607
- return null;
608
- let dataViewCommand = CommandFactory.CreateDataViewCommand(this.getTaskTag(), DataViewCommandType.FirstChunk);
609
- result = await this.DataviewManager.Execute(dataViewCommand);
610
- if (!result.Success)
611
- return null;
612
- this.ResumeSubformLayout();
613
- }
614
- nonInteractiveTask = await this.StartSubTasks(moveToFirstControl, nonInteractiveTask, callByDestSubForm);
615
- this.InStartProcess = false;
616
- return nonInteractiveTask;
617
- }
618
- InitializeExecution() {
619
- super.setBrkLevel(ConstInterface.BRK_LEVEL_REC_MAIN, -1);
620
- this._firstRecordCycle = true;
621
- this._currStartProgLevel = ((this.IsSubForm && this.getParent().getForm().alreadyMovedToFirstControl())
622
- ? this.getParent()._currStartProgLevel
623
- : Task.StartProgLevel);
624
- }
625
- async InitializeForm(moveToFirstControl) {
626
- if (this.Form !== null) {
627
- this.SetMoveToFirstControl(moveToFirstControl);
628
- AccessHelper.eventsManager.pushNewExecStacks();
629
- this.routeParams = this.DataView.GetRouteParams();
630
- await this.InitForm();
631
- AccessHelper.eventsManager.popNewExecStacks();
632
- this.getMGData().StartTimers();
633
- Commands.beginInvoke();
634
- }
635
- return new ReturnResult();
636
- }
637
- async StartSubTasks(moveToFirstControl, nonInteractiveTask, callByDestSubForm) {
638
- if (this.hasSubTasks()) {
639
- for (let i = 0; i < this.SubTasks.getSize(); i = i + 1) {
640
- let task = this.SubTasks.getTask(i);
641
- let tmpNonInteractiveTask = await task.Start(moveToFirstControl, callByDestSubForm);
642
- if (nonInteractiveTask === null)
643
- nonInteractiveTask = tmpNonInteractiveTask;
644
- else if (tmpNonInteractiveTask !== null)
645
- Debug.Assert(false, "more than 1 non interactive in task.start");
646
- }
647
- }
648
- return nonInteractiveTask;
649
- }
650
- async EnableActions() {
651
- let actList = ActionManager.actEnabled;
652
- this.ActionManager.enableList(actList, true, false);
653
- if (this.IsSubForm)
654
- this.ActionManager.enable(InternalInterface.MG_ACT_POST_REFRESH_BY_PARENT, true);
655
- await this.enableModes();
656
- if (await this.checkProp(PropInterface.PROP_TYPE_SELECTION, false)) {
657
- this.ActionManager.enable(InternalInterface.MG_ACT_SELECT, true);
658
- }
659
- let enablePrintdata = await this.checkProp(PropInterface.PROP_TYPE_PRINT_DATA, false);
660
- this.ActionManager.enable(InternalInterface.MG_ACT_PRINT_DATA, enablePrintdata);
661
- if (this.getEnableZoomHandler())
662
- this.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, true);
663
- }
664
- async ShowError(text) {
665
- let mlsTransText = LanguageData.Instance.translate(text);
666
- let mlsTransTitle = LanguageData.Instance.translate(ConstInterface.ERROR_STRING);
667
- await GUIManager.Instance.MessageBox(mlsTransTitle, mlsTransText, Styles.MSGBOX_ICON_ERROR | Styles.MSGBOX_BUTTON_OK);
668
- }
669
- async EndTaskOnError(result, displayError) {
670
- if (!result.Success && !this.isAborting()) {
671
- if (this.InStartProcess) {
672
- await this.endTask(false, false, false);
673
- if (displayError)
674
- await this.ShowError(result.ErrorDescription);
675
- this.InStartProcess = false;
676
- return true;
677
- }
678
- else {
679
- if (displayError)
680
- await this.ShowError(result.ErrorDescription);
681
- await AccessHelper.eventsManager.handleInternalEventWithTask(this, InternalInterface.MG_ACT_EXIT);
682
- }
683
- }
684
- return false;
685
- }
686
- async Setup() {
687
- let result;
688
- this.TaskService.InitTaskPrefixExecutedFlag(this);
689
- this.TaskSuffixExecuted = false;
690
- TaskServiceBase.CreateFirstRecord(this);
691
- let dataViewCommand = CommandFactory.CreateDataViewCommand(this.getTaskTag(), DataViewCommandType.Init);
692
- result = await this.DataviewManager.Execute(dataViewCommand);
693
- if (!result.Success)
694
- return result;
695
- if (result.Success) {
696
- let commands = GlobalCommandsManager.Instance.getCommandsExecutedAfterTaskStarted();
697
- for (let cmdIdx = 0; cmdIdx < commands.length; cmdIdx++) {
698
- let command = (commands.get_Item(cmdIdx));
699
- if (command.TaskTag === this.getTaskTag()) {
700
- await command.Execute(null);
701
- GlobalCommandsManager.Instance.removeCommandsExecutedAfterTaskStarted(command);
702
- }
703
- }
704
- dataViewCommand = CommandFactory.CreateDataViewCommand(this.getTaskTag(), DataViewCommandType.Prepare);
705
- result = await this.DataviewManager.Execute(dataViewCommand);
706
- }
707
- if (result.Success) {
708
- result = this.TaskService.PrepareTask(this);
709
- if (!result.Success)
710
- await this.EndTaskOnError(result, true);
711
- }
712
- if (result.Success) {
713
- dataViewCommand = CommandFactory.CreateDataViewCommand(this.getTaskTag(), DataViewCommandType.InitDataControlViews);
714
- result = await this.DataviewManager.Execute(dataViewCommand);
715
- }
716
- return result;
717
- }
718
- async doFirstRecordCycle() {
719
- if (!this._isMainPrg) {
720
- AccessHelper.eventsManager.pushNewExecStacks();
721
- this.SubformExecMode = Task_SubformExecModeEnum.FIRST_TIME;
722
- await AccessHelper.eventsManager.handleInternalEventWithTaskAndSubformRefresh(this, InternalInterface.MG_ACT_REC_PREFIX, this.IsSubForm);
723
- if (!AccessHelper.eventsManager.GetStopExecutionFlag()) {
724
- if (this.IsSubForm) {
725
- if (this.hasSubTasks())
726
- for (let i = 0; i < this.SubTasks.getSize(); i++) {
727
- let subTask = this.SubTasks.getTask(i);
728
- if (subTask.IsSubForm) {
729
- subTask.getForm().IgnoreFirstRecordCycle = true;
730
- await subTask.doFirstRecordCycle();
731
- }
732
- }
733
- await AccessHelper.eventsManager.handleInternalEventWithTask(this, InternalInterface.MG_ACT_REC_SUFFIX);
734
- }
735
- }
736
- this.SubformExecMode = Task_SubformExecModeEnum.SET_FOCUS;
737
- AccessHelper.eventsManager.popNewExecStacks();
738
- }
739
- }
740
- CheckAndSetSubForm() {
741
- this.IsSubForm = (!super.isMainProg() && this !== this._mgData.getFirstTask());
742
- }
743
- IsRoute() {
744
- return (this.RouterPath != null);
745
- }
746
- async stop() {
747
- let task;
748
- if (this._aborting)
749
- return;
750
- if (this.hasSubTasks()) {
751
- while ((task = this.SubTasks.getTask(0)) != null) {
752
- task.setDestinationSubform(this._destinationSubform);
753
- await task.stop();
754
- }
755
- }
756
- if (!this._isMainPrg)
757
- this._aborting = true;
758
- if (this._parentTask != null) {
759
- this._parentTask.removeSubTask(this);
760
- if (this.IsSubForm) {
761
- let oldTimers = new List(), newTimers = new List();
762
- let mgd = this.getMGData();
763
- if (mgd.getTimerHandlers() != null)
764
- oldTimers = mgd.getTimerHandlers().getTimersVector();
765
- mgd.removeTimerHandler(this);
766
- mgd.removeExpressionHandler(this);
767
- if (mgd.getTimerHandlers() != null)
768
- newTimers = mgd.getTimerHandlers().getTimersVector();
769
- mgd.changeTimers(oldTimers, newTimers);
770
- mgd.removeTask(this);
771
- GUIManager.Instance.abort(this.getForm());
772
- }
773
- }
774
- this.AbortTransaction();
775
- if (this.getClickedControl() != null)
776
- RuntimeContextBase.Instance.CurrentClickedCtrl = null;
777
- if (this.Form != null)
778
- this.Form.removeRefsToCtrls();
779
- if (this.IsSubForm) {
780
- let subForm = this.Form.getSubFormCtrl();
781
- subForm.setSubformTaskId(null);
782
- subForm.initSubformTask();
783
- if (LastFocusedManager.Instance.getLastFocusedTask() === this)
784
- LastFocusedManager.Instance.setLastFocusedTask(this._parentTask);
785
- if (subForm.SubformLoaded)
786
- await (subForm.getProp(PropInterface.PROP_TYPE_VISIBLE)).RefreshDisplay(true);
787
- }
788
- let clearDataViewCommand = CommandFactory.CreateDataViewCommand(this.getTaskTag(), DataViewCommandType.Clear);
789
- await this.DataviewManager.Execute(clearDataViewCommand);
790
- }
791
- abort() {
792
- this.getMGData().abort();
793
- }
794
- hasSubTasks() {
795
- return this.SubTasks !== null && this.SubTasks.getSize() > 0;
796
- }
797
- getTaskDepth(byParentOrder) {
798
- if (byParentOrder)
799
- return this.getTaskDepth_(byParentOrder);
800
- let depth = this.GetContextTask().getTaskDepth_(byParentOrder);
801
- if (this.isMainProg() && this.getCtlIdx() !== ConstInterface.TOP_LEVEL_CONTAINER)
802
- depth = depth + 1;
803
- return depth;
804
- }
805
- getTaskDepth_(byParentOrder) {
806
- let tmpTask = this.getTriggeringTask();
807
- if (tmpTask == null || byParentOrder)
808
- if (this._parentTask == null)
809
- return 1;
810
- else {
811
- if (byParentOrder && this.getCtlIdx() !== this._parentTask.getCtlIdx())
812
- return 2 + this._parentTask.getTaskDepth_(byParentOrder);
813
- return 1 + this._parentTask.getTaskDepth_(byParentOrder);
814
- }
815
- return 1 + (tmpTask).getTaskDepth_(byParentOrder);
816
- }
817
- GetTaskAncestor(generation) {
818
- return this.getTaskAncestor_(generation);
819
- }
820
- getTaskAncestor_(generation) {
821
- let retTask = null;
822
- if (generation === 0)
823
- retTask = this;
824
- else {
825
- let tmpTask = this.getTriggeringTask();
826
- if (tmpTask === null)
827
- tmpTask = this._parentTask;
828
- if (tmpTask !== null)
829
- retTask = tmpTask.getTaskAncestor_(--generation);
830
- }
831
- return retTask;
832
- }
833
- GetTaskDepth() {
834
- return this.getTaskDepth(false);
835
- }
836
- pathContains(task) {
837
- return this._taskPath.Contains(task);
838
- }
839
- SetContextTask(context) {
840
- this.ContextTask = context;
841
- }
842
- GetContextTask() {
843
- let currRec = (this.DataView.getCurrRec());
844
- if (this.InStartProcess
845
- || currRec !== null && (currRec.InCompute || currRec.InRecompute)
846
- || this.Form !== null && this.Form.inRefreshDisplay())
847
- return this;
848
- return this.ContextTask;
849
- }
850
- getTriggeringTask() {
851
- if (this._triggeringTask !== null && this._triggeringTask.getMGData().IsAborting)
852
- this._triggeringTask = this._parentTask;
853
- return this._triggeringTask;
854
- }
855
- setLastParkedCtrl(ctrl) {
856
- super.setLastParkedCtrl(ctrl);
857
- LastFocusedManager.setLastFocusedControl(this, ctrl);
858
- }
859
- queryTaskPath() {
860
- let insertedNames = 0;
861
- let result = new StringBuilder(7936);
862
- let treeRoute = new Array(this.getTaskDepth(false));
863
- this.pathToRoot(treeRoute, false);
864
- for (let tsk = treeRoute.length - 1; tsk >= 0; tsk--) {
865
- let currTsk = treeRoute[tsk];
866
- if (currTsk.isMainProg())
867
- continue;
868
- let nameProp = currTsk.getProp(PropInterface.PROP_TYPE_NAME);
869
- if (nameProp == null)
870
- continue;
871
- let name = nameProp.GetComputedValue();
872
- if (!NString.IsNullOrEmpty(name)) {
873
- if (insertedNames++ !== 0)
874
- result.Append(';');
875
- result.Append(name);
876
- }
877
- }
878
- return result;
879
- }
880
- ctl_itm_2_parent_vee(itm) {
881
- let currTsk;
882
- let currItm = 0;
883
- let lastItm = 0;
884
- let treeRoute = new Array(this.getTaskDepth(true));
885
- this.pathToRoot(treeRoute, true);
886
- for (let tsk = treeRoute.length - 1; tsk >= 0; tsk--) {
887
- currTsk = treeRoute[tsk];
888
- currItm += currTsk.DataView.GetFieldsTab().getSize();
889
- if (itm < currItm) {
890
- itm -= lastItm;
891
- return currTsk.DataView.getField(itm);
892
- }
893
- lastItm = currItm;
894
- }
895
- return null;
896
- }
897
- GetControlIDFromVarItem(item) {
898
- let currTask;
899
- let currItem = 0;
900
- let lastItem = 0;
901
- let noOfControlsBeforeCurrTask = 0;
902
- let treeRoute = new Array(this.getTaskDepth(true));
903
- this.pathToRoot(treeRoute, true);
904
- for (let task = treeRoute.length - 1; task >= 0; task--) {
905
- currTask = treeRoute[task];
906
- currItem += currTask.DataView.GetFieldsTab().getSize();
907
- if (item < currItem) {
908
- item -= lastItem;
909
- let field = currTask.DataView.getField(item);
910
- if (field.getCtrl() != null)
911
- return noOfControlsBeforeCurrTask = noOfControlsBeforeCurrTask + currTask.Form.getControlIdx(field.getCtrl()) + 1;
912
- return 0;
913
- }
914
- if (currTask.Form != null)
915
- noOfControlsBeforeCurrTask += currTask.Form.getCtrlCount();
916
- lastItem = currItem;
917
- }
918
- return 0;
919
- }
920
- GetControlFromControlID(controlID, parent) {
921
- let control = null;
922
- parent.value = -1;
923
- if (controlID >= 0) {
924
- let currTask = null;
925
- let callerTask = null;
926
- let noOfControlsInCurrtask = 0;
927
- let noOfControlsBeforeCurrTask = 0;
928
- let controlIdx = 0;
929
- let treeRoute = new Array(this.getTaskDepth(true));
930
- this.pathToRoot(treeRoute, true);
931
- for (let task = treeRoute.length - 1; task >= 0; task--) {
932
- currTask = treeRoute[task];
933
- if (currTask.Form != null) {
934
- noOfControlsInCurrtask = currTask.Form.getCtrlCount();
935
- if (controlID < (noOfControlsBeforeCurrTask + noOfControlsInCurrtask)) {
936
- controlIdx = controlID - noOfControlsBeforeCurrTask;
937
- control = currTask.Form.CtrlTab.getCtrl(controlIdx);
938
- callerTask = currTask;
939
- break;
940
- }
941
- noOfControlsBeforeCurrTask += noOfControlsInCurrtask;
942
- }
943
- }
944
- if (control != null) {
945
- parent.value = 0;
946
- let prevCtlIdx = treeRoute[0].TaskDefinitionId.CtlIndex;
947
- for (let task = 0; task < treeRoute.length - 1; task++) {
948
- currTask = treeRoute[task];
949
- if (prevCtlIdx !== currTask.TaskDefinitionId.CtlIndex)
950
- parent.value++;
951
- if (callerTask.TaskDefinitionId.CtlIndex === currTask.TaskDefinitionId.CtlIndex)
952
- break;
953
- prevCtlIdx = currTask.TaskDefinitionId.CtlIndex;
954
- }
955
- }
956
- }
957
- return control;
958
- }
959
- ctl_itm_4_parent_vee(parent, vee) {
960
- let tsk;
961
- let depth = this.getTaskDepth(true);
962
- if (parent !== TaskBase.MAIN_PRG_PARENT_ID && depth <= parent)
963
- return vee;
964
- let treeRoute = new Array(depth);
965
- if (vee !== 0) {
966
- this.pathToRoot(treeRoute, true);
967
- let indOfParentInTaskTree = this.getIndOfParentInTaskTree(parent, treeRoute);
968
- let i;
969
- for (i = treeRoute.length - 1; i > indOfParentInTaskTree; i--) {
970
- tsk = treeRoute[i];
971
- vee += tsk.DataView.GetFieldsTab().getSize();
972
- }
973
- }
974
- return vee;
975
- }
976
- getIndOfParentInTaskTree(parent, taskTree) {
977
- let indOfParentInTaskTree = 0;
978
- if (parent === TaskBase.MAIN_PRG_PARENT_ID) {
979
- for (let i = 1; i < taskTree.length; i = i + 1) {
980
- if (taskTree[i].isMainProg() && this._ctlIdx === taskTree[i].getCtlIdx()) {
981
- indOfParentInTaskTree = i;
982
- break;
983
- }
984
- }
985
- }
986
- else
987
- indOfParentInTaskTree = parent;
988
- return indOfParentInTaskTree;
989
- }
990
- getFieldByName(fldName) {
991
- return (this.GetContextTask()).getFieldByName_(fldName);
992
- }
993
- getFieldByName_(fldName) {
994
- let tmpTask;
995
- if (fldName == null)
996
- return null;
997
- let fld = this.getField(fldName);
998
- if (fld == null) {
999
- tmpTask = this.getTriggeringTask() != null ? this.getTriggeringTask() : this._parentTask;
1000
- if (tmpTask != null) {
1001
- if (!this.isMainProg() && this.getCtlIdx() !== tmpTask.getCtlIdx()) {
1002
- let mainPrg = AccessHelper.mgDataTable.GetMainProgByCtlIdx(-1, this.getCtlIdx());
1003
- fld = mainPrg.getFieldByName_(fldName);
1004
- }
1005
- if (fld == null)
1006
- fld = tmpTask.getFieldByName_(fldName);
1007
- }
1008
- }
1009
- return fld;
1010
- }
1011
- getIndexOfFieldByName(fldName) {
1012
- let depth = this.getTaskDepth(true);
1013
- let index = 0;
1014
- let fld = this.getFieldByName(fldName);
1015
- let fldTab;
1016
- if (fld == null)
1017
- return 0;
1018
- let treeRoute = new Array(depth);
1019
- this.pathToRoot(treeRoute, true);
1020
- for (let curr = depth - 1; curr >= 0; curr--) {
1021
- let currTask = treeRoute[curr];
1022
- if (currTask === fld.getTask()) {
1023
- curr = fld.getId();
1024
- index += ++curr;
1025
- break;
1026
- }
1027
- fldTab = currTask.DataView.GetFieldsTab();
1028
- index += fldTab.getSize();
1029
- }
1030
- return index;
1031
- }
1032
- pathToRoot(path, byParentOrder) {
1033
- let task = (byParentOrder ? this : this.GetContextTask());
1034
- for (let i = 0; i < path.length; i++) {
1035
- path[i] = task;
1036
- let ctlIdx = task.getCtlIdx();
1037
- let tmpTask = byParentOrder ? null : task.getTriggeringTask();
1038
- if (tmpTask != null)
1039
- task = tmpTask;
1040
- else {
1041
- task = task.getParent();
1042
- if (task == null) {
1043
- if (!byParentOrder && this.isMainProg() && this.getCtlIdx() !== ConstInterface.TOP_LEVEL_CONTAINER)
1044
- path[i + 1] = this;
1045
- break;
1046
- }
1047
- if (byParentOrder && ctlIdx !== task.getCtlIdx())
1048
- path[++i] = AccessHelper.mgDataTable.GetMainProgByCtlIdx(-1, ctlIdx);
1049
- }
1050
- }
1051
- }
1052
- shouldBeRefreshed() {
1053
- let dataView = this._parentTask.DataView;
1054
- let result = false;
1055
- if (this._parentTask === null || dataView.isPrevCurrRecNull() ||
1056
- (this.RefreshOnVars !== null && !dataView.currEqualsPrev(this.RefreshOnVars)))
1057
- result = true;
1058
- return result;
1059
- }
1060
- async CheckRefreshSubTasks() {
1061
- let ret = false;
1062
- if (this._enteredRecLevel) {
1063
- let subformsToRefresh = await this.GetSubformsToRefresh();
1064
- if (subformsToRefresh.length > 0)
1065
- ret = true;
1066
- }
1067
- return ret;
1068
- }
1069
- GetSubTasks() {
1070
- let subTasks = new List();
1071
- if (this.hasSubTasks()) {
1072
- for (let i = 0; i < this.SubTasks.getSize(); i = i + 1)
1073
- subTasks.push(this.SubTasks.getTask(i));
1074
- }
1075
- return subTasks;
1076
- }
1077
- async GetSubformsToRefresh() {
1078
- let subTasks = this.GetSubTasks();
1079
- let subTasksToRefresh = new List();
1080
- for (let i = 0; i < subTasks.length; i++) {
1081
- let subTask = subTasks.get_Item(i);
1082
- if (await this.ShouldRefreshSubformTask(subTask))
1083
- subTasksToRefresh.push(subTask);
1084
- }
1085
- return subTasksToRefresh;
1086
- }
1087
- async ShouldRefreshSubformTask(subTask) {
1088
- let refresh = false;
1089
- let subformCtrl = subTask.getForm().getSubFormCtrl();
1090
- subTask.DoSubformPrefixSuffix = false;
1091
- if (subformCtrl != null && !subTask.InSelect && subTask.AfterFirstRecordPrefix) {
1092
- let parentMode = this.getMode();
1093
- let modeProperty = (parentMode === Constants.TASK_MODE_QUERY ? PropInterface.PROP_TYPE_ALLOW_QUERY
1094
- : parentMode === Constants.TASK_MODE_MODIFY
1095
- ? PropInterface.PROP_TYPE_ALLOW_MODIFY
1096
- : PropInterface.PROP_TYPE_ALLOW_CREATE);
1097
- if (subTask.ModeAsParent && parentMode !== subTask.getMode() &&
1098
- this.getLevel() === Constants.TASK_LEVEL_RECORD &&
1099
- await (subTask.getProp(PropInterface.PROP_TYPE_ALLOW_OPTION)).getValueBoolean() &&
1100
- await subTask.checkProp(modeProperty, true)) {
1101
- if (!subformCtrl.isVisible() &&
1102
- !await subformCtrl.checkProp(PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN, false)) {
1103
- subformCtrl.RefreshOnVisible = true;
1104
- refresh = false;
1105
- }
1106
- else
1107
- refresh = true;
1108
- await subTask.SetModeAsParent(parentMode);
1109
- }
1110
- else {
1111
- refresh = await subformCtrl.checkProp(PropInterface.PROP_TYPE_AUTO_REFRESH, true) && subTask.shouldBeRefreshed();
1112
- if (refresh) {
1113
- if (!subformCtrl.isVisible() &&
1114
- !await subformCtrl.checkProp(PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN, false)) {
1115
- subformCtrl.RefreshOnVisible = true;
1116
- refresh = false;
1117
- }
1118
- }
1119
- }
1120
- if (refresh)
1121
- subTask.DoSubformPrefixSuffix = true;
1122
- }
1123
- return refresh;
1124
- }
1125
- async SetModeAsParent(parentMode) {
1126
- await this.enableModes();
1127
- if (parentMode === Constants.TASK_MODE_CREATE) {
1128
- let cmd = CommandFactory.CreateEventCommand(this.getTaskTag(), InternalInterface.MG_ACT_RTO_CREATE);
1129
- await this.DataviewManager.Execute(cmd);
1130
- }
1131
- else if (this.getMode() === Constants.TASK_MODE_CREATE) {
1132
- this.setPreventRecordSuffix(true);
1133
- this.setPreventControlChange(true);
1134
- await AccessHelper.eventsManager.handleInternalEventWithTask(this, InternalInterface.MG_ACT_RT_REFRESH_VIEW);
1135
- this.setPreventRecordSuffix(false);
1136
- this.setPreventControlChange(false);
1137
- let subTaskDv = this.DataView;
1138
- if (!subTaskDv.isEmpty() && (subTaskDv.getCurrRec()).getMode() !== DataModificationTypes.Insert)
1139
- this.setMode(parentMode);
1140
- else
1141
- this.setMode(Constants.TASK_MODE_CREATE);
1142
- await this.getForm().RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
1143
- }
1144
- else
1145
- this.setMode(parentMode);
1146
- this.setOriginalTaskMode(parentMode);
1147
- await this.setCreateDeleteActsEnableState();
1148
- }
1149
- async doSubformRecPrefixSuffix() {
1150
- let subTasks = this.GetSubTasks();
1151
- for (let i = 0; i < subTasks.length; i++) {
1152
- let subTask = subTasks.get_Item(i);
1153
- if (subTask.DoSubformPrefixSuffix) {
1154
- await AccessHelper.eventsManager.handleInternalEventWithTaskAndSubformRefresh(subTask, InternalInterface.MG_ACT_REC_PREFIX, true);
1155
- if (!AccessHelper.eventsManager.GetStopExecutionFlag())
1156
- await AccessHelper.eventsManager.handleInternalEventWithTask(subTask, InternalInterface.MG_ACT_REC_SUFFIX);
1157
- }
1158
- }
1159
- }
1160
- CleanDoSubformPrefixSuffix() {
1161
- let subTasks = this.GetSubTasks();
1162
- for (let i = 0; i < subTasks.length; i++) {
1163
- let subTask = subTasks.get_Item(i);
1164
- subTask.DoSubformPrefixSuffix = false;
1165
- }
1166
- }
1167
- mustConfirmInDeleteMode() {
1168
- let prop = this.getProp(PropInterface.PROP_TYPE_CONFIRM_UPDATE);
1169
- return !prop.isExpression();
1170
- }
1171
- addSubTask(subTask) {
1172
- if (this.SubTasks === null)
1173
- this.SubTasks = new TasksTable();
1174
- this.SubTasks.addTask(subTask);
1175
- }
1176
- removeSubTask(subTask) {
1177
- if (this.SubTasks !== null)
1178
- this.SubTasks.removeTask(subTask);
1179
- }
1180
- setTransactionFailed(val) {
1181
- this._transactionFailed = val;
1182
- if (!val)
1183
- this.TransactionErrorHandlingsRetry = null;
1184
- }
1185
- transactionFailed(level) {
1186
- if (level === ConstInterface.TRANS_NONE ||
1187
- (this.Transaction != null && this.Transaction.getLevel() === level))
1188
- return this._transactionFailed;
1189
- else if (level === ConstInterface.TRANS_NONE ||
1190
- (this.TransactionErrorHandlingsRetry != null && this.TransactionErrorHandlingsRetry.getLevel() === level))
1191
- return this._transactionFailed;
1192
- return false;
1193
- }
1194
- setAfterRetry(val) {
1195
- if (this.Transaction != null)
1196
- this.Transaction.setAfterRetry(val);
1197
- else if (this.TransactionErrorHandlingsRetry != null) {
1198
- if (val === ConstInterface.RECOVERY_NONE)
1199
- this.TransactionErrorHandlingsRetry = null;
1200
- else
1201
- this.TransactionErrorHandlingsRetry.setAfterRetry(val);
1202
- }
1203
- }
1204
- getAfterRetry(recovery) {
1205
- if (arguments.length === 0) {
1206
- return this.getAfterRetry_0();
1207
- }
1208
- return this.getAfterRetry_1(recovery);
1209
- }
1210
- getAfterRetry_0() {
1211
- if (this.Transaction != null)
1212
- return this.Transaction.getAfterRetry();
1213
- else if (this.TransactionErrorHandlingsRetry != null)
1214
- return this.TransactionErrorHandlingsRetry.getAfterRetry();
1215
- return false;
1216
- }
1217
- getAfterRetry_1(recovery) {
1218
- if (this.Transaction != null)
1219
- return this.Transaction.getAfterRetry(recovery);
1220
- else if (this.TransactionErrorHandlingsRetry != null)
1221
- return this.TransactionErrorHandlingsRetry.getAfterRetry(recovery);
1222
- return false;
1223
- }
1224
- getExecEndTask() {
1225
- return this._bExecEndTask;
1226
- }
1227
- resetExecEndTask() {
1228
- this._bExecEndTask = false;
1229
- }
1230
- setExecEndTask() {
1231
- this._bExecEndTask = true;
1232
- }
1233
- async evalEndCond(mode) {
1234
- let endTaskCondProp;
1235
- let evalEndCondProp = this.getProp(PropInterface.PROP_TYPE_EVAL_END_CONDITION);
1236
- if (this.InEndTask)
1237
- return false;
1238
- if (this._bExecEndTask)
1239
- return true;
1240
- if (evalEndCondProp != null && (NString.Compare(await evalEndCondProp.getValue(), ConstInterface.END_COND_EVAL_IMMIDIATE, true) === 0 || ((await evalEndCondProp.getValue()).toLowerCase() === mode.toLowerCase()))) {
1241
- endTaskCondProp = this.getProp(PropInterface.PROP_TYPE_END_CONDITION);
1242
- if (endTaskCondProp == null)
1243
- return false;
1244
- let endTask = await endTaskCondProp.getValue();
1245
- if (DisplayConvertor.toBoolean(endTask)) {
1246
- this._bExecEndTask = true;
1247
- return true;
1248
- }
1249
- return false;
1250
- }
1251
- return false;
1252
- }
1253
- setTryingToStop(val) {
1254
- if (this.hasSubTasks()) {
1255
- for (let i = 0; i < this.SubTasks.getSize(); i = i + 1) {
1256
- let task = this.SubTasks.getTask(i);
1257
- task.setTryingToStop(val);
1258
- }
1259
- }
1260
- this.IsTryingToStop = val;
1261
- }
1262
- getInRecordSuffix() {
1263
- return this._inRecordSuffix;
1264
- }
1265
- setInRecordSuffix(bValue) {
1266
- if (bValue !== this._inRecordSuffix) {
1267
- this._inRecordSuffix = bValue;
1268
- return true;
1269
- }
1270
- return false;
1271
- }
1272
- setEvalOldValues(bFlag) {
1273
- if (bFlag !== this._evalOldValues) {
1274
- this._evalOldValues = bFlag;
1275
- return true;
1276
- }
1277
- return false;
1278
- }
1279
- getEvalOldValues() {
1280
- return this._evalOldValues;
1281
- }
1282
- async endTask(reversibleExit, onlyDescs, dueToVerifyError, subformDestination) {
1283
- if (isNullOrUndefined(subformDestination))
1284
- return await this.endTask_1(reversibleExit, onlyDescs, false, dueToVerifyError);
1285
- else
1286
- return await this.endTask_1(reversibleExit, onlyDescs, subformDestination, dueToVerifyError);
1287
- }
1288
- async endTask_1(reversibleExit, onlyDescs, subformDestination, dueToVerifyError) {
1289
- let succeeded = true;
1290
- let closedSubForm = false;
1291
- let subTask;
1292
- let mgdTab = AccessHelper.mgDataTable;
1293
- if ((this.IsSubForm && !subformDestination) && !this._parentTask.InEndTask) {
1294
- succeeded = await this._parentTask.endTask(reversibleExit, onlyDescs, dueToVerifyError);
1295
- }
1296
- else if (!this.isAborting() && !this.InEndTask) {
1297
- try {
1298
- this.InEndTask = true;
1299
- if ((MGDataCollection.Instance.StartupMgData.getFirstTask().InEndTask && MGDataCollection.Instance.StartupMgData.getFirstTask().ClosingFormUI) && AccessHelper.eventsManager.GetStopExecutionFlag()) {
1300
- let cmd = CommandFactory.CreateUnloadCommand();
1301
- MGDataCollection.Instance.getMGData(0).CmdsToServer.Add(cmd);
1302
- await CommandsProcessorManager.GetCommandsProcessor().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
1303
- return;
1304
- }
1305
- if (!this.IsTryingToStop)
1306
- this.setTryingToStop(true);
1307
- let i;
1308
- if (reversibleExit) {
1309
- if (this.hasSubTasks()) {
1310
- if (!RemoteCommandsProcessor.GetInstance().DelayCommandExecution) {
1311
- let pendingTransactions = true;
1312
- let clientOperExist = await this.CheckIfClientOperationExistsInSubformTasks(this, InternalInterface.MG_ACT_TASK_SUFFIX);
1313
- if (!clientOperExist) {
1314
- clientOperExist = await this.CheckIfClientOperationExistsInSubformTasks(this, InternalInterface.MG_ACT_REC_SUFFIX);
1315
- if (!clientOperExist)
1316
- pendingTransactions = this.CheckIfPendingTransactions(this);
1317
- }
1318
- if (!clientOperExist && !pendingTransactions) {
1319
- this.allowRemoteCmdExecution = false;
1320
- this.SetServerSideTaskSuffix(this);
1321
- RemoteCommandsProcessor.GetInstance().DelayCommandExecution = true;
1322
- }
1323
- }
1324
- else
1325
- this.SetServerSideTaskSuffix(this);
1326
- for (i = 0; i < this.SubTasks.getSize() && succeeded; i++) {
1327
- subTask = this.SubTasks.getTask(i);
1328
- closedSubForm = closedSubForm || subTask.IsSubForm;
1329
- await AccessHelper.eventsManager.handleInternalEventWithTask(subTask, InternalInterface.MG_ACT_EXIT);
1330
- succeeded = (!AccessHelper.eventsManager.GetStopExecutionFlag() || dueToVerifyError);
1331
- }
1332
- }
1333
- else {
1334
- if (RemoteCommandsProcessor.GetInstance().DelayCommandExecution)
1335
- this.SetServerSideTaskSuffix(this);
1336
- }
1337
- if (this === mgdTab.StartupMgData.getFirstTask()) {
1338
- for (i = mgdTab.getSize() - 1; i > 0 && succeeded; i--) {
1339
- if (mgdTab.getMGData(i) != null) {
1340
- await AccessHelper.eventsManager.handleInternalEventWithTask(mgdTab.getMGData(i).getFirstTask(), InternalInterface.MG_ACT_EXIT);
1341
- succeeded = (!AccessHelper.eventsManager.GetStopExecutionFlag() || dueToVerifyError);
1342
- }
1343
- }
1344
- }
1345
- }
1346
- if (succeeded) {
1347
- if (reversibleExit && !dueToVerifyError) {
1348
- let forceSuffix = await this.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false);
1349
- if (!this.IsInteractive && forceSuffix === true && this.getMode() === Constants.TASK_MODE_CREATE)
1350
- this.setProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, "0");
1351
- await AccessHelper.eventsManager.handleInternalEventWithTask(this, InternalInterface.MG_ACT_REC_SUFFIX);
1352
- if (!this.IsInteractive && forceSuffix === true && this.getMode() === Constants.TASK_MODE_CREATE)
1353
- this.setProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, "1");
1354
- }
1355
- succeeded = (!AccessHelper.eventsManager.GetStopExecutionFlag() || dueToVerifyError);
1356
- if (succeeded && !onlyDescs)
1357
- this.HandleTransactionInfo();
1358
- let preTskSuffix = succeeded;
1359
- if (succeeded && !onlyDescs && reversibleExit && !dueToVerifyError &&
1360
- (!this.IsSubForm || subformDestination) &&
1361
- this.TaskPrefixExecuted && !this.TaskSuffixExecuted)
1362
- succeeded = await this.handleTaskSuffix(true);
1363
- if (reversibleExit && this.hasSubTasks())
1364
- for (i = 0; i < this.SubTasks.getSize(); i++) {
1365
- subTask = this.SubTasks.getTask(i);
1366
- if (!subTask.IsSubForm)
1367
- await AccessHelper.eventsManager.handleNonReversibleEvent(subTask, InternalInterface.MG_ACT_EXIT);
1368
- }
1369
- if (reversibleExit)
1370
- succeeded = (!AccessHelper.eventsManager.GetStopExecutionFlag() || dueToVerifyError);
1371
- if (preTskSuffix)
1372
- AccessHelper.eventsManager.setStopExecution(false);
1373
- this.setAfterRetry(ConstInterface.RECOVERY_NONE);
1374
- if (!this.isAborting() && succeeded && !onlyDescs) {
1375
- if (reversibleExit) {
1376
- this.setTransactionFailed(false);
1377
- await this.TaskTransactionManager.checkAndCommit(false, ConstInterface.TRANS_TASK_PREFIX, false);
1378
- succeeded = (!AccessHelper.eventsManager.GetStopExecutionFlag() || dueToVerifyError) && !this.isAborting() && !this.transactionFailed(ConstInterface.TRANS_TASK_PREFIX);
1379
- }
1380
- this.setAfterRetry(ConstInterface.RECOVERY_NONE);
1381
- if (succeeded) {
1382
- if (!this.allowRemoteCmdExecution) {
1383
- this.allowRemoteCmdExecution = true;
1384
- RemoteCommandsProcessor.GetInstance().DelayCommandExecution = false;
1385
- }
1386
- else if (this.DelayCommandExecution) {
1387
- this.DelayCommandExecution = false;
1388
- RemoteCommandsProcessor.GetInstance().DelayCommandExecution = true;
1389
- }
1390
- let baseMgd = AccessHelper.mgDataTable.StartupMgData;
1391
- if (reversibleExit && baseMgd.getFirstTask().getTaskTag() === this.getTaskTag()) {
1392
- AccessHelper.eventsManager.setProcessingTopMostEndTask(true);
1393
- await AccessHelper.eventsManager.handleEvents(baseMgd, 0);
1394
- AccessHelper.eventsManager.setProcessingTopMostEndTask(false);
1395
- if (this.isAborting()) {
1396
- RemoteCommandsProcessor.GetInstance().DelayCommandExecution = false;
1397
- this.DelayCommandExecution = false;
1398
- this.allowRemoteCmdExecution = true;
1399
- return true;
1400
- }
1401
- }
1402
- await TaskServiceBase.Exit(this, reversibleExit, subformDestination);
1403
- if (this._parentTask != null && this._parentTask.isMainProg()) {
1404
- let mgd = AccessHelper.mgDataTable.getMGData(0);
1405
- let mainPrgTask = mgd.getMainProg(0);
1406
- let rootTask = AccessHelper.mgDataTable.StartupMgData.getFirstTask();
1407
- let endMainPrg = await mainPrgTask.checkProp(PropInterface.PROP_TYPE_END_CONDITION, false);
1408
- if (this !== rootTask && endMainPrg) {
1409
- let rtEvt = new RunTimeEvent(rootTask);
1410
- rtEvt.setInternal(InternalInterface.MG_ACT_CLOSE);
1411
- rtEvt.setCtrl(null);
1412
- rtEvt.setArgList(null);
1413
- AccessHelper.eventsManager.addToTail(rtEvt);
1414
- }
1415
- }
1416
- MgForm.CreatedForms.remove(this.Form);
1417
- }
1418
- }
1419
- }
1420
- }
1421
- finally {
1422
- if (!this.IsSubForm || subformDestination)
1423
- this.handleFinallyEndTask(succeeded, reversibleExit);
1424
- }
1425
- }
1426
- else if (this.InEndTask)
1427
- succeeded = false;
1428
- AccessHelper.eventsManager.setProcessingTopMostEndTask(this._inProcessingTopMostEndTaskSaved);
1429
- return succeeded;
1430
- }
1431
- SetServerSideTaskSuffix(task) {
1432
- var rtEvt = new RunTimeEvent(task);
1433
- rtEvt.setInternal(InternalInterface.MG_ACT_TASK_SUFFIX);
1434
- let handler = null;
1435
- var evtHanPos = new EventHandlerPosition();
1436
- evtHanPos.init(rtEvt);
1437
- handler = evtHanPos.getNext();
1438
- if (handler != null) {
1439
- for (let i = 0; i < handler.getOperationTab().getSize(); i++) {
1440
- let oper = handler.getOperationTab().getOperation(i);
1441
- oper.setExecOnServer(true);
1442
- }
1443
- }
1444
- if (task.hasSubTasks()) {
1445
- for (let i = 0; i < task.GetSubTasks().length; i++) {
1446
- let subTask = task.SubTasks.getTask(i);
1447
- this.SetServerSideTaskSuffix(subTask);
1448
- }
1449
- }
1450
- }
1451
- async CheckIfClientOperationExistsInSubformTasks(task, eventCode) {
1452
- let clientOperationExist = false;
1453
- var rtEvt = new RunTimeEvent(task);
1454
- rtEvt.setInternal(eventCode);
1455
- let handler = null;
1456
- var evtHanPos = new EventHandlerPosition();
1457
- evtHanPos.init(rtEvt);
1458
- handler = evtHanPos.getNext();
1459
- if (eventCode == InternalInterface.MG_ACT_REC_SUFFIX) {
1460
- let currRecord = task.DataView.getCurrRec();
1461
- if (task.DataView.modifiedRecordsNumber() > 0 || (currRecord != null && currRecord.Modified))
1462
- clientOperationExist = true;
1463
- if (!clientOperationExist) {
1464
- let forceSuffix = await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false);
1465
- if (forceSuffix === true)
1466
- if (task.IsInteractive || task.getMode() !== Constants.TASK_MODE_CREATE)
1467
- clientOperationExist = true;
1468
- }
1469
- }
1470
- if (handler != null && !clientOperationExist) {
1471
- let cnt = handler.getOperationTab().getSize();
1472
- for (let i = 0; i < cnt; i++) {
1473
- let oper = handler.getOperationTab().getOperation(i);
1474
- if (oper.getExecOnClient()) {
1475
- clientOperationExist = true;
1476
- break;
1477
- }
1478
- else {
1479
- if (oper.getType() == ConstInterface.MG_OPER_RAISE_EVENT) {
1480
- if (oper.GetRuntimeEvent().getType() == ConstInterface.EVENT_TYPE_INTERNAL &&
1481
- oper.GetRuntimeEvent().getInternalCode() === InternalInterface.MG_ACT_RT_REFRESH_VIEW) {
1482
- clientOperationExist = true;
1483
- break;
1484
- }
1485
- }
1486
- }
1487
- }
1488
- }
1489
- if (!clientOperationExist && task.hasSubTasks()) {
1490
- for (let i = 0; (!clientOperationExist && i < task.getSubTasks().getSize()); i++) {
1491
- let subTask = task.SubTasks.getTask(i);
1492
- clientOperationExist = await this.CheckIfClientOperationExistsInSubformTasks(subTask, eventCode);
1493
- }
1494
- }
1495
- return clientOperationExist;
1496
- }
1497
- CheckIfPendingTransactions(task) {
1498
- let pendingTransactions = false;
1499
- let currRecord = task.DataView.getCurrRec();
1500
- if (task.DataView.modifiedRecordsNumber() > 0 || (currRecord != null && currRecord.Modified))
1501
- pendingTransactions = true;
1502
- if (!pendingTransactions && task.hasSubTasks()) {
1503
- for (let i = 0; (!pendingTransactions && i < task.getSubTasks().getSize()); i++) {
1504
- let subTask = task.SubTasks.getTask(i);
1505
- pendingTransactions = this.CheckIfPendingTransactions(subTask);
1506
- }
1507
- }
1508
- return pendingTransactions;
1509
- }
1510
- HandleTransactionInfo() {
1511
- let transaction = this.DataviewManager.RemoteDataviewManager.Transaction;
1512
- if (transaction !== null && transaction.isOwner(this) && transaction.getLevel() === 'P') {
1513
- this.DataviewManager.RemoteDataviewManager.Transaction = null;
1514
- this.DataView.setTransCleared();
1515
- }
1516
- }
1517
- async Exit(reversibleExit, subformDestination) {
1518
- let cmd = reversibleExit ?
1519
- CommandFactory.CreateBrowserEscEventCommand(this.getTaskTag(), subformDestination) :
1520
- CommandFactory.CreateNonReversibleExitCommand(this.getTaskTag(), subformDestination);
1521
- this._mgData.CmdsToServer.Add(cmd);
1522
- if (!subformDestination) {
1523
- try {
1524
- if (this.getTaskTag() == MGDataCollection.Instance.StartupMgData.getFirstTask().getTaskTag() ||
1525
- !(MGDataCollection.Instance.StartupMgData.getFirstTask().InEndTask && MGDataCollection.Instance.StartupMgData.getFirstTask().ClosingFormUI))
1526
- await Task.CommandsProcessor.Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
1527
- }
1528
- catch (err) {
1529
- if (this.isMainProg()) {
1530
- this._mgData.CmdsToServer.Add(cmd);
1531
- }
1532
- else
1533
- throw err;
1534
- }
1535
- }
1536
- }
1537
- handleFinallyEndTask(succeeded, reversibleExit) {
1538
- let subTask;
1539
- if (this.hasSubTasks()) {
1540
- for (let i = 0; i < this.SubTasks.getSize(); i++) {
1541
- subTask = this.SubTasks.getTask(i);
1542
- subTask.handleFinallyEndTask(succeeded, reversibleExit);
1543
- }
1544
- }
1545
- this.InEndTask = false;
1546
- if (succeeded)
1547
- this._isStarted = false;
1548
- if (!succeeded && reversibleExit && this.IsTryingToStop)
1549
- this.setTryingToStop(false);
1550
- }
1551
- async handleTaskSuffix(withSubTasks) {
1552
- let succeeded = true;
1553
- let subTask;
1554
- if (withSubTasks) {
1555
- if (this.hasSubTasks()) {
1556
- for (let i = 0; i < this.SubTasks.getSize() && succeeded; i++) {
1557
- subTask = this.SubTasks.getTask(i);
1558
- succeeded = await subTask.handleTaskSuffix(withSubTasks);
1559
- }
1560
- }
1561
- }
1562
- if (succeeded)
1563
- await AccessHelper.eventsManager.handleInternalEventWithTask(this, InternalInterface.MG_ACT_TASK_SUFFIX);
1564
- succeeded = !AccessHelper.eventsManager.GetStopExecutionFlag();
1565
- this.TaskSuffixExecuted = true;
1566
- return succeeded;
1567
- }
1568
- setInCreateLine(inCreateLine) {
1569
- this._inCreateLine = inCreateLine;
1570
- }
1571
- getInCreateLine() {
1572
- return this._inCreateLine;
1573
- }
1574
- async handleEventOnSlaveTasks(internalEvtCode) {
1575
- let i;
1576
- let task = null;
1577
- let failureTask = null;
1578
- let mgdTab = AccessHelper.mgDataTable;
1579
- let triggeredTasks = mgdTab.getTriggeredTasks(this);
1580
- let orphans = null;
1581
- let sameTrans;
1582
- let hasSlaves = false;
1583
- let isOwner = this.Transaction != null && this.Transaction.isOwner(this);
1584
- if (isOwner) {
1585
- AccessHelper.eventsManager.setEventScopeTrans();
1586
- orphans = new List();
1587
- mgdTab.startTasksIteration();
1588
- while ((task = mgdTab.getNextTask()) != null) {
1589
- sameTrans = task.Transaction != null && this.Transaction.getTransId() === task.Transaction.getTransId();
1590
- if (task !== this && sameTrans && task.PreviouslyActiveTaskId != null && mgdTab.GetTaskByID(task.PreviouslyActiveTaskId) == null)
1591
- orphans.push(task);
1592
- }
1593
- }
1594
- let scopeTrans = AccessHelper.eventsManager.isEventScopeTrans();
1595
- for (i = 0; i < triggeredTasks.length && !AccessHelper.eventsManager.GetStopExecutionFlag(); i++) {
1596
- task = triggeredTasks.get_Item(i);
1597
- sameTrans = this.Transaction != null && task.Transaction != null && this.Transaction.getTransId() === task.Transaction.getTransId();
1598
- if (!task.IsSubForm && (scopeTrans && sameTrans) && task.isStarted()) {
1599
- if (task.getForm().FormRefreshed && internalEvtCode === InternalInterface.MG_ACT_REC_PREFIX && task.getLevel() === Constants.TASK_LEVEL_TASK)
1600
- await task.DataView.currRecCompute(false);
1601
- await AccessHelper.eventsManager.handleInternalEventWithTask(task, internalEvtCode);
1602
- hasSlaves = true;
1603
- }
1604
- }
1605
- for (; isOwner && i < orphans.length && !AccessHelper.eventsManager.GetStopExecutionFlag(); i++) {
1606
- task = orphans.get_Item(i);
1607
- if (task.getForm().FormRefreshed && internalEvtCode === InternalInterface.MG_ACT_REC_PREFIX && task.getLevel() === Constants.TASK_LEVEL_TASK)
1608
- await task.DataView.currRecCompute(false);
1609
- await AccessHelper.eventsManager.handleInternalEventWithTask(task, internalEvtCode);
1610
- hasSlaves = true;
1611
- }
1612
- if (hasSlaves && AccessHelper.eventsManager.GetStopExecutionFlag())
1613
- failureTask = task;
1614
- if (isOwner)
1615
- AccessHelper.eventsManager.clearEventScope();
1616
- return failureTask;
1617
- }
1618
- async enableRecordActions() {
1619
- let dataview = this.DataView;
1620
- await this.setCreateDeleteActsEnableState();
1621
- if (dataview.IncludesFirst() || dataview.IsOneWayKey) {
1622
- if (dataview.isEmptyDataview() || dataview.getCurrRecIdx() === 0) {
1623
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVLINE, false);
1624
- if (dataview.IsOneWayKey)
1625
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_BEGTBL, true);
1626
- else
1627
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_BEGTBL, false);
1628
- if (this.Form.isScreenMode())
1629
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVPAGE, false);
1630
- }
1631
- else {
1632
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVLINE, true);
1633
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_BEGTBL, true);
1634
- if (this.Form.isScreenMode())
1635
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVPAGE, true);
1636
- }
1637
- if (!this.Form.isScreenMode())
1638
- if (dataview.isEmptyDataview() || (dataview.getCurrRecIdx() === 0) || (dataview.getTopRecIdx() === 0))
1639
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVPAGE, false);
1640
- else
1641
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVPAGE, true);
1642
- }
1643
- else {
1644
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_BEGTBL, true);
1645
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVPAGE, true);
1646
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVLINE, true);
1647
- }
1648
- if (dataview.IncludesLast()) {
1649
- if (((this.getMode() === Constants.TASK_MODE_QUERY) || dataview.isEmptyDataview() ||
1650
- ((this.getMode() === Constants.TASK_MODE_MODIFY) &&
1651
- (!Environment.Instance.allowCreateInModifyMode(this.getCompIdx()) ||
1652
- !await this.checkProp(PropInterface.PROP_TYPE_ALLOW_CREATE, true)))) && (dataview.getCurrRecIdx() + 1) === dataview.getSize()) {
1653
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTLINE, false);
1654
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_ENDTBL, false);
1655
- if (this.Form.isScreenMode())
1656
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTPAGE, false);
1657
- }
1658
- else {
1659
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTLINE, true);
1660
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_ENDTBL, true);
1661
- if (this.Form.isScreenMode())
1662
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTPAGE, true);
1663
- }
1664
- if (!this.Form.isScreenMode()) {
1665
- if (dataview.isEmptyDataview() || ((dataview.getSize() - dataview.getTopRecIdx()) <= this.Form.getRowsInPage()))
1666
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTPAGE, false);
1667
- else
1668
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTPAGE, true);
1669
- }
1670
- }
1671
- else {
1672
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTLINE, true);
1673
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTPAGE, true);
1674
- this.ActionManager.enable(InternalInterface.MG_ACT_TBL_ENDTBL, true);
1675
- }
1676
- if (dataview.isEmptyDataview())
1677
- this.ActionManager.enable(InternalInterface.MG_ACT_CANCEL, false);
1678
- else
1679
- this.ActionManager.enable(InternalInterface.MG_ACT_CANCEL, true);
1680
- this.ActionManager.enable(InternalInterface.MG_ACT_ENTER_ROW_EDITING, true);
1681
- this.ActionManager.enable(InternalInterface.MG_ACT_NO_PROG_EXE_RIGHTS, true);
1682
- }
1683
- isStarted() {
1684
- return this._isStarted;
1685
- }
1686
- getSubTasks() {
1687
- return this.SubTasks;
1688
- }
1689
- refreshesOn(fldId) {
1690
- let result = false;
1691
- for (let i = 0; !result && this.RefreshOnVars !== null && i < this.RefreshOnVars.length; i++) {
1692
- result = (this.RefreshOnVars[i] === fldId);
1693
- }
1694
- return result;
1695
- }
1696
- AbortTransaction() {
1697
- this.DataviewManager.RemoteDataviewManager.Transaction = null;
1698
- }
1699
- setPreventRecordSuffix(val) {
1700
- this._preventRecordSuffix = val;
1701
- }
1702
- getPreventRecordSuffix() {
1703
- return this._preventRecordSuffix;
1704
- }
1705
- setPreventControlChange(val) {
1706
- this._preventControlChange = val;
1707
- }
1708
- getPreventControlChange() {
1709
- return this._preventControlChange;
1710
- }
1711
- resetKnownToServer() {
1712
- this._knownToServer = false;
1713
- }
1714
- evaluateDescriptor() {
1715
- let result = "";
1716
- let res;
1717
- if (this.DvPosDescriptor == null)
1718
- return HashUtils.GetHashCode(result);
1719
- let first = true;
1720
- for (let i = 0; i < this.DvPosDescriptor.length; i++) {
1721
- if (!first)
1722
- result += ";";
1723
- let currentCell = this.DvPosDescriptor.get_Item(i);
1724
- let currentTag = currentCell[0];
1725
- let currentVeeIdx = NNumber.Parse(currentCell[1]);
1726
- let currentTask = AccessHelper.mgDataTable.GetTaskByID(currentTag);
1727
- let currentField = currentTask.DataView.getField(currentVeeIdx);
1728
- let dispVal = currentField.getDispValue();
1729
- if (currentField.isNull())
1730
- dispVal = "";
1731
- let pic;
1732
- switch (currentField.getType()) {
1733
- case StorageAttribute.BOOLEAN:
1734
- case StorageAttribute.ALPHA:
1735
- case StorageAttribute.UNICODE:
1736
- case StorageAttribute.BLOB:
1737
- case StorageAttribute.BLOB_VECTOR:
1738
- result += dispVal;
1739
- break;
1740
- case StorageAttribute.DATE:
1741
- case StorageAttribute.TIME:
1742
- if (dispVal !== "") {
1743
- pic = new PIC(currentField.getPicture(), currentField.getType(), 0);
1744
- let conv = DisplayConvertor.Instance;
1745
- result += conv.mg2disp(dispVal, "", pic, false, this.getCompIdx(), false);
1746
- }
1747
- break;
1748
- case StorageAttribute.NUMERIC:
1749
- if (dispVal !== "") {
1750
- res = new NUM_TYPE(dispVal);
1751
- pic = new PIC(currentField.getPicture(), currentField.getType(), 0);
1752
- result += res.to_a(pic);
1753
- }
1754
- break;
1755
- }
1756
- first = false;
1757
- }
1758
- let tmpStr2 = StrUtil.stringToHexaDump(result, 4);
1759
- return HashUtils.GetHashCode(tmpStr2);
1760
- }
1761
- setDescriptor(newDesc) {
1762
- if (!(newDesc.trim() === "")) {
1763
- let desc = StrUtil.tokenize(newDesc, ";");
1764
- this.DvPosDescriptor = new List();
1765
- for (let i = 0; i < desc.length; i = i + 1) {
1766
- let cell = new Array(2);
1767
- let tagVeePair = StrUtil.tokenize(desc[i], ",");
1768
- cell[0] = tagVeePair[0];
1769
- cell[1] = tagVeePair[1];
1770
- this.DvPosDescriptor.push(cell);
1771
- }
1772
- }
1773
- }
1774
- getTaskCache() {
1775
- return this._dvCache;
1776
- }
1777
- async prepareCache(ignoreCurr) {
1778
- let success = true;
1779
- if (!ignoreCurr) {
1780
- if (await this.isCached()) {
1781
- if (this.DataView.getChanged()) {
1782
- this._dvCache.removeDvFromCache(this.DataView.getDvPosValue(), true);
1783
- success = false;
1784
- }
1785
- }
1786
- else {
1787
- if (this.IsSubForm && !await this.isCached()) {
1788
- success = false;
1789
- }
1790
- }
1791
- }
1792
- let curretTask;
1793
- if (this.hasSubTasks()) {
1794
- for (let i = 0; i < this.SubTasks.getSize(); i = i + 1) {
1795
- curretTask = this.SubTasks.getTask(i);
1796
- if (!await curretTask.prepareCache(false)) {
1797
- success = false;
1798
- }
1799
- }
1800
- }
1801
- return success;
1802
- }
1803
- async testAndSet(ignoreCurr) {
1804
- if (!ignoreCurr && await this.isCached()) {
1805
- let requestedDv = this.evaluateDescriptor();
1806
- if (requestedDv !== this.DataView.getDvPosValue()) {
1807
- let fromCache = this._dvCache.getCachedDataView(requestedDv);
1808
- if (fromCache == null)
1809
- return false;
1810
- await this.changeDv(fromCache);
1811
- }
1812
- this.DoSubformPrefixSuffix = true;
1813
- }
1814
- if (this.hasSubTasks()) {
1815
- for (let i = 0; i < this.SubTasks.getSize(); i++) {
1816
- if (!await this.SubTasks.getTask(i).testAndSet(false))
1817
- return false;
1818
- }
1819
- }
1820
- return true;
1821
- }
1822
- async changeDv(fromCache) {
1823
- let dataview = this.DataView;
1824
- if (!this.hasLocate) {
1825
- if (!dataview.getChanged() && dataview.IncludesFirst())
1826
- this._dvCache.putInCache(dataview.replicate());
1827
- }
1828
- else
1829
- this.locatePutInCache();
1830
- await dataview.setSameAs(fromCache);
1831
- dataview.takeFldValsFromCurrRec();
1832
- this.Form.SetTableItemsCount(0, true);
1833
- this.Form.setTableItemsCount(false);
1834
- await this.Form.RefreshDisplay(Constants.TASK_REFRESH_FORM);
1835
- this.setOriginalTaskMode(this.getMode());
1836
- }
1837
- setOriginalTaskMode(originalTaskMode) {
1838
- this._originalTaskMode = originalTaskMode.charAt(0);
1839
- }
1840
- getOriginalTaskMode() {
1841
- return this._originalTaskMode;
1842
- }
1843
- async isCached() {
1844
- return this.IsSubForm && await this.Form.getSubFormCtrl().checkProp(PropInterface.PROP_TYPE_IS_CACHED, false);
1845
- }
1846
- locatePutInCache() {
1847
- let cached = this._dvCache.getCachedDataView(this.DataView.getDvPosValue());
1848
- if (cached != null) {
1849
- if (this.DataView.checkFirst(cached.getLocateFirstRec()) && !this.DataView.getChanged()) {
1850
- this.DataView.setLocateFirstRec(cached.getLocateFirstRec());
1851
- this._dvCache.putInCache(this.DataView.replicate());
1852
- }
1853
- else
1854
- this._dvCache.removeDvFromCache(this.DataView.getDvPosValue(), true);
1855
- }
1856
- else {
1857
- if (!this.DataView.getChanged())
1858
- this._dvCache.putInCache(this.DataView.replicate());
1859
- }
1860
- }
1861
- HasLoacte() {
1862
- return this.hasLocate;
1863
- }
1864
- setRemoteTransaction(transId) {
1865
- let mgdTab = AccessHelper.mgDataTable;
1866
- let transTask;
1867
- let isFind = false;
1868
- mgdTab.startTasksIteration();
1869
- while ((transTask = mgdTab.getNextTask()) != null) {
1870
- if (transTask.DataviewManager.RemoteDataviewManager.Transaction != null &&
1871
- transTask.DataviewManager.RemoteDataviewManager.Transaction.getTransId() === transId) {
1872
- isFind = true;
1873
- break;
1874
- }
1875
- }
1876
- this.DataviewManager.RemoteDataviewManager.Transaction = (isFind ?
1877
- transTask.DataviewManager.RemoteDataviewManager.Transaction :
1878
- new Transaction(this, transId));
1879
- }
1880
- setTransOwnerTask() {
1881
- this.Transaction.setOwnerTask(this);
1882
- this.Transaction.setTransBegin('T');
1883
- }
1884
- getLoopCounter() {
1885
- let result = 0;
1886
- if (this._useLoopStack && this._loopStack !== null && !(this._loopStack.count() === 0)) {
1887
- result = this._loopStack.peek();
1888
- }
1889
- return result;
1890
- }
1891
- enterLoop() {
1892
- if (this._loopStack === null)
1893
- this._loopStack = new Stack();
1894
- this._loopStack.push(0);
1895
- }
1896
- leaveLoop() {
1897
- this.popLoopCounter();
1898
- }
1899
- popLoopCounter() {
1900
- let result = 0;
1901
- if (this._loopStack !== null && !(this._loopStack.count() === 0))
1902
- result = this._loopStack.pop();
1903
- return result;
1904
- }
1905
- increaseLoopCounter() {
1906
- this._loopStack.push(this.popLoopCounter() + 1);
1907
- }
1908
- getLoopStackSize() {
1909
- if (this._loopStack !== null)
1910
- return this._loopStack.count();
1911
- return 0;
1912
- }
1913
- setUseLoopStack(val) {
1914
- this._useLoopStack = val;
1915
- }
1916
- getDataviewHeaders() {
1917
- return this.DataviewHeadersTable;
1918
- }
1919
- isFirstRecordCycle(Value_) {
1920
- if (arguments.length === 0) {
1921
- return this.isFirstRecordCycle_0();
1922
- }
1923
- return this.isFirstRecordCycle_1(Value_);
1924
- }
1925
- isFirstRecordCycle_0() {
1926
- return this._firstRecordCycle;
1927
- }
1928
- isFirstRecordCycle_1(Value_) {
1929
- this._firstRecordCycle = Value_;
1930
- }
1931
- getPublicName() {
1932
- return this.PublicName;
1933
- }
1934
- async isAllowEvents() {
1935
- let prop = this.getProp(PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS);
1936
- return await prop.getValueBoolean();
1937
- }
1938
- getExternalTaskId() {
1939
- let taskId = "";
1940
- let prop = this.getProp(PropInterface.PROP_TYPE_TASK_ID);
1941
- if (prop != null)
1942
- taskId = prop.GetComputedValue();
1943
- return taskId;
1944
- }
1945
- isTransactionOwner() {
1946
- let isTransOwner = false;
1947
- if (this.Transaction != null && this.Transaction.isOwner(this))
1948
- isTransOwner = true;
1949
- return isTransOwner;
1950
- }
1951
- isTransactionOnLevel(level) {
1952
- return this.isTransactionOwner() && this.Transaction.getLevel() === level;
1953
- }
1954
- isProgram() {
1955
- return this._isPrg;
1956
- }
1957
- async enableModes() {
1958
- let enable = await this.checkProp(PropInterface.PROP_TYPE_ALLOW_MODIFY, true);
1959
- this.ActionManager.enable(InternalInterface.MG_ACT_RTO_MODIFY, enable);
1960
- enable = await this.checkProp(PropInterface.PROP_TYPE_ALLOW_CREATE, true);
1961
- this.ActionManager.enable(InternalInterface.MG_ACT_RTO_CREATE, enable);
1962
- enable = await this.checkProp(PropInterface.PROP_TYPE_ALLOW_QUERY, true);
1963
- this.ActionManager.enable(InternalInterface.MG_ACT_RTO_QUERY, enable);
1964
- enable = await this.checkProp(PropInterface.PROP_TYPE_ALLOW_RANGE, true);
1965
- this.ActionManager.enable(InternalInterface.MG_ACT_RTO_RANGE, enable);
1966
- enable = await this.checkProp(PropInterface.PROP_TYPE_ALLOW_LOCATE, true);
1967
- this.ActionManager.enable(InternalInterface.MG_ACT_RTO_LOCATE, enable);
1968
- this.ActionManager.enable(InternalInterface.MG_ACT_RTO_SEARCH, enable);
1969
- enable = await this.checkProp(PropInterface.PROP_TYPE_ALLOW_SORT, true);
1970
- this.ActionManager.enable(InternalInterface.MG_ACT_SORT_RECORDS, enable);
1971
- enable = await this.checkProp(PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX, true);
1972
- this.ActionManager.enable(InternalInterface.MG_ACT_VIEW_BY_KEY, enable);
1973
- this.ActionManager.enable(InternalInterface.MG_ACT_DUMP_ENVIRONMENT, true);
1974
- }
1975
- setEnableZoomHandler() {
1976
- this._enableZoomHandler = true;
1977
- }
1978
- getEnableZoomHandler() {
1979
- return this._enableZoomHandler;
1980
- }
1981
- isDestinationSubform() {
1982
- return this._destinationSubform;
1983
- }
1984
- setDestinationSubform(destinationSubform) {
1985
- this._destinationSubform = destinationSubform;
1986
- }
1987
- getIsDestinationCall() {
1988
- return this._isDestinationCall;
1989
- }
1990
- setIsDestinationCall(isDestinationCall) {
1991
- this._isDestinationCall = isDestinationCall;
1992
- }
1993
- setCancelWasRaised(val) {
1994
- this._cancelWasRaised = val;
1995
- }
1996
- cancelWasRaised() {
1997
- return this._cancelWasRaised;
1998
- }
1999
- enableCreateActs(val) {
2000
- this.ActionManager.enable(InternalInterface.MG_ACT_CRELINE, val);
2001
- this.ActionManager.enable(InternalInterface.MG_ACT_CRELINE_ABOVE, (this.getForm().HasTable()) ? val : false);
2002
- }
2003
- async setCreateDeleteActsEnableState() {
2004
- if (!(this.DataView).isEmptyDataview() && await this.checkProp(PropInterface.PROP_TYPE_ALLOW_DELETE, true) &&
2005
- this.getMode() === Constants.TASK_MODE_MODIFY && this.DataView.HasMainTable)
2006
- this.ActionManager.enable(InternalInterface.MG_ACT_DELLINE, true);
2007
- else
2008
- this.ActionManager.enable(InternalInterface.MG_ACT_DELLINE, false);
2009
- if ((await this.checkProp(PropInterface.PROP_TYPE_ALLOW_CREATE, true)) &&
2010
- (this.DataView.HasMainTable &&
2011
- (this.getMode() === Constants.TASK_MODE_MODIFY && Environment.Instance.allowCreateInModifyMode(this.getCompIdx())) ||
2012
- (this.getMode() === Constants.TASK_MODE_CREATE)))
2013
- this.enableCreateActs(true);
2014
- else
2015
- this.enableCreateActs(false);
2016
- }
2017
- setEmptyDataview(emptyDataview) {
2018
- this.DataView.setEmptyDataview(emptyDataview);
2019
- }
2020
- getName() {
2021
- return this.Name;
2022
- }
2023
- async emptyDataviewOpen(subformRefresh) {
2024
- if (this.getLevel() === Constants.TASK_LEVEL_TASK) {
2025
- this.ActionManager.enable(InternalInterface.MG_ACT_EMPTY_DATAVIEW, true);
2026
- if (this.IsSubForm) {
2027
- let rtEvnt = AccessHelper.eventsManager.getLastRtEvent();
2028
- if ((rtEvnt != null && rtEvnt.getInternalCode() == InternalInterface.MG_ACT_RT_REFRESH_VIEW) || subformRefresh) {
2029
- let rtEvt = new RunTimeEvent(this);
2030
- rtEvt.setInternal(InternalInterface.MG_ACT_EMPTY_DATAVIEW);
2031
- rtEvt.SetEventSubType(EventSubType.Normal);
2032
- await AccessHelper.eventsManager.handleEvent(rtEvt, false);
2033
- }
2034
- }
2035
- else
2036
- AccessHelper.eventsManager.addInternalEventWithItaskAndCode(this, InternalInterface.MG_ACT_EMPTY_DATAVIEW);
2037
- this.setLevel(Constants.TASK_LEVEL_RECORD);
2038
- if (this.SubformExecMode !== Task_SubformExecModeEnum.FIRST_TIME && subformRefresh && await this.CheckRefreshSubTasks()) {
2039
- await this.DataView.computeSubForms();
2040
- await this.doSubformRecPrefixSuffix();
2041
- }
2042
- await this.enableRecordActions();
2043
- this.ActionManager.enable(InternalInterface.MG_ACT_RT_REFRESH_RECORD, false);
2044
- this.ActionManager.enable(InternalInterface.MG_ACT_RT_REFRESH_SCREEN, false);
2045
- }
2046
- }
2047
- emptyDataviewClose() {
2048
- this.ActionManager.enable(InternalInterface.MG_ACT_EMPTY_DATAVIEW, false);
2049
- this.setLevel(Constants.TASK_LEVEL_TASK);
2050
- this.ActionManager.enable(InternalInterface.MG_ACT_RT_REFRESH_RECORD, true);
2051
- this.ActionManager.enable(InternalInterface.MG_ACT_RT_REFRESH_SCREEN, true);
2052
- }
2053
- async SubformRefresh(subformTask, explicitSubformRefresh) {
2054
- let currTask = LastFocusedManager.Instance.getLastFocusedTask();
2055
- let isInside = await subformTask.ExecuteNestedRS(currTask);
2056
- if (AccessHelper.eventsManager.GetStopExecutionFlag())
2057
- return;
2058
- if (subformTask.getLevel() !== Constants.TASK_LEVEL_TASK && !AccessHelper.eventsManager.GetStopExecutionFlag()) {
2059
- AccessHelper.eventsManager.pushNewExecStacks();
2060
- await AccessHelper.eventsManager.handleInternalEventWithTaskAndSubformRefresh(subformTask, InternalInterface.MG_ACT_REC_SUFFIX, true);
2061
- AccessHelper.eventsManager.popNewExecStacks();
2062
- isInside = true;
2063
- if (AccessHelper.eventsManager.GetStopExecutionFlag())
2064
- return;
2065
- }
2066
- let cmd = CommandFactory.CreateSubformRefreshCommand(this.getTaskTag(), subformTask.getTaskTag(), explicitSubformRefresh);
2067
- await subformTask.DataviewManager.Execute(cmd);
2068
- if (subformTask.isAborting())
2069
- return;
2070
- if (explicitSubformRefresh) {
2071
- AccessHelper.eventsManager.pushNewExecStacks();
2072
- let performParentRecordPrefixOrg = subformTask.PerformParentRecordPrefix;
2073
- subformTask.PerformParentRecordPrefix = false;
2074
- await AccessHelper.eventsManager.handleInternalEventWithTaskAndSubformRefresh(subformTask, InternalInterface.MG_ACT_REC_PREFIX, true);
2075
- subformTask.PerformParentRecordPrefix = performParentRecordPrefixOrg;
2076
- AccessHelper.eventsManager.popNewExecStacks();
2077
- if (AccessHelper.eventsManager.GetStopExecutionFlag())
2078
- return;
2079
- }
2080
- if (isInside) {
2081
- }
2082
- else {
2083
- if (!AccessHelper.eventsManager.GetStopExecutionFlag()) {
2084
- if (explicitSubformRefresh) {
2085
- await AccessHelper.eventsManager.handleInternalEventWithTask(subformTask, InternalInterface.MG_ACT_REC_SUFFIX);
2086
- if (currTask != null)
2087
- currTask.DataView.setPrevCurrRec();
2088
- subformTask.DoSubformPrefixSuffix = false;
2089
- }
2090
- }
2091
- }
2092
- }
2093
- async ExecuteNestedRS(lastTask) {
2094
- let isExecuteNestedRS = false;
2095
- if (lastTask == null)
2096
- return isExecuteNestedRS;
2097
- if (this.getLevel() !== Constants.TASK_LEVEL_TASK && lastTask.getMgdID() !== this.getMgdID())
2098
- return isExecuteNestedRS;
2099
- for (let task = lastTask; task !== this && task.pathContains(this) && task.getLevel() !== Constants.TASK_LEVEL_TASK; task = task.getParent()) {
2100
- AccessHelper.eventsManager.pushNewExecStacks();
2101
- await AccessHelper.eventsManager.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
2102
- AccessHelper.eventsManager.popNewExecStacks();
2103
- isExecuteNestedRS = true;
2104
- }
2105
- return isExecuteNestedRS;
2106
- }
2107
- async execSubformRecSuffix(newTask) {
2108
- let subfTask;
2109
- let i, idx = 0;
2110
- for (i = this._taskPath.length; i > 0; i--) {
2111
- subfTask = this._taskPath.get_Item(i - 1);
2112
- if (!newTask._taskPath.Contains(subfTask)) {
2113
- await AccessHelper.eventsManager.handleInternalEventWithTask(subfTask, InternalInterface.MG_ACT_REC_SUFFIX);
2114
- if (AccessHelper.eventsManager.GetStopExecutionFlag())
2115
- break;
2116
- if (subfTask.getMode() === Constants.TASK_MODE_CREATE && !(subfTask.DataView.getCurrRec()).isNewRec())
2117
- subfTask.setMode(Constants.TASK_MODE_MODIFY);
2118
- }
2119
- else {
2120
- idx = newTask._taskPath.indexOf(subfTask);
2121
- break;
2122
- }
2123
- }
2124
- Debug.Assert(i > 0);
2125
- return idx;
2126
- }
2127
- getCounter() {
2128
- return this._counter;
2129
- }
2130
- increaseCounter() {
2131
- this._counter = this._counter + 1;
2132
- }
2133
- setCounter(cnt) {
2134
- this._counter = cnt;
2135
- }
2136
- isCurrentStartProgLevel() {
2137
- return this._currStartProgLevel === Task.StartProgLevel;
2138
- }
2139
- static isMainProgramField(fieldStr) {
2140
- let Field = XmlParser.getTokens(fieldStr, ',');
2141
- let mainProgField = false;
2142
- if (Field.length === 2) {
2143
- let parent = NNumber.Parse(Field.get_Item(0));
2144
- if (parent === TaskBase.MAIN_PRG_PARENT_ID)
2145
- mainProgField = true;
2146
- }
2147
- return mainProgField;
2148
- }
2149
- getTaskInfo() {
2150
- let taskName = (this.getProp(PropInterface.PROP_TYPE_NAME)).GetComputedValue();
2151
- return NString.Format('{0} {1}', this.isProgram() ? 'Program' : 'Subtask', taskName);
2152
- }
2153
- toString() {
2154
- return NString.Format("(task {0}-\"{1}\"{2})", this._taskTag, this.Name, super.isMainProg() ? (" ctl " + this._ctlIdx) : "");
2155
- }
2156
- ConstructMgForm(alreadySetParentForm) {
2157
- let form = new MgForm();
2158
- let parentForm = (this.ParentTask != null ? this.ParentTask.getForm() : null);
2159
- while (parentForm != null && !parentForm.getTask().isOpenWin()) {
2160
- parentForm = parentForm.ParentForm;
2161
- }
2162
- form.ParentForm = parentForm;
2163
- alreadySetParentForm.value = true;
2164
- return form;
2165
- }
2166
- getMgdID() {
2167
- return this._mgData.GetId();
2168
- }
2169
- getMGData() {
2170
- return this._mgData;
2171
- }
2172
- async RefreshDisplay() {
2173
- if (this.Form !== null && !this.isAborting() && this.isStarted()) {
2174
- Logger.Instance.WriteDevToLog("Start task.RefreshDisplay()");
2175
- if (this._refreshType !== Constants.TASK_REFRESH_NONE) {
2176
- let form = this.Form;
2177
- let wasRefreshed = await form.RefreshDisplay(Constants.TASK_REFRESH_FORM);
2178
- if (wasRefreshed) {
2179
- this._refreshType = Constants.TASK_REFRESH_NONE;
2180
- }
2181
- }
2182
- Logger.Instance.WriteDevToLog("End task.RefreshDisplay()");
2183
- }
2184
- }
2185
- getFieldDisplayValue(fieldDef, value, isNull) {
2186
- value.value = fieldDef.getDispValue();
2187
- isNull.value = fieldDef.isNull();
2188
- }
2189
- async UpdateFieldValueAndStartRecompute(fieldDef, value, isNull) {
2190
- if (this.TaskPrefixExecuted) {
2191
- await fieldDef.setValueAndStartRecompute(value, isNull, true, false, false);
2192
- }
2193
- }
2194
- ShouldNonInteractiveChildBeModal() {
2195
- return this.ShouldChildBeModal();
2196
- }
2197
- ShouldChildBeModal() {
2198
- let childShouldBehaveAsModal = false;
2199
- if ((this.Form.ConcreteWindowType === WindowType.Overlay) && this.getForm().Opened)
2200
- childShouldBehaveAsModal = true;
2201
- else if (!this.IsInteractive) {
2202
- childShouldBehaveAsModal = true;
2203
- }
2204
- return childShouldBehaveAsModal;
2205
- }
2206
- getParent() {
2207
- return this._parentTask;
2208
- }
2209
- isDescendentOf(chkTask) {
2210
- if (chkTask === this)
2211
- return true;
2212
- else if (chkTask === null || this._parentTask === null)
2213
- return false;
2214
- return this._parentTask.isDescendentOf(chkTask);
2215
- }
2216
- GetSubformModalParentTask() {
2217
- let currTask = this;
2218
- while (currTask._parentTask != null && currTask._parentTask.getIsDestinationCall()) {
2219
- let subformCtrl = (currTask._parentTask.getForm().getSubFormCtrl());
2220
- if (subformCtrl.IsModal()) {
2221
- return subformCtrl;
2222
- }
2223
- currTask = currTask._parentTask;
2224
- }
2225
- return null;
2226
- }
2227
- ShouldEvaluatePropertyLocally(propId) {
2228
- return this.TaskService.ShouldEvaluatePropertyLocally(propId);
2229
- }
2230
- EnsureValidForm() {
2231
- if (this._isMainPrg && this.Form !== null) {
2232
- if (!this._openWin || !this.Form.isLegalForm) {
2233
- this.Form = null;
2234
- }
2235
- }
2236
- }
2237
- async ComputeMainDisplay() {
2238
- let propMainDisplay = this.getProp(PropInterface.PROP_TYPE_MAIN_DISPLAY);
2239
- let mainDisplayIndex = await propMainDisplay.getValueInt();
2240
- mainDisplayIndex = this.GetRealMainDisplayIndexOnCurrentTask(mainDisplayIndex);
2241
- this._forms.InitFormFromXmlString(mainDisplayIndex);
2242
- this.EnsureValidForm();
2243
- }
2244
- async PrepareTaskForm() {
2245
- await TaskServiceBase.PreparePropOpenTaskWindow(this);
2246
- return await RemoteTaskService.PreparePropMainDisplay(this);
2247
- }
2248
- FormIsLegal() {
2249
- let isFormIsLegal = super.isMainProg();
2250
- return isFormIsLegal || super.getForm().isLegalForm;
2251
- }
2252
- GetRealMainDisplayIndexOnDepth(mainDspIdx) {
2253
- let task = this.LogicalStudioParentTask;
2254
- while (task != null) {
2255
- mainDspIdx += task._forms.Count;
2256
- task = task.LogicalStudioParentTask;
2257
- }
2258
- return mainDspIdx;
2259
- }
2260
- GetRealMainDisplayIndexOnCurrentTask(mainDspIdx) {
2261
- if (mainDspIdx > 1) {
2262
- let task = this.LogicalStudioParentTask;
2263
- while (task != null) {
2264
- mainDspIdx -= task._forms.Count;
2265
- task = task.LogicalStudioParentTask;
2266
- }
2267
- }
2268
- return mainDspIdx;
2269
- }
2270
- GetAncestorTaskByTaskDefinitionId(findTaskDefinitionId) {
2271
- let currentTask = this;
2272
- if (findTaskDefinitionId.IsMainProgram())
2273
- return GuiDataCollection.MGDataTable.GetMainProgByCtlIdx(this.ContextID, findTaskDefinitionId.CtlIndex);
2274
- while (currentTask != null) {
2275
- if (currentTask.TaskDefinitionId.Equals(findTaskDefinitionId))
2276
- return currentTask;
2277
- currentTask = currentTask._parentTask;
2278
- }
2279
- return null;
2280
- }
2281
- SetDataControlValuesReference(controlId, dcValuesId) {
2282
- let ctrl = super.getForm().getCtrl(controlId);
2283
- ctrl.setDcValId(dcValuesId);
2284
- }
2285
- DisplayMessageToStatusBar(text) {
2286
- let taskToVerifyOn = this.GetContextTask();
2287
- if (taskToVerifyOn.getForm() == null)
2288
- taskToVerifyOn = LastFocusedManager.Instance.getLastFocusedTask();
2289
- taskToVerifyOn.WriteToMessagePane(text);
2290
- }
2291
- isTableWithAbsolutesScrollbar() {
2292
- let isTableWithAbsolutesScrollbar = false;
2293
- if (this.getForm() != null)
2294
- isTableWithAbsolutesScrollbar = this.getForm().isTableWithAbsoluteScrollbar();
2295
- return isTableWithAbsolutesScrollbar;
2296
- }
2297
- GetTaskDetails() {
2298
- let names = (this.getProp(PropInterface.PROP_TYPE_NAME)).GetComputedValue();
2299
- let task = this;
2300
- while (task.ParentTask !== null && !task.ParentTask.isMainProg()) {
2301
- task = task.ParentTask;
2302
- names = (task.getProp(PropInterface.PROP_TYPE_NAME)).GetComputedValue() + "." + names;
2303
- }
2304
- return names;
2305
- }
2306
- static async ProcessTaskURL() {
2307
- let xmlData = RuntimeContextBase.Instance.Parser.getXMLdata();
2308
- let endTaskUrlIdx = xmlData.indexOf(XMLConstants.TAG_CLOSE, RuntimeContextBase.Instance.Parser.getCurrIndex());
2309
- Debug.Assert(endTaskUrlIdx !== -1 && endTaskUrlIdx < xmlData.length);
2310
- let tag = RuntimeContextBase.Instance.Parser.getXMLsubstring(endTaskUrlIdx);
2311
- RuntimeContextBase.Instance.Parser.add2CurrIndex(tag.indexOf(ConstInterface.MG_TAG_TASKURL) + ConstInterface.MG_TAG_TASKURL.length);
2312
- let tokensVector = XmlParser.getTokens(RuntimeContextBase.Instance.Parser.getXMLsubstring(endTaskUrlIdx), XMLConstants.XML_ATTR_DELIM);
2313
- let taskCacheURL = tokensVector.get_Item(1);
2314
- let refListStr = tokensVector.get_Item(3);
2315
- let taskContentOriginal = "";
2316
- if (taskCacheURL.trim() != "") {
2317
- if (taskCacheURL.startsWith("./"))
2318
- taskCacheURL = NString.Replace(taskCacheURL, './', './assets/cache/');
2319
- taskContentOriginal = await Task.CommandsProcessor.GetContent(taskCacheURL, true);
2320
- }
2321
- let taskContentFinal = new StringBuilder(xmlData.substr(0, RuntimeContextBase.Instance.Parser.getCurrIndex() - (ConstInterface.MG_TAG_TASKURL.length + 1)), taskContentOriginal.length);
2322
- let reflist = this.getReflist(refListStr, ';', true, -1);
2323
- let refListIdx = 0;
2324
- let currIdx = taskContentOriginal.indexOf("[:");
2325
- let prevIdx = 0;
2326
- while (currIdx !== -1) {
2327
- taskContentFinal.Append(taskContentOriginal.substr(prevIdx, currIdx - prevIdx));
2328
- taskContentFinal.Append(reflist.get_Item(refListIdx++));
2329
- currIdx += 2;
2330
- prevIdx = currIdx;
2331
- currIdx = taskContentOriginal.indexOf("[:", prevIdx);
2332
- }
2333
- taskContentFinal.Append(taskContentOriginal.substr(prevIdx));
2334
- taskContentFinal.Append(xmlData.substr(xmlData.indexOf(XMLConstants.TAG_CLOSE, endTaskUrlIdx + 1) + 1));
2335
- xmlData = taskContentFinal.ToString();
2336
- Logger.Instance.WriteDevToLog(NString.Format("{0} -------> {1}", taskCacheURL, xmlData));
2337
- RuntimeContextBase.Instance.Parser.setXMLdata(xmlData);
2338
- RuntimeContextBase.Instance.Parser.setCurrIndex(RuntimeContextBase.Instance.Parser.getCurrIndex() - (ConstInterface.MG_TAG_TASKURL.length + 1));
2339
- }
2340
- static getReflist(data, delim, trunc, maxTokens) {
2341
- let currStr = new StringBuilder();
2342
- let list = new List();
2343
- let tokensCnt = 0;
2344
- for (let i = 1; i < data.length; i++) {
2345
- let curr = data.charAt(i);
2346
- if (curr !== '\\' && curr !== delim)
2347
- currStr.Append(curr);
2348
- else if (curr === delim) {
2349
- list.push(currStr.ToString());
2350
- currStr = new StringBuilder();
2351
- tokensCnt++;
2352
- if (tokensCnt === maxTokens)
2353
- break;
2354
- }
2355
- else if (curr === '\\') {
2356
- if (!trunc && data.charAt(i + 1) !== delim)
2357
- currStr.Append(data.charAt(i));
2358
- i++;
2359
- currStr.Append(data.charAt(i));
2360
- }
2361
- }
2362
- list.push(currStr.ToString());
2363
- return list;
2364
- }
2365
- static async StartProgram(callByDestSubForm, moveToFirstControl) {
2366
- let orgStopExecution = AccessHelper.eventsManager.GetStopExecutionFlag();
2367
- let nonInteractiveTaskAlreadyExecuted = null;
2368
- let allowEvents = AccessHelper.eventsManager.getAllowEvents();
2369
- AccessHelper.eventsManager.setAllowEvents(EventsAllowedType.ALL);
2370
- Logger.Instance.WriteDevToLog("Start \"startProg\"");
2371
- Task.StartProgLevel++;
2372
- AccessHelper.eventsManager.setStopExecution(false);
2373
- nonInteractiveTaskAlreadyExecuted = await this.ExecuteComponentMainPrograms(callByDestSubForm, moveToFirstControl);
2374
- let nonInteractiveTaskAlreadyExecutedRef = new RefParam(nonInteractiveTaskAlreadyExecuted);
2375
- let currentNonInteractiveTaskRef = new RefParam(null);
2376
- await Task.ExecuteMainProgram(0, callByDestSubForm, moveToFirstControl, nonInteractiveTaskAlreadyExecutedRef, currentNonInteractiveTaskRef, AccessHelper.mgDataTable);
2377
- nonInteractiveTaskAlreadyExecuted = nonInteractiveTaskAlreadyExecutedRef.value;
2378
- if (!Task._idleTimerStarted) {
2379
- GUIManager.Instance.startTimer(AccessHelper.mgDataTable.getMGData(0), Environment.Instance.getIdleTime(0), true);
2380
- Task._idleTimerStarted = true;
2381
- }
2382
- await this.OpenForms(callByDestSubForm);
2383
- await this.DoFirstRecordCycle();
2384
- await this.MoveToFirstControls(callByDestSubForm);
2385
- if (Task.StartProgLevel === 1) {
2386
- let resetAllowEvents = false;
2387
- let canExecuteEvents = true;
2388
- if (nonInteractiveTaskAlreadyExecuted !== null && nonInteractiveTaskAlreadyExecuted.isStarted()) {
2389
- resetAllowEvents = true;
2390
- AccessHelper.eventsManager.setNonInteractiveAllowEvents(await nonInteractiveTaskAlreadyExecuted.isAllowEvents());
2391
- canExecuteEvents = await nonInteractiveTaskAlreadyExecuted.isAllowEvents();
2392
- }
2393
- if (LastFocusedManager.Instance.getLastFocusedTask() !== null && canExecuteEvents) {
2394
- AccessHelper.eventsManager.pushNewExecStacks();
2395
- await AccessHelper.eventsManager.handleEvents(AccessHelper.mgDataTable.getCurrMGData(), 0);
2396
- AccessHelper.eventsManager.popNewExecStacks();
2397
- }
2398
- if (resetAllowEvents)
2399
- AccessHelper.eventsManager.setAllowEvents(allowEvents);
2400
- }
2401
- Task.StartProgLevel--;
2402
- Logger.Instance.WriteDevToLog("End \"startProg\"");
2403
- if (orgStopExecution && !AccessHelper.eventsManager.GetStopExecutionFlag())
2404
- if (orgStopExecution && !AccessHelper.eventsManager.GetStopExecutionFlag())
2405
- AccessHelper.eventsManager.setStopExecution(orgStopExecution);
2406
- return nonInteractiveTaskAlreadyExecuted;
2407
- }
2408
- static async ExecuteComponentMainPrograms(callByDestSubForm, moveToFirstControl) {
2409
- let currentNonInteractiveTask = new RefParam(null);
2410
- let nonInteractiveTaskAlreadyExecuted = new RefParam(null);
2411
- let maxCtlIdx = AccessHelper.mgDataTable.getMGData(0).getMaxCtlIdx();
2412
- for (let i = 1; i <= maxCtlIdx; i = i + 1) {
2413
- let componentMainProgram = AccessHelper.mgDataTable.GetMainProgByCtlIdx(-1, i);
2414
- if (componentMainProgram !== null)
2415
- await Task.ExecuteMainProgram(i, callByDestSubForm, moveToFirstControl, currentNonInteractiveTask, nonInteractiveTaskAlreadyExecuted, AccessHelper.mgDataTable);
2416
- }
2417
- return nonInteractiveTaskAlreadyExecuted.value;
2418
- }
2419
- static async ExecuteMainProgram(CtlIndex, callByDestSubForm, moveToFirstControl, currentNonInteractiveTask, nonInteractiveTaskAlreadyExecuted, mgDataTable) {
2420
- let mainProgramTask = mgDataTable.GetMainProgByCtlIdx(-1, CtlIndex);
2421
- Logger.Instance.WriteDevToLog(NString.Format(" ClientManager.startProg: ctlIdx={0}, task={1}", CtlIndex, mainProgramTask));
2422
- currentNonInteractiveTask.value = (await mainProgramTask.Start(moveToFirstControl, callByDestSubForm));
2423
- if (nonInteractiveTaskAlreadyExecuted.value === null)
2424
- nonInteractiveTaskAlreadyExecuted.value = currentNonInteractiveTask.value;
2425
- else if (currentNonInteractiveTask.value !== null) {
2426
- Debug.Assert(false, "more than 1 non interactive tasks in startProg");
2427
- }
2428
- }
2429
- static async OpenForms(callByDestSubForm) {
2430
- let createdForms = MgForm.CreatedForms;
2431
- if (createdForms.Count() > 0) {
2432
- let i = 0;
2433
- while (i < createdForms.Count()) {
2434
- let mgForm = createdForms.get(i);
2435
- let canOpen = false;
2436
- if (mgForm.isSubForm()) {
2437
- let opened = mgForm.getSubFormCtrl().getForm().Opened;
2438
- if (opened) {
2439
- canOpen = true;
2440
- }
2441
- }
2442
- else {
2443
- if (mgForm.getTask().isCurrentStartProgLevel()) {
2444
- canOpen = true;
2445
- }
2446
- }
2447
- if (canOpen) {
2448
- Manager.OpenForm(mgForm);
2449
- await Manager.DoFirstRefreshTable(mgForm);
2450
- }
2451
- if (mgForm.Opened) {
2452
- createdForms.remove(mgForm);
2453
- }
2454
- else
2455
- i++;
2456
- }
2457
- }
2458
- }
2459
- static async DoFirstRecordCycle() {
2460
- for (let i = 0; i < AccessHelper.mgDataTable.getSize(); i++) {
2461
- let mgd = AccessHelper.mgDataTable.getMGData(i);
2462
- if (mgd === null || mgd.IsAborting)
2463
- continue;
2464
- for (let j = 0; j < mgd.getTasksCount(); j++) {
2465
- let task = mgd.getTask(j);
2466
- if (task !== null) {
2467
- let mgForm = task.getForm();
2468
- if (mgForm !== null && task.isCurrentStartProgLevel() && !mgForm.IgnoreFirstRecordCycle) {
2469
- mgForm.IgnoreFirstRecordCycle = true;
2470
- await task.doFirstRecordCycle();
2471
- }
2472
- }
2473
- }
2474
- }
2475
- }
2476
- static async MoveToFirstControls(callByDestSubForm) {
2477
- for (let i = 0; i < AccessHelper.mgDataTable.getSize(); i++) {
2478
- let mgd = AccessHelper.mgDataTable.getMGData(i);
2479
- if (mgd === null || mgd.IsAborting)
2480
- continue;
2481
- let tasksCount = mgd.getTasksCount();
2482
- for (let j = 0; j < tasksCount; j++) {
2483
- let task = mgd.getTask(j);
2484
- let mgForm = task.getForm();
2485
- if (task.isCurrentStartProgLevel() && mgForm !== null && mgForm.MovedToFirstControl) {
2486
- mgForm.MovedToFirstControl = false;
2487
- if (!callByDestSubForm)
2488
- await AccessHelper.eventsManager.HandleNonParkableControls(task);
2489
- }
2490
- }
2491
- }
2492
- }
2493
- }
2494
- Task.StartProgLevel = 0;
2495
- Task._idleTimerStarted = false;
2496
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVGFzay5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2VuZ2luZS9zcmMvdGFza3MvVGFzay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsS0FBSyxFQUFFLFNBQVMsRUFBRSxJQUFJLEVBQUUsT0FBTyxFQUFFLE9BQU8sRUFBRSxRQUFRLEVBQUUsS0FBSyxFQUFFLGFBQWEsRUFBRSxpQkFBaUIsRUFBQyxNQUFNLHNCQUFzQixDQUFDO0FBQ2pJLE9BQU8sRUFDTCxTQUFTLEVBQ1QsaUJBQWlCLEVBQ2pCLE1BQU0sRUFDTixnQkFBZ0IsRUFDaEIsZ0JBQWdCLEVBQ2hCLE9BQU8sRUFFUCx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wpIHtcclxuICAgICAgICBwYXJlbnQudmFsdWUgPSAwO1xyXG4gICAgICAgIGxldCBwcmV2Q3RsSWR4OiBudW1iZXIgPSB0cmVlUm91dGVbMF0uVGFza0RlZmluaXRpb25JZC5DdGxJbmRleDtcclxuXHJcbiAgICAgICAgZm9yIChsZXQgdGFzazogbnVtYmVyID0gMDsgdGFzayA8IHRyZWVSb3V0ZS5sZW5ndGggLSAxOyB0YXNrKyspIHtcclxuICAgICAgICAgIGN1cnJUYXNrID0gdHJlZVJvdXRlW3Rhc2tdO1xyXG5cclxuICAgICAgICAgIGlmIChwcmV2Q3RsSWR4ICE9PSBjdXJyVGFzay5UYXNrRGVmaW5pdGlvbklkLkN0bEluZGV4KVxyXG4gICAgICAgICAgICBwYXJlbnQudmFsdWUrKztcclxuXHJcbiAgICAgICAgICBpZiAoY2FsbGVyVGFzay5UYXNrRGVmaW5pdGlvbklkLkN0bEluZGV4ID09PSBjdXJyVGFzay5UYXNrRGVmaW5pdGlvbklkLkN0bEluZGV4KVxyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBwcmV2Q3RsSWR4ID0gY3VyclRhc2suVGFza0RlZmluaXRpb25JZC5DdGxJbmRleDtcclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvLyBDb250cm9sIGNvcnJlc3BvbmRpbmcgdG8gdGhlIHNwZWNpZmllZCBDb250cm9sSURcclxuICAgIHJldHVybiBjb250cm9sO1xyXG4gIH1cclxuXHJcbiAgLy8vIDxzdW1tYXJ5PlxyXG4gIC8vLyA8L3N1bW1hcnk+XHJcbiAgY3RsX2l0bV80X3BhcmVudF92ZWUocGFyZW50OiBudW1iZXIsIHZlZTogbnVtYmVyKTogbnVtYmVyIHtcclxuICAgIGxldCB0c2s6IFRhc2s7XHJcbiAgICBsZXQgZGVwdGg6IG51bWJlciA9IHRoaXMuZ2V0VGFza0RlcHRoKHRydWUpO1xyXG5cclxuICAgIGlmIChwY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UoKSAhPT0gQ29uc3RhbnRzLlRBU0tfTU9ERV9DUkVBVEUpXHJcbiAgICAgICAgICBjbGllbnRPcGVyYXRpb25FeGlzdCA9IHRydWU7XHJcblxyXG4gICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgaWYgKGhhbmRsZXIgIT0gbnVsbCAmJiAhY2xpZW50T3BlcmF0aW9uRXhpc3QpIHtcclxuICAgICAgICBsZXQgY250ID0gaGFuZGxlci5nZXRPcGVyYXRpb25UYWIoKS5nZXRTaXplKCk7XHJcblxyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY250OyBpKyspIHtcclxuICAgICAgICAgIGxldCBvcGVyID0gaGFuZGxlci5nZXRPcGVyYXRpb25UYWIoKS5nZXRPcGVyYXRpb24oaSk7XHJcbiAgICAgICAgICBpZiAob3Blci5nZXRFeGVjT25DbGllbnQoKSkge1xyXG4gICAgICAgICAgICBjbGllbnRPcGVyYXRpb25FeGlzdCA9IHRydWU7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIGlmIChvcGVyLmdldFR5cGUoKSA9PSBDb25zdEludGVyZmFjZS5NR19PUEVSX1JBSVNFX0VWRU5UKXtcclxuICAgICAgICAgICAgICBpZiAob3Blci5HZXRSdW50aW1lRXZlbnQoKS5nZXRUeXBlKCkgPT0gQ29uc3RJbnRlcmZhY2UuRVZFTlRfVFlQRV9JTlRFUk5BTCAmJlxyXG4gICAgICAgICAgICAgIG9wZXIuR2V0UnVudGltZUV2ZW50KCkuZ2V0SW50ZXJuYWxDb2RlKCkgPT09IEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SVF9SRUZSRVNIX1ZJRVcpIHtcclxuICAgICAgICAgICAgICAgIGNsaWVudE9wZXJhdGlvbkV4aXN0ID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgIH1cclx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