@magic-xpa/engine 4.1100.0-dev4110.25 → 4.1100.0-dev4110.250
Sign up to get free protection for your applications and to get access to all the features.
- package/{esm2020 → esm2022}/index.mjs +188 -188
- package/{esm2020 → esm2022}/magic-xpa-engine.mjs +1 -1
- package/esm2022/src/AccessHelper.mjs +15 -0
- package/esm2022/src/ClientManager.mjs +416 -0
- package/esm2022/src/CommandsProcessorBase.mjs +56 -0
- package/esm2022/src/CommandsProcessorManager.mjs +26 -0
- package/esm2022/src/CommandsTable.mjs +162 -0
- package/esm2022/src/ConstInterface.mjs +517 -0
- package/{esm2020 → esm2022}/src/CurrentClientVersion.mjs +2 -2
- package/esm2022/src/FlowMonitorInterface.mjs +16 -0
- package/esm2022/src/GUIManager.mjs +62 -0
- package/esm2022/src/GlobalCommandsManager.mjs +34 -0
- package/esm2022/src/GuiEventsProcessor.mjs +156 -0
- package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
- package/esm2022/src/ServerConfig.mjs +122 -0
- package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
- package/esm2022/src/bridge/MagicBridge.mjs +41 -0
- package/esm2022/src/commands/ClientOriginatedCommandTaskTag.mjs +12 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserLocateDataViewCommand.mjs +8 -8
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserRangeDataviewCommand.mjs +9 -9
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserSortDataViewCommand.mjs +9 -9
- package/esm2022/src/commands/ClientToServer/BrowserEscEventCommand.mjs +26 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
- package/esm2022/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +60 -0
- package/esm2022/src/commands/ClientToServer/ColumnSortEventCommand.mjs +29 -0
- package/esm2022/src/commands/ClientToServer/CommandFactory.mjs +261 -0
- package/esm2022/src/commands/ClientToServer/CommandSerializationHelper.mjs +67 -0
- package/esm2022/src/commands/ClientToServer/ComputeEventCommand.mjs +26 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTerminationEventCommand.mjs +24 -21
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTimeoutResetCommand.mjs +23 -20
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ControlItemsRefreshCommand.mjs +8 -8
- package/esm2022/src/commands/ClientToServer/DataViewOutputCommand.mjs +13 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/DataviewCommand.mjs +44 -44
- package/esm2022/src/commands/ClientToServer/EvaluateCommand.mjs +40 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/EventCommand.mjs +43 -40
- package/esm2022/src/commands/ClientToServer/ExecOperCommand.mjs +70 -0
- package/esm2022/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +25 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/GlobalParamsQueryCommand.mjs +10 -10
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ICommandTaskTag.mjs +1 -1
- package/esm2022/src/commands/ClientToServer/IndexChangeEventCommand.mjs +24 -0
- package/esm2022/src/commands/ClientToServer/IniputForceWriteCommand.mjs +26 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/NonReversibleExitEventCommand.mjs +26 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/QueryCommand.mjs +20 -20
- package/esm2022/src/commands/ClientToServer/RecomputeCommand.mjs +30 -0
- package/esm2022/src/commands/ClientToServer/RefreshEventCommand.mjs +30 -0
- package/esm2022/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +27 -0
- package/esm2022/src/commands/ClientToServer/RollbackEventCommand.mjs +43 -0
- package/esm2022/src/commands/ClientToServer/SelectProgramCommand.mjs +19 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SetTransactionStateDataviewCommand.mjs +9 -9
- package/esm2022/src/commands/ClientToServer/SubformOpenEventCommand.mjs +24 -0
- package/esm2022/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +27 -0
- package/esm2022/src/commands/ClientToServer/TransactionCommand.mjs +34 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/UnloadCommand.mjs +18 -15
- package/esm2022/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +18 -0
- package/esm2022/src/commands/DataViewCommandBase.mjs +8 -0
- package/{esm2020 → esm2022}/src/commands/IClientCommand.mjs +1 -1
- package/esm2022/src/commands/IClientTargetedCommand.mjs +13 -0
- package/{esm2020 → esm2022}/src/commands/IClientToServerCommandInfo.mjs +2 -2
- package/esm2022/src/commands/ServerToClient/AbortCommand.mjs +65 -0
- package/{esm2020 → esm2022}/src/commands/ServerToClient/AddLocateCommand.mjs +21 -21
- package/esm2022/src/commands/ServerToClient/AddRangeCommand.mjs +62 -0
- package/esm2022/src/commands/ServerToClient/AddSortCommand.mjs +33 -0
- package/esm2022/src/commands/ServerToClient/ClientRefreshCommand.mjs +25 -0
- package/esm2022/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +24 -0
- package/esm2022/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +45 -0
- package/esm2022/src/commands/ServerToClient/OpenURLCommand.mjs +221 -0
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetLocateCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetRangeCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetSortCommand.mjs +14 -14
- package/esm2022/src/commands/ServerToClient/ResultCommand.mjs +37 -0
- package/esm2022/src/commands/ServerToClient/VerifyCommand.mjs +83 -0
- package/esm2022/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +132 -0
- package/{esm2020 → esm2022}/src/communications/IConnectionStateManager.mjs +1 -1
- package/esm2022/src/communications/InteractiveCommunicationsFailureHandler.mjs +15 -0
- package/{esm2020 → esm2022}/src/data/DataSourceIdKey.mjs +2 -2
- package/esm2022/src/data/DataView.mjs +1613 -0
- package/{esm2020 → esm2022}/src/data/DataViewBase.mjs +3 -3
- package/esm2022/src/data/DataviewManager.mjs +28 -0
- package/esm2022/src/data/DataviewManagerBase.mjs +15 -0
- package/esm2022/src/data/DvCache.mjs +67 -0
- package/esm2022/src/data/Field.mjs +646 -0
- package/esm2022/src/data/FieldBase.mjs +15 -0
- package/esm2022/src/data/FieldsTable.mjs +103 -0
- package/{esm2020 → esm2022}/src/data/IRecordsTable.mjs +1 -1
- package/esm2022/src/data/Key.mjs +88 -0
- package/esm2022/src/data/Record.mjs +880 -0
- package/{esm2020 → esm2022}/src/data/RecordOutOfDataViewException.mjs +15 -15
- package/esm2022/src/data/RecordsTable.mjs +267 -0
- package/esm2022/src/data/TaskTransactionManager.mjs +107 -0
- package/esm2022/src/data/XMLBasedDcValuesBuilder.mjs +74 -0
- package/{esm2020 → esm2022}/src/enums.mjs +23 -23
- package/esm2022/src/env/EnvVariablesTable.mjs +340 -0
- package/esm2022/src/env/Environment.mjs +487 -0
- package/{esm2020 → esm2022}/src/env/ILanguageData.mjs +1 -1
- package/esm2022/src/env/LanguageData.mjs +227 -0
- package/esm2022/src/env/MirrorString.mjs +65 -0
- package/esm2022/src/event/ActionManager.mjs +91 -0
- package/esm2022/src/event/Event.mjs +1333 -0
- package/esm2022/src/event/EventHandler.mjs +766 -0
- package/esm2022/src/event/EventHandlerPosition.mjs +204 -0
- package/esm2022/src/event/EventsManager.mjs +2988 -0
- package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
- package/esm2022/src/event/RunTimeEvent.mjs +399 -0
- package/{esm2020 → esm2022}/src/event/RunTimeEventBase.mjs +3 -3
- package/esm2022/src/event/UserEventsTable.mjs +47 -0
- package/esm2022/src/exp/ExpTable.mjs +57 -0
- package/esm2022/src/exp/Expression.mjs +200 -0
- package/esm2022/src/exp/ExpressionDict.mjs +727 -0
- package/esm2022/src/exp/ExpressionEvaluator.mjs +4206 -0
- package/esm2022/src/exp/ExpressionLocalJpn.mjs +314 -0
- package/esm2022/src/exp/GlobalParamsTable.mjs +85 -0
- package/esm2022/src/exp/YesNoExp.mjs +36 -0
- package/esm2022/src/gui/CreatedFormVector.mjs +23 -0
- package/esm2022/src/gui/FormsTable.mjs +66 -0
- package/esm2022/src/gui/MgControl.mjs +363 -0
- package/esm2022/src/gui/MgForm.mjs +1224 -0
- package/esm2022/src/http/HttpManager.mjs +97 -0
- package/esm2022/src/http/client/HttpClientAsync.mjs +68 -0
- package/esm2022/src/http/client/HttpClientBase.mjs +132 -0
- package/esm2022/src/http/client/HttpClientEvents.mjs +39 -0
- package/esm2022/src/http/client/HttpClientSync.mjs +42 -0
- package/esm2022/src/http/client/HttpUtility.mjs +84 -0
- package/{esm2020 → esm2022}/src/http/client/ICommunicationsFailureHandler.mjs +1 -1
- package/esm2022/src/remote/AddUserLocateRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/AddUserRangeRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/AddUserSortRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/RemoteCommandsProcessor.mjs +883 -0
- package/esm2022/src/remote/RemoteControlItemsRefreshCommand.mjs +25 -0
- package/esm2022/src/remote/RemoteDataViewCommandBase.mjs +24 -0
- package/esm2022/src/remote/RemoteDataViewCommandFactory.mjs +61 -0
- package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandUpdateNonModifiable.mjs +15 -15
- package/{esm2020 → esm2022}/src/remote/RemoteDataviewManager.mjs +17 -17
- package/{esm2020 → esm2022}/src/remote/RemoteInitDataViewCommand.mjs +10 -10
- package/esm2022/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +17 -0
- package/{esm2020 → esm2022}/src/remote/ResetUserRangeRemoteDataviewCommand.mjs +12 -12
- package/esm2022/src/remote/ResetUserSortRemoteDataviewCommand.mjs +16 -0
- package/esm2022/src/remote/ServerError.mjs +40 -0
- package/esm2022/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +20 -0
- package/esm2022/src/rt/Argument.mjs +265 -0
- package/esm2022/src/rt/ArgumentsList.mjs +103 -0
- package/esm2022/src/rt/Boundary.mjs +152 -0
- package/esm2022/src/rt/CompMainPrgTable.mjs +63 -0
- package/{esm2020 → esm2022}/src/rt/DataviewHeaderBase.mjs +98 -96
- package/{esm2020 → esm2022}/src/rt/DataviewHeaderFactory.mjs +6 -6
- package/esm2022/src/rt/DataviewHeaders.mjs +53 -0
- package/esm2022/src/rt/DataviewHeadersSaxHandler.mjs +38 -0
- package/esm2022/src/rt/ExecutionStack.mjs +94 -0
- package/{esm2020 → esm2022}/src/rt/ExecutionStackEntry.mjs +17 -17
- package/esm2022/src/rt/HandlersTable.mjs +96 -0
- package/{esm2020 → esm2022}/src/rt/IDataSourceViewDefinition.mjs +1 -1
- package/{esm2020 → esm2022}/src/rt/IDataviewHeader.mjs +1 -1
- package/{esm2020 → esm2022}/src/rt/IResultValue.mjs +1 -1
- package/esm2022/src/rt/LastFocusedManager.mjs +65 -0
- package/esm2022/src/rt/Operation.mjs +735 -0
- package/esm2022/src/rt/OperationTable.mjs +67 -0
- package/esm2022/src/rt/Recompute.mjs +355 -0
- package/esm2022/src/rt/RecomputeTable.mjs +63 -0
- package/esm2022/src/rt/RemoteDataviewHeader.mjs +108 -0
- package/esm2022/src/rt/ResultValue.mjs +10 -0
- package/esm2022/src/rt/TableCache.mjs +177 -0
- package/esm2022/src/rt/TableCacheManager.mjs +67 -0
- package/esm2022/src/rt/Transaction.mjs +53 -0
- package/esm2022/src/security/UserDetails.mjs +71 -0
- package/{esm2020 → esm2022}/src/tasks/IMGDataCollection.mjs +1 -1
- package/esm2022/src/tasks/MGData.mjs +552 -0
- package/esm2022/src/tasks/MGDataCollection.mjs +252 -0
- package/esm2022/src/tasks/RCTimer.mjs +63 -0
- package/esm2022/src/tasks/RemoteTaskService.mjs +45 -0
- package/esm2022/src/tasks/Task.mjs +2499 -0
- package/esm2022/src/tasks/TaskBase.mjs +83 -0
- package/esm2022/src/tasks/TaskServiceBase.mjs +25 -0
- package/esm2022/src/tasks/TasksTable.mjs +80 -0
- package/esm2022/src/tasks/sort/Sort.mjs +5 -0
- package/esm2022/src/tasks/sort/SortCollection.mjs +67 -0
- package/esm2022/src/util/ConstUtils.mjs +14 -0
- package/esm2022/src/util/FlowMonitorQueue.mjs +451 -0
- package/esm2022/src/util/HeapSort.mjs +70 -0
- package/{esm2020 → esm2022}/src/util/IMirrorXML.mjs +1 -1
- package/{esm2020 → esm2022}/src/util/IServerConfig.mjs +1 -1
- package/{esm2020 → esm2022}/src/util/MgBlockingQueue.mjs +1 -1
- package/esm2022/src/util/MgPriorityBlockingQueue.mjs +74 -0
- package/esm2022/src/util/MgPriorityQueue.mjs +66 -0
- package/{esm2020 → esm2022}/src/util/ParamParseResult.mjs +7 -7
- package/esm2022/src/util/PrmMap.mjs +152 -0
- package/esm2022/src/util/ReturnResult.mjs +46 -0
- package/esm2022/src/util/ReturnResultBase.mjs +18 -0
- package/esm2022/src/util/Scrambler.mjs +89 -0
- package/esm2022/src/util/UniqueIDUtils.mjs +13 -0
- package/esm2022/src/util/cookie.service.mjs +92 -0
- package/{fesm2020 → fesm2022}/magic-xpa-engine.mjs +29883 -29693
- package/fesm2022/magic-xpa-engine.mjs.map +1 -0
- package/index.d.ts +187 -187
- package/package.json +8 -14
- package/src/AccessHelper.d.ts +20 -20
- package/src/ClientManager.d.ts +35 -32
- package/src/CommandsProcessorBase.d.ts +23 -23
- package/src/CommandsProcessorManager.d.ts +6 -6
- package/src/CommandsTable.d.ts +22 -22
- package/src/ConstInterface.d.ts +516 -515
- package/src/CurrentClientVersion.d.ts +1 -1
- package/src/FlowMonitorInterface.d.ts +15 -15
- package/src/GUIManager.d.ts +17 -17
- package/src/GlobalCommandsManager.d.ts +17 -17
- package/src/GuiEventsProcessor.d.ts +24 -24
- package/src/ICommandsTable.d.ts +9 -9
- package/src/ServerConfig.d.ts +35 -34
- package/src/bridge/IGuiEvent.d.ts +19 -19
- package/src/bridge/MagicBridge.d.ts +16 -16
- package/src/commands/ClientOriginatedCommandTaskTag.d.ts +8 -8
- package/src/commands/ClientToServer/AddUserLocateDataViewCommand.d.ts +4 -4
- package/src/commands/ClientToServer/AddUserRangeDataviewCommand.d.ts +6 -6
- package/src/commands/ClientToServer/AddUserSortDataViewCommand.d.ts +6 -6
- package/src/commands/ClientToServer/BrowserEscEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/ClientOriginatedCommand.d.ts +8 -8
- package/src/commands/ClientToServer/ClientOriginatedCommandSerializer.d.ts +6 -6
- package/src/commands/ClientToServer/ColumnSortEventCommand.d.ts +11 -10
- package/src/commands/ClientToServer/CommandFactory.d.ts +64 -64
- package/src/commands/ClientToServer/CommandSerializationHelper.d.ts +20 -20
- package/src/commands/ClientToServer/ComputeEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/ContextTerminationEventCommand.d.ts +8 -7
- package/src/commands/ClientToServer/ContextTimeoutResetCommand.d.ts +8 -7
- package/src/commands/ClientToServer/ControlItemsRefreshCommand.d.ts +6 -6
- package/src/commands/ClientToServer/DataViewOutputCommand.d.ts +9 -9
- package/src/commands/ClientToServer/DataviewCommand.d.ts +32 -32
- package/src/commands/ClientToServer/EvaluateCommand.d.ts +16 -15
- package/src/commands/ClientToServer/EventCommand.d.ts +16 -15
- package/src/commands/ClientToServer/ExecOperCommand.d.ts +24 -23
- package/src/commands/ClientToServer/FetchDataControlValuesEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/GlobalParamsQueryCommand.d.ts +5 -5
- package/src/commands/ClientToServer/ICommandTaskTag.d.ts +3 -3
- package/src/commands/ClientToServer/IndexChangeEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/IniputForceWriteCommand.d.ts +11 -10
- package/src/commands/ClientToServer/NonReversibleExitEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/QueryCommand.d.ts +8 -8
- package/src/commands/ClientToServer/RecomputeCommand.d.ts +12 -11
- package/src/commands/ClientToServer/RefreshEventCommand.d.ts +13 -12
- package/src/commands/ClientToServer/RefreshScreenEventCommand.d.ts +11 -10
- package/src/commands/ClientToServer/RollbackEventCommand.d.ts +15 -14
- package/src/commands/ClientToServer/SelectProgramCommand.d.ts +7 -6
- package/src/commands/ClientToServer/SetTransactionStateDataviewCommand.d.ts +5 -5
- package/src/commands/ClientToServer/SubformOpenEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/SubformRefreshEventCommand.d.ts +10 -9
- package/src/commands/ClientToServer/TransactionCommand.d.ts +14 -12
- package/src/commands/ClientToServer/UnloadCommand.d.ts +8 -7
- package/src/commands/ClientToServer/WriteMessageToServerLogCommand.d.ts +6 -6
- package/src/commands/DataViewCommandBase.d.ts +6 -6
- package/src/commands/IClientCommand.d.ts +2 -2
- package/src/commands/IClientTargetedCommand.d.ts +12 -12
- package/src/commands/IClientToServerCommandInfo.d.ts +4 -3
- package/src/commands/ServerToClient/AbortCommand.d.ts +11 -11
- package/src/commands/ServerToClient/AddLocateCommand.d.ts +6 -6
- package/src/commands/ServerToClient/AddRangeCommand.d.ts +10 -10
- package/src/commands/ServerToClient/AddSortCommand.d.ts +9 -9
- package/src/commands/ServerToClient/ClientRefreshCommand.d.ts +7 -7
- package/src/commands/ServerToClient/ClientTargetedCommandBase.d.ts +12 -12
- package/src/commands/ServerToClient/EnhancedVerifyCommand.d.ts +13 -13
- package/src/commands/ServerToClient/OpenURLCommand.d.ts +21 -21
- package/src/commands/ServerToClient/ResetLocateCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResetRangeCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResetSortCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResultCommand.d.ts +10 -10
- package/src/commands/ServerToClient/VerifyCommand.d.ts +17 -17
- package/src/commands/ServerToClient/XMLBasedCommandBuilder.d.ts +11 -11
- package/src/communications/IConnectionStateManager.d.ts +4 -4
- package/src/communications/InteractiveCommunicationsFailureHandler.d.ts +6 -6
- package/src/data/DataSourceIdKey.d.ts +2 -2
- package/src/data/DataView.d.ts +162 -162
- package/src/data/DataViewBase.d.ts +12 -12
- package/src/data/DataviewManager.d.ts +14 -14
- package/src/data/DataviewManagerBase.d.ts +11 -11
- package/src/data/DvCache.d.ts +15 -15
- package/src/data/Field.d.ts +103 -103
- package/src/data/FieldBase.d.ts +23 -23
- package/src/data/FieldsTable.d.ts +27 -27
- package/src/data/IRecordsTable.d.ts +7 -7
- package/src/data/Key.d.ts +15 -15
- package/src/data/Record.d.ts +157 -156
- package/src/data/RecordOutOfDataViewException.d.ts +10 -10
- package/src/data/RecordsTable.d.ts +38 -38
- package/src/data/TaskTransactionManager.d.ts +17 -17
- package/src/data/XMLBasedDcValuesBuilder.d.ts +11 -11
- package/src/enums.d.ts +21 -21
- package/src/env/EnvVariablesTable.d.ts +17 -17
- package/src/env/Environment.d.ts +118 -118
- package/src/env/ILanguageData.d.ts +3 -3
- package/src/env/LanguageData.d.ts +20 -20
- package/src/env/MirrorString.d.ts +15 -15
- package/src/event/ActionManager.d.ts +14 -14
- package/src/event/Event.d.ts +79 -79
- package/src/event/EventHandler.d.ts +66 -66
- package/src/event/EventHandlerPosition.d.ts +25 -25
- package/src/event/EventsManager.d.ts +205 -204
- package/src/event/IEventsManager.d.ts +77 -77
- package/src/event/RunTimeEvent.d.ts +126 -123
- package/src/event/RunTimeEventBase.d.ts +5 -5
- package/src/event/UserEventsTable.d.ts +11 -11
- package/src/exp/ExpTable.d.ts +11 -11
- package/src/exp/Expression.d.ts +37 -37
- package/src/exp/ExpressionDict.d.ts +12 -12
- package/src/exp/ExpressionEvaluator.d.ts +198 -198
- package/src/exp/ExpressionLocalJpn.d.ts +18 -18
- package/src/exp/GlobalParamsTable.d.ts +19 -19
- package/src/exp/YesNoExp.d.ts +9 -9
- package/src/gui/CreatedFormVector.d.ts +10 -10
- package/src/gui/FormsTable.d.ts +15 -15
- package/src/gui/MgControl.d.ts +60 -60
- package/src/gui/MgForm.d.ts +96 -93
- package/src/http/HttpManager.d.ts +25 -25
- package/src/http/client/HttpClientAsync.d.ts +16 -16
- package/src/http/client/HttpClientBase.d.ts +30 -30
- package/src/http/client/HttpClientEvents.d.ts +18 -18
- package/src/http/client/HttpClientSync.d.ts +17 -17
- package/src/http/client/HttpUtility.d.ts +10 -10
- package/src/http/client/ICommunicationsFailureHandler.d.ts +5 -5
- package/src/remote/AddUserLocateRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/AddUserRangeRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/AddUserSortRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/RemoteCommandsProcessor.d.ts +51 -51
- package/src/remote/RemoteControlItemsRefreshCommand.d.ts +8 -8
- package/src/remote/RemoteDataViewCommandBase.d.ts +10 -10
- package/src/remote/RemoteDataViewCommandFactory.d.ts +6 -6
- package/src/remote/RemoteDataViewCommandUpdateNonModifiable.d.ts +8 -8
- package/src/remote/RemoteDataviewManager.d.ts +9 -9
- package/src/remote/RemoteInitDataViewCommand.d.ts +7 -7
- package/src/remote/ResetUserLocateRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ResetUserRangeRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ResetUserSortRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ServerError.d.ts +16 -16
- package/src/remote/SetTransactionStateRemoteDataViewCommand.d.ts +8 -8
- package/src/rt/Argument.d.ts +36 -36
- package/src/rt/ArgumentsList.d.ts +24 -24
- package/src/rt/Boundary.d.ts +27 -27
- package/src/rt/CompMainPrgTable.d.ts +10 -10
- package/src/rt/DataviewHeaderBase.d.ts +34 -34
- package/src/rt/DataviewHeaderFactory.d.ts +5 -5
- package/src/rt/DataviewHeaders.d.ts +12 -12
- package/src/rt/DataviewHeadersSaxHandler.d.ts +10 -10
- package/src/rt/ExecutionStack.d.ts +22 -22
- package/src/rt/ExecutionStackEntry.d.ts +7 -7
- package/src/rt/HandlersTable.d.ts +19 -19
- package/src/rt/IDataSourceViewDefinition.d.ts +6 -6
- package/src/rt/IDataviewHeader.d.ts +10 -10
- package/src/rt/IResultValue.d.ts +4 -4
- package/src/rt/LastFocusedManager.d.ts +23 -23
- package/src/rt/Operation.d.ts +97 -97
- package/src/rt/OperationTable.d.ts +15 -15
- package/src/rt/Recompute.d.ts +41 -41
- package/src/rt/RecomputeTable.d.ts +9 -9
- package/src/rt/RemoteDataviewHeader.d.ts +14 -14
- package/src/rt/ResultValue.d.ts +7 -7
- package/src/rt/TableCache.d.ts +29 -29
- package/src/rt/TableCacheManager.d.ts +10 -10
- package/src/rt/Transaction.d.ts +23 -23
- package/src/security/UserDetails.d.ts +16 -16
- package/src/tasks/IMGDataCollection.d.ts +26 -26
- package/src/tasks/MGData.d.ts +63 -63
- package/src/tasks/MGDataCollection.d.ts +42 -42
- package/src/tasks/RCTimer.d.ts +13 -13
- package/src/tasks/RemoteTaskService.d.ts +16 -16
- package/src/tasks/Task.d.ts +312 -312
- package/src/tasks/TaskBase.d.ts +123 -123
- package/src/tasks/TaskServiceBase.d.ts +16 -16
- package/src/tasks/TasksTable.d.ts +21 -21
- package/src/tasks/sort/Sort.d.ts +4 -4
- package/src/tasks/sort/SortCollection.d.ts +11 -11
- package/src/util/ConstUtils.d.ts +3 -3
- package/src/util/FlowMonitorQueue.d.ts +70 -70
- package/src/util/HeapSort.d.ts +6 -6
- package/src/util/IMirrorXML.d.ts +6 -6
- package/src/util/IServerConfig.d.ts +11 -11
- package/src/util/MgBlockingQueue.d.ts +5 -5
- package/src/util/MgPriorityBlockingQueue.d.ts +17 -17
- package/src/util/MgPriorityQueue.d.ts +13 -13
- package/src/util/ParamParseResult.d.ts +6 -6
- package/src/util/PrmMap.d.ts +28 -28
- package/src/util/ReturnResult.d.ts +18 -18
- package/src/util/ReturnResultBase.d.ts +11 -11
- package/src/util/Scrambler.d.ts +10 -10
- package/src/util/UniqueIDUtils.d.ts +4 -4
- package/src/util/cookie.service.d.ts +8 -8
- package/esm2020/src/AccessHelper.mjs +0 -9
- package/esm2020/src/ClientManager.mjs +0 -399
- package/esm2020/src/CommandsProcessorBase.mjs +0 -58
- package/esm2020/src/CommandsProcessorManager.mjs +0 -26
- package/esm2020/src/CommandsTable.mjs +0 -162
- package/esm2020/src/ConstInterface.mjs +0 -516
- package/esm2020/src/FlowMonitorInterface.mjs +0 -16
- package/esm2020/src/GUIManager.mjs +0 -62
- package/esm2020/src/GlobalCommandsManager.mjs +0 -34
- package/esm2020/src/GuiEventsProcessor.mjs +0 -154
- package/esm2020/src/ServerConfig.mjs +0 -117
- package/esm2020/src/bridge/MagicBridge.mjs +0 -41
- package/esm2020/src/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
- package/esm2020/src/commands/ClientToServer/BrowserEscEventCommand.mjs +0 -23
- package/esm2020/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +0 -60
- package/esm2020/src/commands/ClientToServer/ColumnSortEventCommand.mjs +0 -26
- package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
- package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
- package/esm2020/src/commands/ClientToServer/ComputeEventCommand.mjs +0 -23
- package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
- package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
- package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
- package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
- package/esm2020/src/commands/ClientToServer/IndexChangeEventCommand.mjs +0 -21
- package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
- package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
- package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
- package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
- package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
- package/esm2020/src/commands/ClientToServer/SelectProgramCommand.mjs +0 -15
- package/esm2020/src/commands/ClientToServer/SubformOpenEventCommand.mjs +0 -21
- package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
- package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
- package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
- package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
- package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
- package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
- package/esm2020/src/commands/ServerToClient/AddRangeCommand.mjs +0 -62
- package/esm2020/src/commands/ServerToClient/AddSortCommand.mjs +0 -33
- package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
- package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
- package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
- package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
- package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
- package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
- package/esm2020/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +0 -132
- package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
- package/esm2020/src/data/DataView.mjs +0 -1610
- package/esm2020/src/data/DataviewManager.mjs +0 -28
- package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
- package/esm2020/src/data/DvCache.mjs +0 -67
- package/esm2020/src/data/Field.mjs +0 -646
- package/esm2020/src/data/FieldBase.mjs +0 -18
- package/esm2020/src/data/FieldsTable.mjs +0 -103
- package/esm2020/src/data/Key.mjs +0 -88
- package/esm2020/src/data/Record.mjs +0 -846
- package/esm2020/src/data/RecordsTable.mjs +0 -267
- package/esm2020/src/data/TaskTransactionManager.mjs +0 -103
- package/esm2020/src/data/XMLBasedDcValuesBuilder.mjs +0 -74
- package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
- package/esm2020/src/env/Environment.mjs +0 -489
- package/esm2020/src/env/LanguageData.mjs +0 -226
- package/esm2020/src/env/MirrorString.mjs +0 -65
- package/esm2020/src/event/ActionManager.mjs +0 -91
- package/esm2020/src/event/Event.mjs +0 -1333
- package/esm2020/src/event/EventHandler.mjs +0 -766
- package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
- package/esm2020/src/event/EventsManager.mjs +0 -2975
- package/esm2020/src/event/RunTimeEvent.mjs +0 -392
- package/esm2020/src/event/UserEventsTable.mjs +0 -47
- package/esm2020/src/exp/ExpTable.mjs +0 -59
- package/esm2020/src/exp/Expression.mjs +0 -200
- package/esm2020/src/exp/ExpressionDict.mjs +0 -727
- package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4212
- package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
- package/esm2020/src/exp/GlobalParamsTable.mjs +0 -85
- package/esm2020/src/exp/YesNoExp.mjs +0 -36
- package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
- package/esm2020/src/gui/FormsTable.mjs +0 -66
- package/esm2020/src/gui/MgControl.mjs +0 -353
- package/esm2020/src/gui/MgForm.mjs +0 -1181
- package/esm2020/src/http/HttpManager.mjs +0 -97
- package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
- package/esm2020/src/http/client/HttpClientBase.mjs +0 -132
- package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
- package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
- package/esm2020/src/http/client/HttpUtility.mjs +0 -84
- package/esm2020/src/remote/AddUserLocateRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/AddUserRangeRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/AddUserSortRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
- package/esm2020/src/remote/RemoteControlItemsRefreshCommand.mjs +0 -25
- package/esm2020/src/remote/RemoteDataViewCommandBase.mjs +0 -24
- package/esm2020/src/remote/RemoteDataViewCommandFactory.mjs +0 -61
- package/esm2020/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +0 -17
- package/esm2020/src/remote/ResetUserSortRemoteDataviewCommand.mjs +0 -16
- package/esm2020/src/remote/ServerError.mjs +0 -40
- package/esm2020/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +0 -20
- package/esm2020/src/rt/Argument.mjs +0 -265
- package/esm2020/src/rt/ArgumentsList.mjs +0 -103
- package/esm2020/src/rt/Boundary.mjs +0 -152
- package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
- package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
- package/esm2020/src/rt/DataviewHeadersSaxHandler.mjs +0 -38
- package/esm2020/src/rt/ExecutionStack.mjs +0 -94
- package/esm2020/src/rt/HandlersTable.mjs +0 -96
- package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
- package/esm2020/src/rt/Operation.mjs +0 -735
- package/esm2020/src/rt/OperationTable.mjs +0 -67
- package/esm2020/src/rt/Recompute.mjs +0 -355
- package/esm2020/src/rt/RecomputeTable.mjs +0 -63
- package/esm2020/src/rt/RemoteDataviewHeader.mjs +0 -108
- package/esm2020/src/rt/ResultValue.mjs +0 -12
- package/esm2020/src/rt/TableCache.mjs +0 -177
- package/esm2020/src/rt/TableCacheManager.mjs +0 -67
- package/esm2020/src/rt/Transaction.mjs +0 -53
- package/esm2020/src/security/UserDetails.mjs +0 -71
- package/esm2020/src/tasks/MGData.mjs +0 -552
- package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
- package/esm2020/src/tasks/RCTimer.mjs +0 -63
- package/esm2020/src/tasks/RemoteTaskService.mjs +0 -45
- package/esm2020/src/tasks/Task.mjs +0 -2495
- package/esm2020/src/tasks/TaskBase.mjs +0 -87
- package/esm2020/src/tasks/TaskServiceBase.mjs +0 -25
- package/esm2020/src/tasks/TasksTable.mjs +0 -80
- package/esm2020/src/tasks/sort/Sort.mjs +0 -7
- package/esm2020/src/tasks/sort/SortCollection.mjs +0 -67
- package/esm2020/src/util/ConstUtils.mjs +0 -14
- package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
- package/esm2020/src/util/HeapSort.mjs +0 -70
- package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
- package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
- package/esm2020/src/util/PrmMap.mjs +0 -151
- package/esm2020/src/util/ReturnResult.mjs +0 -46
- package/esm2020/src/util/ReturnResultBase.mjs +0 -18
- package/esm2020/src/util/Scrambler.mjs +0 -89
- package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
- package/esm2020/src/util/cookie.service.mjs +0 -92
- package/fesm2015/magic-xpa-engine.mjs +0 -30835
- package/fesm2015/magic-xpa-engine.mjs.map +0 -1
- package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -1,2495 +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
|
-
}
|
734
|
-
}
|
735
|
-
this.SubformExecMode = Task_SubformExecModeEnum.SET_FOCUS;
|
736
|
-
AccessHelper.eventsManager.popNewExecStacks();
|
737
|
-
}
|
738
|
-
}
|
739
|
-
CheckAndSetSubForm() {
|
740
|
-
this.IsSubForm = (!super.isMainProg() && this !== this._mgData.getFirstTask());
|
741
|
-
}
|
742
|
-
IsRoute() {
|
743
|
-
return (this.RouterPath != null);
|
744
|
-
}
|
745
|
-
async stop() {
|
746
|
-
let task;
|
747
|
-
if (this._aborting)
|
748
|
-
return;
|
749
|
-
if (this.hasSubTasks()) {
|
750
|
-
while ((task = this.SubTasks.getTask(0)) != null) {
|
751
|
-
task.setDestinationSubform(this._destinationSubform);
|
752
|
-
await task.stop();
|
753
|
-
}
|
754
|
-
}
|
755
|
-
if (!this._isMainPrg)
|
756
|
-
this._aborting = true;
|
757
|
-
if (this._parentTask != null) {
|
758
|
-
this._parentTask.removeSubTask(this);
|
759
|
-
if (this.IsSubForm) {
|
760
|
-
let oldTimers = new List(), newTimers = new List();
|
761
|
-
let mgd = this.getMGData();
|
762
|
-
if (mgd.getTimerHandlers() != null)
|
763
|
-
oldTimers = mgd.getTimerHandlers().getTimersVector();
|
764
|
-
mgd.removeTimerHandler(this);
|
765
|
-
mgd.removeExpressionHandler(this);
|
766
|
-
if (mgd.getTimerHandlers() != null)
|
767
|
-
newTimers = mgd.getTimerHandlers().getTimersVector();
|
768
|
-
mgd.changeTimers(oldTimers, newTimers);
|
769
|
-
mgd.removeTask(this);
|
770
|
-
GUIManager.Instance.abort(this.getForm());
|
771
|
-
}
|
772
|
-
}
|
773
|
-
this.AbortTransaction();
|
774
|
-
if (this.getClickedControl() != null)
|
775
|
-
RuntimeContextBase.Instance.CurrentClickedCtrl = null;
|
776
|
-
if (this.Form != null)
|
777
|
-
this.Form.removeRefsToCtrls();
|
778
|
-
if (this.IsSubForm) {
|
779
|
-
let subForm = this.Form.getSubFormCtrl();
|
780
|
-
subForm.setSubformTaskId(null);
|
781
|
-
subForm.initSubformTask();
|
782
|
-
if (LastFocusedManager.Instance.getLastFocusedTask() === this)
|
783
|
-
LastFocusedManager.Instance.setLastFocusedTask(this._parentTask);
|
784
|
-
if (subForm.SubformLoaded)
|
785
|
-
await (subForm.getProp(PropInterface.PROP_TYPE_VISIBLE)).RefreshDisplay(true);
|
786
|
-
}
|
787
|
-
let clearDataViewCommand = CommandFactory.CreateDataViewCommand(this.getTaskTag(), DataViewCommandType.Clear);
|
788
|
-
await this.DataviewManager.Execute(clearDataViewCommand);
|
789
|
-
}
|
790
|
-
abort() {
|
791
|
-
this.getMGData().abort();
|
792
|
-
}
|
793
|
-
hasSubTasks() {
|
794
|
-
return this.SubTasks !== null && this.SubTasks.getSize() > 0;
|
795
|
-
}
|
796
|
-
getTaskDepth(byParentOrder) {
|
797
|
-
if (byParentOrder)
|
798
|
-
return this.getTaskDepth_(byParentOrder);
|
799
|
-
let depth = this.GetContextTask().getTaskDepth_(byParentOrder);
|
800
|
-
if (this.isMainProg() && this.getCtlIdx() !== ConstInterface.TOP_LEVEL_CONTAINER)
|
801
|
-
depth = depth + 1;
|
802
|
-
return depth;
|
803
|
-
}
|
804
|
-
getTaskDepth_(byParentOrder) {
|
805
|
-
let tmpTask = this.getTriggeringTask();
|
806
|
-
if (tmpTask == null || byParentOrder)
|
807
|
-
if (this._parentTask == null)
|
808
|
-
return 1;
|
809
|
-
else {
|
810
|
-
if (byParentOrder && this.getCtlIdx() !== this._parentTask.getCtlIdx())
|
811
|
-
return 2 + this._parentTask.getTaskDepth_(byParentOrder);
|
812
|
-
return 1 + this._parentTask.getTaskDepth_(byParentOrder);
|
813
|
-
}
|
814
|
-
return 1 + (tmpTask).getTaskDepth_(byParentOrder);
|
815
|
-
}
|
816
|
-
GetTaskAncestor(generation) {
|
817
|
-
return this.getTaskAncestor_(generation);
|
818
|
-
}
|
819
|
-
getTaskAncestor_(generation) {
|
820
|
-
let retTask = null;
|
821
|
-
if (generation === 0)
|
822
|
-
retTask = this;
|
823
|
-
else {
|
824
|
-
let tmpTask = this.getTriggeringTask();
|
825
|
-
if (tmpTask === null)
|
826
|
-
tmpTask = this._parentTask;
|
827
|
-
if (tmpTask !== null)
|
828
|
-
retTask = tmpTask.getTaskAncestor_(--generation);
|
829
|
-
}
|
830
|
-
return retTask;
|
831
|
-
}
|
832
|
-
GetTaskDepth() {
|
833
|
-
return this.getTaskDepth(false);
|
834
|
-
}
|
835
|
-
pathContains(task) {
|
836
|
-
return this._taskPath.Contains(task);
|
837
|
-
}
|
838
|
-
SetContextTask(context) {
|
839
|
-
this.ContextTask = context;
|
840
|
-
}
|
841
|
-
GetContextTask() {
|
842
|
-
let currRec = (this.DataView.getCurrRec());
|
843
|
-
if (this.InStartProcess
|
844
|
-
|| currRec !== null && (currRec.InCompute || currRec.InRecompute)
|
845
|
-
|| this.Form !== null && this.Form.inRefreshDisplay())
|
846
|
-
return this;
|
847
|
-
return this.ContextTask;
|
848
|
-
}
|
849
|
-
getTriggeringTask() {
|
850
|
-
if (this._triggeringTask !== null && this._triggeringTask.getMGData().IsAborting)
|
851
|
-
this._triggeringTask = this._parentTask;
|
852
|
-
return this._triggeringTask;
|
853
|
-
}
|
854
|
-
setLastParkedCtrl(ctrl) {
|
855
|
-
super.setLastParkedCtrl(ctrl);
|
856
|
-
LastFocusedManager.setLastFocusedControl(this, ctrl);
|
857
|
-
}
|
858
|
-
queryTaskPath() {
|
859
|
-
let insertedNames = 0;
|
860
|
-
let result = new StringBuilder(7936);
|
861
|
-
let treeRoute = new Array(this.getTaskDepth(false));
|
862
|
-
this.pathToRoot(treeRoute, false);
|
863
|
-
for (let tsk = treeRoute.length - 1; tsk >= 0; tsk--) {
|
864
|
-
let currTsk = treeRoute[tsk];
|
865
|
-
if (currTsk.isMainProg())
|
866
|
-
continue;
|
867
|
-
let nameProp = currTsk.getProp(PropInterface.PROP_TYPE_NAME);
|
868
|
-
if (nameProp == null)
|
869
|
-
continue;
|
870
|
-
let name = nameProp.GetComputedValue();
|
871
|
-
if (!NString.IsNullOrEmpty(name)) {
|
872
|
-
if (insertedNames++ !== 0)
|
873
|
-
result.Append(';');
|
874
|
-
result.Append(name);
|
875
|
-
}
|
876
|
-
}
|
877
|
-
return result;
|
878
|
-
}
|
879
|
-
ctl_itm_2_parent_vee(itm) {
|
880
|
-
let currTsk;
|
881
|
-
let currItm = 0;
|
882
|
-
let lastItm = 0;
|
883
|
-
let treeRoute = new Array(this.getTaskDepth(true));
|
884
|
-
this.pathToRoot(treeRoute, true);
|
885
|
-
for (let tsk = treeRoute.length - 1; tsk >= 0; tsk--) {
|
886
|
-
currTsk = treeRoute[tsk];
|
887
|
-
currItm += currTsk.DataView.GetFieldsTab().getSize();
|
888
|
-
if (itm < currItm) {
|
889
|
-
itm -= lastItm;
|
890
|
-
return currTsk.DataView.getField(itm);
|
891
|
-
}
|
892
|
-
lastItm = currItm;
|
893
|
-
}
|
894
|
-
return null;
|
895
|
-
}
|
896
|
-
GetControlIDFromVarItem(item) {
|
897
|
-
let currTask;
|
898
|
-
let currItem = 0;
|
899
|
-
let lastItem = 0;
|
900
|
-
let noOfControlsBeforeCurrTask = 0;
|
901
|
-
let treeRoute = new Array(this.getTaskDepth(true));
|
902
|
-
this.pathToRoot(treeRoute, true);
|
903
|
-
for (let task = treeRoute.length - 1; task >= 0; task--) {
|
904
|
-
currTask = treeRoute[task];
|
905
|
-
currItem += currTask.DataView.GetFieldsTab().getSize();
|
906
|
-
if (item < currItem) {
|
907
|
-
item -= lastItem;
|
908
|
-
let field = currTask.DataView.getField(item);
|
909
|
-
if (field.getCtrl() != null)
|
910
|
-
return noOfControlsBeforeCurrTask = noOfControlsBeforeCurrTask + currTask.Form.getControlIdx(field.getCtrl()) + 1;
|
911
|
-
return 0;
|
912
|
-
}
|
913
|
-
if (currTask.Form != null)
|
914
|
-
noOfControlsBeforeCurrTask += currTask.Form.getCtrlCount();
|
915
|
-
lastItem = currItem;
|
916
|
-
}
|
917
|
-
return 0;
|
918
|
-
}
|
919
|
-
GetControlFromControlID(controlID, parent) {
|
920
|
-
let control = null;
|
921
|
-
parent.value = -1;
|
922
|
-
if (controlID >= 0) {
|
923
|
-
let currTask = null;
|
924
|
-
let callerTask = null;
|
925
|
-
let noOfControlsInCurrtask = 0;
|
926
|
-
let noOfControlsBeforeCurrTask = 0;
|
927
|
-
let controlIdx = 0;
|
928
|
-
let treeRoute = new Array(this.getTaskDepth(true));
|
929
|
-
this.pathToRoot(treeRoute, true);
|
930
|
-
for (let task = treeRoute.length - 1; task >= 0; task--) {
|
931
|
-
currTask = treeRoute[task];
|
932
|
-
if (currTask.Form != null) {
|
933
|
-
noOfControlsInCurrtask = currTask.Form.getCtrlCount();
|
934
|
-
if (controlID < (noOfControlsBeforeCurrTask + noOfControlsInCurrtask)) {
|
935
|
-
controlIdx = controlID - noOfControlsBeforeCurrTask;
|
936
|
-
control = currTask.Form.CtrlTab.getCtrl(controlIdx);
|
937
|
-
callerTask = currTask;
|
938
|
-
break;
|
939
|
-
}
|
940
|
-
noOfControlsBeforeCurrTask += noOfControlsInCurrtask;
|
941
|
-
}
|
942
|
-
}
|
943
|
-
if (control != null) {
|
944
|
-
parent.value = 0;
|
945
|
-
let prevCtlIdx = treeRoute[0].TaskDefinitionId.CtlIndex;
|
946
|
-
for (let task = 0; task < treeRoute.length - 1; task++) {
|
947
|
-
currTask = treeRoute[task];
|
948
|
-
if (prevCtlIdx !== currTask.TaskDefinitionId.CtlIndex)
|
949
|
-
parent.value++;
|
950
|
-
if (callerTask.TaskDefinitionId.CtlIndex === currTask.TaskDefinitionId.CtlIndex)
|
951
|
-
break;
|
952
|
-
prevCtlIdx = currTask.TaskDefinitionId.CtlIndex;
|
953
|
-
}
|
954
|
-
}
|
955
|
-
}
|
956
|
-
return control;
|
957
|
-
}
|
958
|
-
ctl_itm_4_parent_vee(parent, vee) {
|
959
|
-
let tsk;
|
960
|
-
let depth = this.getTaskDepth(true);
|
961
|
-
if (parent !== TaskBase.MAIN_PRG_PARENT_ID && depth <= parent)
|
962
|
-
return vee;
|
963
|
-
let treeRoute = new Array(depth);
|
964
|
-
if (vee !== 0) {
|
965
|
-
this.pathToRoot(treeRoute, true);
|
966
|
-
let indOfParentInTaskTree = this.getIndOfParentInTaskTree(parent, treeRoute);
|
967
|
-
let i;
|
968
|
-
for (i = treeRoute.length - 1; i > indOfParentInTaskTree; i--) {
|
969
|
-
tsk = treeRoute[i];
|
970
|
-
vee += tsk.DataView.GetFieldsTab().getSize();
|
971
|
-
}
|
972
|
-
}
|
973
|
-
return vee;
|
974
|
-
}
|
975
|
-
getIndOfParentInTaskTree(parent, taskTree) {
|
976
|
-
let indOfParentInTaskTree = 0;
|
977
|
-
if (parent === TaskBase.MAIN_PRG_PARENT_ID) {
|
978
|
-
for (let i = 1; i < taskTree.length; i = i + 1) {
|
979
|
-
if (taskTree[i].isMainProg() && this._ctlIdx === taskTree[i].getCtlIdx()) {
|
980
|
-
indOfParentInTaskTree = i;
|
981
|
-
break;
|
982
|
-
}
|
983
|
-
}
|
984
|
-
}
|
985
|
-
else
|
986
|
-
indOfParentInTaskTree = parent;
|
987
|
-
return indOfParentInTaskTree;
|
988
|
-
}
|
989
|
-
getFieldByName(fldName) {
|
990
|
-
return (this.GetContextTask()).getFieldByName_(fldName);
|
991
|
-
}
|
992
|
-
getFieldByName_(fldName) {
|
993
|
-
let tmpTask;
|
994
|
-
if (fldName == null)
|
995
|
-
return null;
|
996
|
-
let fld = this.getField(fldName);
|
997
|
-
if (fld == null) {
|
998
|
-
tmpTask = this.getTriggeringTask() != null ? this.getTriggeringTask() : this._parentTask;
|
999
|
-
if (tmpTask != null) {
|
1000
|
-
if (!this.isMainProg() && this.getCtlIdx() !== tmpTask.getCtlIdx()) {
|
1001
|
-
let mainPrg = AccessHelper.mgDataTable.GetMainProgByCtlIdx(-1, this.getCtlIdx());
|
1002
|
-
fld = mainPrg.getFieldByName_(fldName);
|
1003
|
-
}
|
1004
|
-
if (fld == null)
|
1005
|
-
fld = tmpTask.getFieldByName_(fldName);
|
1006
|
-
}
|
1007
|
-
}
|
1008
|
-
return fld;
|
1009
|
-
}
|
1010
|
-
getIndexOfFieldByName(fldName) {
|
1011
|
-
let depth = this.getTaskDepth(true);
|
1012
|
-
let index = 0;
|
1013
|
-
let fld = this.getFieldByName(fldName);
|
1014
|
-
let fldTab;
|
1015
|
-
if (fld == null)
|
1016
|
-
return 0;
|
1017
|
-
let treeRoute = new Array(depth);
|
1018
|
-
this.pathToRoot(treeRoute, true);
|
1019
|
-
for (let curr = depth - 1; curr >= 0; curr--) {
|
1020
|
-
let currTask = treeRoute[curr];
|
1021
|
-
if (currTask === fld.getTask()) {
|
1022
|
-
curr = fld.getId();
|
1023
|
-
index += ++curr;
|
1024
|
-
break;
|
1025
|
-
}
|
1026
|
-
fldTab = currTask.DataView.GetFieldsTab();
|
1027
|
-
index += fldTab.getSize();
|
1028
|
-
}
|
1029
|
-
return index;
|
1030
|
-
}
|
1031
|
-
pathToRoot(path, byParentOrder) {
|
1032
|
-
let task = (byParentOrder ? this : this.GetContextTask());
|
1033
|
-
for (let i = 0; i < path.length; i++) {
|
1034
|
-
path[i] = task;
|
1035
|
-
let ctlIdx = task.getCtlIdx();
|
1036
|
-
let tmpTask = byParentOrder ? null : task.getTriggeringTask();
|
1037
|
-
if (tmpTask != null)
|
1038
|
-
task = tmpTask;
|
1039
|
-
else {
|
1040
|
-
task = task.getParent();
|
1041
|
-
if (task == null) {
|
1042
|
-
if (!byParentOrder && this.isMainProg() && this.getCtlIdx() !== ConstInterface.TOP_LEVEL_CONTAINER)
|
1043
|
-
path[i + 1] = this;
|
1044
|
-
break;
|
1045
|
-
}
|
1046
|
-
if (byParentOrder && ctlIdx !== task.getCtlIdx())
|
1047
|
-
path[++i] = AccessHelper.mgDataTable.GetMainProgByCtlIdx(-1, ctlIdx);
|
1048
|
-
}
|
1049
|
-
}
|
1050
|
-
}
|
1051
|
-
shouldBeRefreshed() {
|
1052
|
-
let dataView = this._parentTask.DataView;
|
1053
|
-
let result = false;
|
1054
|
-
if (this._parentTask === null || dataView.isPrevCurrRecNull() ||
|
1055
|
-
(this.RefreshOnVars !== null && !dataView.currEqualsPrev(this.RefreshOnVars)))
|
1056
|
-
result = true;
|
1057
|
-
return result;
|
1058
|
-
}
|
1059
|
-
async CheckRefreshSubTasks() {
|
1060
|
-
let ret = false;
|
1061
|
-
if (this._enteredRecLevel) {
|
1062
|
-
let subformsToRefresh = await this.GetSubformsToRefresh();
|
1063
|
-
if (subformsToRefresh.length > 0)
|
1064
|
-
ret = true;
|
1065
|
-
}
|
1066
|
-
return ret;
|
1067
|
-
}
|
1068
|
-
GetSubTasks() {
|
1069
|
-
let subTasks = new List();
|
1070
|
-
if (this.hasSubTasks()) {
|
1071
|
-
for (let i = 0; i < this.SubTasks.getSize(); i = i + 1)
|
1072
|
-
subTasks.push(this.SubTasks.getTask(i));
|
1073
|
-
}
|
1074
|
-
return subTasks;
|
1075
|
-
}
|
1076
|
-
async GetSubformsToRefresh() {
|
1077
|
-
let subTasks = this.GetSubTasks();
|
1078
|
-
let subTasksToRefresh = new List();
|
1079
|
-
for (let i = 0; i < subTasks.length; i++) {
|
1080
|
-
let subTask = subTasks.get_Item(i);
|
1081
|
-
if (await this.ShouldRefreshSubformTask(subTask))
|
1082
|
-
subTasksToRefresh.push(subTask);
|
1083
|
-
}
|
1084
|
-
return subTasksToRefresh;
|
1085
|
-
}
|
1086
|
-
async ShouldRefreshSubformTask(subTask) {
|
1087
|
-
let refresh = false;
|
1088
|
-
let subformCtrl = subTask.getForm().getSubFormCtrl();
|
1089
|
-
subTask.DoSubformPrefixSuffix = false;
|
1090
|
-
if (subformCtrl != null && !subTask.InSelect && subTask.AfterFirstRecordPrefix) {
|
1091
|
-
let parentMode = this.getMode();
|
1092
|
-
let modeProperty = (parentMode === Constants.TASK_MODE_QUERY ? PropInterface.PROP_TYPE_ALLOW_QUERY
|
1093
|
-
: parentMode === Constants.TASK_MODE_MODIFY
|
1094
|
-
? PropInterface.PROP_TYPE_ALLOW_MODIFY
|
1095
|
-
: PropInterface.PROP_TYPE_ALLOW_CREATE);
|
1096
|
-
if (subTask.ModeAsParent && parentMode !== subTask.getMode() &&
|
1097
|
-
this.getLevel() === Constants.TASK_LEVEL_RECORD &&
|
1098
|
-
await (subTask.getProp(PropInterface.PROP_TYPE_ALLOW_OPTION)).getValueBoolean() &&
|
1099
|
-
await subTask.checkProp(modeProperty, true)) {
|
1100
|
-
if (!subformCtrl.isVisible() &&
|
1101
|
-
!await subformCtrl.checkProp(PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN, false)) {
|
1102
|
-
subformCtrl.RefreshOnVisible = true;
|
1103
|
-
refresh = false;
|
1104
|
-
}
|
1105
|
-
else
|
1106
|
-
refresh = true;
|
1107
|
-
await subTask.SetModeAsParent(parentMode);
|
1108
|
-
}
|
1109
|
-
else {
|
1110
|
-
refresh = await subformCtrl.checkProp(PropInterface.PROP_TYPE_AUTO_REFRESH, true) && subTask.shouldBeRefreshed();
|
1111
|
-
if (refresh) {
|
1112
|
-
if (!subformCtrl.isVisible() &&
|
1113
|
-
!await subformCtrl.checkProp(PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN, false)) {
|
1114
|
-
subformCtrl.RefreshOnVisible = true;
|
1115
|
-
refresh = false;
|
1116
|
-
}
|
1117
|
-
}
|
1118
|
-
}
|
1119
|
-
if (refresh)
|
1120
|
-
subTask.DoSubformPrefixSuffix = true;
|
1121
|
-
}
|
1122
|
-
return refresh;
|
1123
|
-
}
|
1124
|
-
async SetModeAsParent(parentMode) {
|
1125
|
-
await this.enableModes();
|
1126
|
-
if (parentMode === Constants.TASK_MODE_CREATE) {
|
1127
|
-
let cmd = CommandFactory.CreateEventCommand(this.getTaskTag(), InternalInterface.MG_ACT_RTO_CREATE);
|
1128
|
-
await this.DataviewManager.Execute(cmd);
|
1129
|
-
}
|
1130
|
-
else if (this.getMode() === Constants.TASK_MODE_CREATE) {
|
1131
|
-
this.setPreventRecordSuffix(true);
|
1132
|
-
this.setPreventControlChange(true);
|
1133
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(this, InternalInterface.MG_ACT_RT_REFRESH_VIEW);
|
1134
|
-
this.setPreventRecordSuffix(false);
|
1135
|
-
this.setPreventControlChange(false);
|
1136
|
-
let subTaskDv = this.DataView;
|
1137
|
-
if (!subTaskDv.isEmpty() && (subTaskDv.getCurrRec()).getMode() !== DataModificationTypes.Insert)
|
1138
|
-
this.setMode(parentMode);
|
1139
|
-
else
|
1140
|
-
this.setMode(Constants.TASK_MODE_CREATE);
|
1141
|
-
await this.getForm().RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
1142
|
-
}
|
1143
|
-
else
|
1144
|
-
this.setMode(parentMode);
|
1145
|
-
this.setOriginalTaskMode(parentMode);
|
1146
|
-
await this.setCreateDeleteActsEnableState();
|
1147
|
-
}
|
1148
|
-
async doSubformRecPrefixSuffix() {
|
1149
|
-
let subTasks = this.GetSubTasks();
|
1150
|
-
for (let i = 0; i < subTasks.length; i++) {
|
1151
|
-
let subTask = subTasks.get_Item(i);
|
1152
|
-
if (subTask.DoSubformPrefixSuffix) {
|
1153
|
-
await AccessHelper.eventsManager.handleInternalEventWithTaskAndSubformRefresh(subTask, InternalInterface.MG_ACT_REC_PREFIX, true);
|
1154
|
-
if (!AccessHelper.eventsManager.GetStopExecutionFlag())
|
1155
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(subTask, InternalInterface.MG_ACT_REC_SUFFIX);
|
1156
|
-
}
|
1157
|
-
}
|
1158
|
-
}
|
1159
|
-
CleanDoSubformPrefixSuffix() {
|
1160
|
-
let subTasks = this.GetSubTasks();
|
1161
|
-
for (let i = 0; i < subTasks.length; i++) {
|
1162
|
-
let subTask = subTasks.get_Item(i);
|
1163
|
-
subTask.DoSubformPrefixSuffix = false;
|
1164
|
-
}
|
1165
|
-
}
|
1166
|
-
mustConfirmInDeleteMode() {
|
1167
|
-
let prop = this.getProp(PropInterface.PROP_TYPE_CONFIRM_UPDATE);
|
1168
|
-
return !prop.isExpression();
|
1169
|
-
}
|
1170
|
-
addSubTask(subTask) {
|
1171
|
-
if (this.SubTasks === null)
|
1172
|
-
this.SubTasks = new TasksTable();
|
1173
|
-
this.SubTasks.addTask(subTask);
|
1174
|
-
}
|
1175
|
-
removeSubTask(subTask) {
|
1176
|
-
if (this.SubTasks !== null)
|
1177
|
-
this.SubTasks.removeTask(subTask);
|
1178
|
-
}
|
1179
|
-
setTransactionFailed(val) {
|
1180
|
-
this._transactionFailed = val;
|
1181
|
-
if (!val)
|
1182
|
-
this.TransactionErrorHandlingsRetry = null;
|
1183
|
-
}
|
1184
|
-
transactionFailed(level) {
|
1185
|
-
if (level === ConstInterface.TRANS_NONE ||
|
1186
|
-
(this.Transaction != null && this.Transaction.getLevel() === level))
|
1187
|
-
return this._transactionFailed;
|
1188
|
-
else if (level === ConstInterface.TRANS_NONE ||
|
1189
|
-
(this.TransactionErrorHandlingsRetry != null && this.TransactionErrorHandlingsRetry.getLevel() === level))
|
1190
|
-
return this._transactionFailed;
|
1191
|
-
return false;
|
1192
|
-
}
|
1193
|
-
setAfterRetry(val) {
|
1194
|
-
if (this.Transaction != null)
|
1195
|
-
this.Transaction.setAfterRetry(val);
|
1196
|
-
else if (this.TransactionErrorHandlingsRetry != null) {
|
1197
|
-
if (val === ConstInterface.RECOVERY_NONE)
|
1198
|
-
this.TransactionErrorHandlingsRetry = null;
|
1199
|
-
else
|
1200
|
-
this.TransactionErrorHandlingsRetry.setAfterRetry(val);
|
1201
|
-
}
|
1202
|
-
}
|
1203
|
-
getAfterRetry(recovery) {
|
1204
|
-
if (arguments.length === 0) {
|
1205
|
-
return this.getAfterRetry_0();
|
1206
|
-
}
|
1207
|
-
return this.getAfterRetry_1(recovery);
|
1208
|
-
}
|
1209
|
-
getAfterRetry_0() {
|
1210
|
-
if (this.Transaction != null)
|
1211
|
-
return this.Transaction.getAfterRetry();
|
1212
|
-
else if (this.TransactionErrorHandlingsRetry != null)
|
1213
|
-
return this.TransactionErrorHandlingsRetry.getAfterRetry();
|
1214
|
-
return false;
|
1215
|
-
}
|
1216
|
-
getAfterRetry_1(recovery) {
|
1217
|
-
if (this.Transaction != null)
|
1218
|
-
return this.Transaction.getAfterRetry(recovery);
|
1219
|
-
else if (this.TransactionErrorHandlingsRetry != null)
|
1220
|
-
return this.TransactionErrorHandlingsRetry.getAfterRetry(recovery);
|
1221
|
-
return false;
|
1222
|
-
}
|
1223
|
-
getExecEndTask() {
|
1224
|
-
return this._bExecEndTask;
|
1225
|
-
}
|
1226
|
-
resetExecEndTask() {
|
1227
|
-
this._bExecEndTask = false;
|
1228
|
-
}
|
1229
|
-
setExecEndTask() {
|
1230
|
-
this._bExecEndTask = true;
|
1231
|
-
}
|
1232
|
-
async evalEndCond(mode) {
|
1233
|
-
let endTaskCondProp;
|
1234
|
-
let evalEndCondProp = this.getProp(PropInterface.PROP_TYPE_EVAL_END_CONDITION);
|
1235
|
-
if (this.InEndTask)
|
1236
|
-
return false;
|
1237
|
-
if (this._bExecEndTask)
|
1238
|
-
return true;
|
1239
|
-
if (evalEndCondProp != null && (NString.Compare(await evalEndCondProp.getValue(), ConstInterface.END_COND_EVAL_IMMIDIATE, true) === 0 || ((await evalEndCondProp.getValue()).toLowerCase() === mode.toLowerCase()))) {
|
1240
|
-
endTaskCondProp = this.getProp(PropInterface.PROP_TYPE_END_CONDITION);
|
1241
|
-
if (endTaskCondProp == null)
|
1242
|
-
return false;
|
1243
|
-
let endTask = await endTaskCondProp.getValue();
|
1244
|
-
if (DisplayConvertor.toBoolean(endTask)) {
|
1245
|
-
this._bExecEndTask = true;
|
1246
|
-
return true;
|
1247
|
-
}
|
1248
|
-
return false;
|
1249
|
-
}
|
1250
|
-
return false;
|
1251
|
-
}
|
1252
|
-
setTryingToStop(val) {
|
1253
|
-
if (this.hasSubTasks()) {
|
1254
|
-
for (let i = 0; i < this.SubTasks.getSize(); i = i + 1) {
|
1255
|
-
let task = this.SubTasks.getTask(i);
|
1256
|
-
task.setTryingToStop(val);
|
1257
|
-
}
|
1258
|
-
}
|
1259
|
-
this.IsTryingToStop = val;
|
1260
|
-
}
|
1261
|
-
getInRecordSuffix() {
|
1262
|
-
return this._inRecordSuffix;
|
1263
|
-
}
|
1264
|
-
setInRecordSuffix(bValue) {
|
1265
|
-
if (bValue !== this._inRecordSuffix) {
|
1266
|
-
this._inRecordSuffix = bValue;
|
1267
|
-
return true;
|
1268
|
-
}
|
1269
|
-
return false;
|
1270
|
-
}
|
1271
|
-
setEvalOldValues(bFlag) {
|
1272
|
-
if (bFlag !== this._evalOldValues) {
|
1273
|
-
this._evalOldValues = bFlag;
|
1274
|
-
return true;
|
1275
|
-
}
|
1276
|
-
return false;
|
1277
|
-
}
|
1278
|
-
getEvalOldValues() {
|
1279
|
-
return this._evalOldValues;
|
1280
|
-
}
|
1281
|
-
async endTask(reversibleExit, onlyDescs, dueToVerifyError, subformDestination) {
|
1282
|
-
if (isNullOrUndefined(subformDestination))
|
1283
|
-
return await this.endTask_1(reversibleExit, onlyDescs, false, dueToVerifyError);
|
1284
|
-
else
|
1285
|
-
return await this.endTask_1(reversibleExit, onlyDescs, subformDestination, dueToVerifyError);
|
1286
|
-
}
|
1287
|
-
async endTask_1(reversibleExit, onlyDescs, subformDestination, dueToVerifyError) {
|
1288
|
-
let succeeded = true;
|
1289
|
-
let closedSubForm = false;
|
1290
|
-
let subTask;
|
1291
|
-
let mgdTab = AccessHelper.mgDataTable;
|
1292
|
-
if ((this.IsSubForm && !subformDestination) && !this._parentTask.InEndTask) {
|
1293
|
-
succeeded = await this._parentTask.endTask(reversibleExit, onlyDescs, dueToVerifyError);
|
1294
|
-
}
|
1295
|
-
else if (!this.isAborting() && !this.InEndTask) {
|
1296
|
-
try {
|
1297
|
-
this.InEndTask = true;
|
1298
|
-
if ((MGDataCollection.Instance.StartupMgData.getFirstTask().InEndTask && MGDataCollection.Instance.StartupMgData.getFirstTask().ClosingFormUI) && AccessHelper.eventsManager.GetStopExecutionFlag()) {
|
1299
|
-
let cmd = CommandFactory.CreateUnloadCommand();
|
1300
|
-
MGDataCollection.Instance.getMGData(0).CmdsToServer.Add(cmd);
|
1301
|
-
await CommandsProcessorManager.GetCommandsProcessor().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
1302
|
-
return;
|
1303
|
-
}
|
1304
|
-
if (!this.IsTryingToStop)
|
1305
|
-
this.setTryingToStop(true);
|
1306
|
-
let i;
|
1307
|
-
if (reversibleExit) {
|
1308
|
-
if (this.hasSubTasks()) {
|
1309
|
-
if (!RemoteCommandsProcessor.GetInstance().DelayCommandExecution) {
|
1310
|
-
let pendingTransactions = true;
|
1311
|
-
let clientOperExist = await this.CheckIfClientOperationExistsInSubformTasks(this, InternalInterface.MG_ACT_TASK_SUFFIX);
|
1312
|
-
if (!clientOperExist) {
|
1313
|
-
clientOperExist = await this.CheckIfClientOperationExistsInSubformTasks(this, InternalInterface.MG_ACT_REC_SUFFIX);
|
1314
|
-
if (!clientOperExist)
|
1315
|
-
pendingTransactions = this.CheckIfPendingTransactions(this);
|
1316
|
-
}
|
1317
|
-
if (!clientOperExist && !pendingTransactions) {
|
1318
|
-
this.allowRemoteCmdExecution = false;
|
1319
|
-
this.SetServerSideTaskSuffix(this);
|
1320
|
-
RemoteCommandsProcessor.GetInstance().DelayCommandExecution = true;
|
1321
|
-
}
|
1322
|
-
}
|
1323
|
-
else
|
1324
|
-
this.SetServerSideTaskSuffix(this);
|
1325
|
-
for (i = 0; i < this.SubTasks.getSize() && succeeded; i++) {
|
1326
|
-
subTask = this.SubTasks.getTask(i);
|
1327
|
-
closedSubForm = closedSubForm || subTask.IsSubForm;
|
1328
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(subTask, InternalInterface.MG_ACT_EXIT);
|
1329
|
-
succeeded = (!AccessHelper.eventsManager.GetStopExecutionFlag() || dueToVerifyError);
|
1330
|
-
}
|
1331
|
-
}
|
1332
|
-
else {
|
1333
|
-
if (RemoteCommandsProcessor.GetInstance().DelayCommandExecution)
|
1334
|
-
this.SetServerSideTaskSuffix(this);
|
1335
|
-
}
|
1336
|
-
if (this === mgdTab.StartupMgData.getFirstTask()) {
|
1337
|
-
for (i = mgdTab.getSize() - 1; i > 0 && succeeded; i--) {
|
1338
|
-
if (mgdTab.getMGData(i) != null) {
|
1339
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(mgdTab.getMGData(i).getFirstTask(), InternalInterface.MG_ACT_EXIT);
|
1340
|
-
succeeded = (!AccessHelper.eventsManager.GetStopExecutionFlag() || dueToVerifyError);
|
1341
|
-
}
|
1342
|
-
}
|
1343
|
-
}
|
1344
|
-
}
|
1345
|
-
if (succeeded) {
|
1346
|
-
if (reversibleExit && !dueToVerifyError) {
|
1347
|
-
let forceSuffix = await this.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false);
|
1348
|
-
if (!this.IsInteractive && forceSuffix === true && this.getMode() === Constants.TASK_MODE_CREATE)
|
1349
|
-
this.setProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, "0");
|
1350
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(this, InternalInterface.MG_ACT_REC_SUFFIX);
|
1351
|
-
if (!this.IsInteractive && forceSuffix === true && this.getMode() === Constants.TASK_MODE_CREATE)
|
1352
|
-
this.setProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, "1");
|
1353
|
-
}
|
1354
|
-
succeeded = (!AccessHelper.eventsManager.GetStopExecutionFlag() || dueToVerifyError);
|
1355
|
-
if (succeeded && !onlyDescs)
|
1356
|
-
this.HandleTransactionInfo();
|
1357
|
-
let preTskSuffix = succeeded;
|
1358
|
-
if (succeeded && !onlyDescs && reversibleExit && !dueToVerifyError &&
|
1359
|
-
(!this.IsSubForm || subformDestination) &&
|
1360
|
-
this.TaskPrefixExecuted && !this.TaskSuffixExecuted)
|
1361
|
-
succeeded = await this.handleTaskSuffix(true);
|
1362
|
-
if (reversibleExit && this.hasSubTasks())
|
1363
|
-
for (i = 0; i < this.SubTasks.getSize(); i++) {
|
1364
|
-
subTask = this.SubTasks.getTask(i);
|
1365
|
-
if (!subTask.IsSubForm)
|
1366
|
-
await AccessHelper.eventsManager.handleNonReversibleEvent(subTask, InternalInterface.MG_ACT_EXIT);
|
1367
|
-
}
|
1368
|
-
if (reversibleExit)
|
1369
|
-
succeeded = (!AccessHelper.eventsManager.GetStopExecutionFlag() || dueToVerifyError);
|
1370
|
-
if (preTskSuffix)
|
1371
|
-
AccessHelper.eventsManager.setStopExecution(false);
|
1372
|
-
this.setAfterRetry(ConstInterface.RECOVERY_NONE);
|
1373
|
-
if (!this.isAborting() && succeeded && !onlyDescs) {
|
1374
|
-
if (reversibleExit) {
|
1375
|
-
this.setTransactionFailed(false);
|
1376
|
-
await this.TaskTransactionManager.checkAndCommit(false, ConstInterface.TRANS_TASK_PREFIX, false);
|
1377
|
-
succeeded = (!AccessHelper.eventsManager.GetStopExecutionFlag() || dueToVerifyError) && !this.isAborting() && !this.transactionFailed(ConstInterface.TRANS_TASK_PREFIX);
|
1378
|
-
}
|
1379
|
-
this.setAfterRetry(ConstInterface.RECOVERY_NONE);
|
1380
|
-
if (succeeded) {
|
1381
|
-
if (!this.allowRemoteCmdExecution) {
|
1382
|
-
this.allowRemoteCmdExecution = true;
|
1383
|
-
RemoteCommandsProcessor.GetInstance().DelayCommandExecution = false;
|
1384
|
-
}
|
1385
|
-
else if (this.DelayCommandExecution) {
|
1386
|
-
this.DelayCommandExecution = false;
|
1387
|
-
RemoteCommandsProcessor.GetInstance().DelayCommandExecution = true;
|
1388
|
-
}
|
1389
|
-
let baseMgd = AccessHelper.mgDataTable.StartupMgData;
|
1390
|
-
if (reversibleExit && baseMgd.getFirstTask().getTaskTag() === this.getTaskTag()) {
|
1391
|
-
AccessHelper.eventsManager.setProcessingTopMostEndTask(true);
|
1392
|
-
await AccessHelper.eventsManager.handleEvents(baseMgd, 0);
|
1393
|
-
AccessHelper.eventsManager.setProcessingTopMostEndTask(false);
|
1394
|
-
if (this.isAborting()) {
|
1395
|
-
RemoteCommandsProcessor.GetInstance().DelayCommandExecution = false;
|
1396
|
-
this.DelayCommandExecution = false;
|
1397
|
-
this.allowRemoteCmdExecution = true;
|
1398
|
-
return true;
|
1399
|
-
}
|
1400
|
-
}
|
1401
|
-
await TaskServiceBase.Exit(this, reversibleExit, subformDestination);
|
1402
|
-
if (this._parentTask != null && this._parentTask.isMainProg()) {
|
1403
|
-
let mgd = AccessHelper.mgDataTable.getMGData(0);
|
1404
|
-
let mainPrgTask = mgd.getMainProg(0);
|
1405
|
-
let rootTask = AccessHelper.mgDataTable.StartupMgData.getFirstTask();
|
1406
|
-
let endMainPrg = await mainPrgTask.checkProp(PropInterface.PROP_TYPE_END_CONDITION, false);
|
1407
|
-
if (this !== rootTask && endMainPrg) {
|
1408
|
-
let rtEvt = new RunTimeEvent(rootTask);
|
1409
|
-
rtEvt.setInternal(InternalInterface.MG_ACT_CLOSE);
|
1410
|
-
rtEvt.setCtrl(null);
|
1411
|
-
rtEvt.setArgList(null);
|
1412
|
-
AccessHelper.eventsManager.addToTail(rtEvt);
|
1413
|
-
}
|
1414
|
-
}
|
1415
|
-
MgForm.CreatedForms.remove(this.Form);
|
1416
|
-
}
|
1417
|
-
}
|
1418
|
-
}
|
1419
|
-
}
|
1420
|
-
finally {
|
1421
|
-
if (!this.IsSubForm || subformDestination)
|
1422
|
-
this.handleFinallyEndTask(succeeded, reversibleExit);
|
1423
|
-
}
|
1424
|
-
}
|
1425
|
-
else if (this.InEndTask)
|
1426
|
-
succeeded = false;
|
1427
|
-
AccessHelper.eventsManager.setProcessingTopMostEndTask(this._inProcessingTopMostEndTaskSaved);
|
1428
|
-
return succeeded;
|
1429
|
-
}
|
1430
|
-
SetServerSideTaskSuffix(task) {
|
1431
|
-
var rtEvt = new RunTimeEvent(task);
|
1432
|
-
rtEvt.setInternal(InternalInterface.MG_ACT_TASK_SUFFIX);
|
1433
|
-
let handler = null;
|
1434
|
-
var evtHanPos = new EventHandlerPosition();
|
1435
|
-
evtHanPos.init(rtEvt);
|
1436
|
-
handler = evtHanPos.getNext();
|
1437
|
-
if (handler != null) {
|
1438
|
-
for (let i = 0; i < handler.getOperationTab().getSize(); i++) {
|
1439
|
-
let oper = handler.getOperationTab().getOperation(i);
|
1440
|
-
oper.setExecOnServer(true);
|
1441
|
-
}
|
1442
|
-
}
|
1443
|
-
if (task.hasSubTasks()) {
|
1444
|
-
for (let i = 0; i < task.GetSubTasks().length; i++) {
|
1445
|
-
let subTask = task.SubTasks.getTask(i);
|
1446
|
-
this.SetServerSideTaskSuffix(subTask);
|
1447
|
-
}
|
1448
|
-
}
|
1449
|
-
}
|
1450
|
-
async CheckIfClientOperationExistsInSubformTasks(task, eventCode) {
|
1451
|
-
let clientOperationExist = false;
|
1452
|
-
var rtEvt = new RunTimeEvent(task);
|
1453
|
-
rtEvt.setInternal(eventCode);
|
1454
|
-
let handler = null;
|
1455
|
-
var evtHanPos = new EventHandlerPosition();
|
1456
|
-
evtHanPos.init(rtEvt);
|
1457
|
-
handler = evtHanPos.getNext();
|
1458
|
-
if (eventCode == InternalInterface.MG_ACT_REC_SUFFIX) {
|
1459
|
-
let currRecord = task.DataView.getCurrRec();
|
1460
|
-
if (task.DataView.modifiedRecordsNumber() > 0 || (currRecord != null && currRecord.Modified))
|
1461
|
-
clientOperationExist = true;
|
1462
|
-
if (!clientOperationExist) {
|
1463
|
-
let forceSuffix = await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false);
|
1464
|
-
if (forceSuffix === true)
|
1465
|
-
if (task.IsInteractive || task.getMode() !== Constants.TASK_MODE_CREATE)
|
1466
|
-
clientOperationExist = true;
|
1467
|
-
}
|
1468
|
-
}
|
1469
|
-
if (handler != null && !clientOperationExist) {
|
1470
|
-
let cnt = handler.getOperationTab().getSize();
|
1471
|
-
for (let i = 0; i < cnt; i++) {
|
1472
|
-
let oper = handler.getOperationTab().getOperation(i);
|
1473
|
-
if (oper.getExecOnClient()) {
|
1474
|
-
clientOperationExist = true;
|
1475
|
-
break;
|
1476
|
-
}
|
1477
|
-
else {
|
1478
|
-
if (oper.getType() == ConstInterface.MG_OPER_RAISE_EVENT) {
|
1479
|
-
if (oper.GetRuntimeEvent().getType() == ConstInterface.EVENT_TYPE_INTERNAL &&
|
1480
|
-
oper.GetRuntimeEvent().getInternalCode() === InternalInterface.MG_ACT_RT_REFRESH_VIEW) {
|
1481
|
-
clientOperationExist = true;
|
1482
|
-
break;
|
1483
|
-
}
|
1484
|
-
}
|
1485
|
-
}
|
1486
|
-
}
|
1487
|
-
}
|
1488
|
-
if (!clientOperationExist && task.hasSubTasks()) {
|
1489
|
-
for (let i = 0; (!clientOperationExist && i < task.getSubTasks().getSize()); i++) {
|
1490
|
-
let subTask = task.SubTasks.getTask(i);
|
1491
|
-
clientOperationExist = await this.CheckIfClientOperationExistsInSubformTasks(subTask, eventCode);
|
1492
|
-
}
|
1493
|
-
}
|
1494
|
-
return clientOperationExist;
|
1495
|
-
}
|
1496
|
-
CheckIfPendingTransactions(task) {
|
1497
|
-
let pendingTransactions = false;
|
1498
|
-
let currRecord = task.DataView.getCurrRec();
|
1499
|
-
if (task.DataView.modifiedRecordsNumber() > 0 || (currRecord != null && currRecord.Modified))
|
1500
|
-
pendingTransactions = true;
|
1501
|
-
if (!pendingTransactions && task.hasSubTasks()) {
|
1502
|
-
for (let i = 0; (!pendingTransactions && i < task.getSubTasks().getSize()); i++) {
|
1503
|
-
let subTask = task.SubTasks.getTask(i);
|
1504
|
-
pendingTransactions = this.CheckIfPendingTransactions(subTask);
|
1505
|
-
}
|
1506
|
-
}
|
1507
|
-
return pendingTransactions;
|
1508
|
-
}
|
1509
|
-
HandleTransactionInfo() {
|
1510
|
-
let transaction = this.DataviewManager.RemoteDataviewManager.Transaction;
|
1511
|
-
if (transaction !== null && transaction.isOwner(this) && transaction.getLevel() === 'P') {
|
1512
|
-
this.DataviewManager.RemoteDataviewManager.Transaction = null;
|
1513
|
-
this.DataView.setTransCleared();
|
1514
|
-
}
|
1515
|
-
}
|
1516
|
-
async Exit(reversibleExit, subformDestination) {
|
1517
|
-
let cmd = reversibleExit ?
|
1518
|
-
CommandFactory.CreateBrowserEscEventCommand(this.getTaskTag(), subformDestination) :
|
1519
|
-
CommandFactory.CreateNonReversibleExitCommand(this.getTaskTag(), subformDestination);
|
1520
|
-
this._mgData.CmdsToServer.Add(cmd);
|
1521
|
-
if (!subformDestination) {
|
1522
|
-
try {
|
1523
|
-
if (this.getTaskTag() == MGDataCollection.Instance.StartupMgData.getFirstTask().getTaskTag() ||
|
1524
|
-
!(MGDataCollection.Instance.StartupMgData.getFirstTask().InEndTask && MGDataCollection.Instance.StartupMgData.getFirstTask().ClosingFormUI))
|
1525
|
-
await Task.CommandsProcessor.Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
1526
|
-
}
|
1527
|
-
catch (err) {
|
1528
|
-
if (this.isMainProg()) {
|
1529
|
-
this._mgData.CmdsToServer.Add(cmd);
|
1530
|
-
}
|
1531
|
-
else
|
1532
|
-
throw err;
|
1533
|
-
}
|
1534
|
-
}
|
1535
|
-
}
|
1536
|
-
handleFinallyEndTask(succeeded, reversibleExit) {
|
1537
|
-
let subTask;
|
1538
|
-
if (this.hasSubTasks()) {
|
1539
|
-
for (let i = 0; i < this.SubTasks.getSize(); i++) {
|
1540
|
-
subTask = this.SubTasks.getTask(i);
|
1541
|
-
subTask.handleFinallyEndTask(succeeded, reversibleExit);
|
1542
|
-
}
|
1543
|
-
}
|
1544
|
-
this.InEndTask = false;
|
1545
|
-
if (succeeded)
|
1546
|
-
this._isStarted = false;
|
1547
|
-
if (!succeeded && reversibleExit && this.IsTryingToStop)
|
1548
|
-
this.setTryingToStop(false);
|
1549
|
-
}
|
1550
|
-
async handleTaskSuffix(withSubTasks) {
|
1551
|
-
let succeeded = true;
|
1552
|
-
let subTask;
|
1553
|
-
if (withSubTasks) {
|
1554
|
-
if (this.hasSubTasks()) {
|
1555
|
-
for (let i = 0; i < this.SubTasks.getSize() && succeeded; i++) {
|
1556
|
-
subTask = this.SubTasks.getTask(i);
|
1557
|
-
succeeded = await subTask.handleTaskSuffix(withSubTasks);
|
1558
|
-
}
|
1559
|
-
}
|
1560
|
-
}
|
1561
|
-
if (succeeded)
|
1562
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(this, InternalInterface.MG_ACT_TASK_SUFFIX);
|
1563
|
-
succeeded = !AccessHelper.eventsManager.GetStopExecutionFlag();
|
1564
|
-
this.TaskSuffixExecuted = true;
|
1565
|
-
return succeeded;
|
1566
|
-
}
|
1567
|
-
setInCreateLine(inCreateLine) {
|
1568
|
-
this._inCreateLine = inCreateLine;
|
1569
|
-
}
|
1570
|
-
getInCreateLine() {
|
1571
|
-
return this._inCreateLine;
|
1572
|
-
}
|
1573
|
-
async handleEventOnSlaveTasks(internalEvtCode) {
|
1574
|
-
let i;
|
1575
|
-
let task = null;
|
1576
|
-
let failureTask = null;
|
1577
|
-
let mgdTab = AccessHelper.mgDataTable;
|
1578
|
-
let triggeredTasks = mgdTab.getTriggeredTasks(this);
|
1579
|
-
let orphans = null;
|
1580
|
-
let sameTrans;
|
1581
|
-
let hasSlaves = false;
|
1582
|
-
let isOwner = this.Transaction != null && this.Transaction.isOwner(this);
|
1583
|
-
if (isOwner) {
|
1584
|
-
AccessHelper.eventsManager.setEventScopeTrans();
|
1585
|
-
orphans = new List();
|
1586
|
-
mgdTab.startTasksIteration();
|
1587
|
-
while ((task = mgdTab.getNextTask()) != null) {
|
1588
|
-
sameTrans = task.Transaction != null && this.Transaction.getTransId() === task.Transaction.getTransId();
|
1589
|
-
if (task !== this && sameTrans && task.PreviouslyActiveTaskId != null && mgdTab.GetTaskByID(task.PreviouslyActiveTaskId) == null)
|
1590
|
-
orphans.push(task);
|
1591
|
-
}
|
1592
|
-
}
|
1593
|
-
let scopeTrans = AccessHelper.eventsManager.isEventScopeTrans();
|
1594
|
-
for (i = 0; i < triggeredTasks.length && !AccessHelper.eventsManager.GetStopExecutionFlag(); i++) {
|
1595
|
-
task = triggeredTasks.get_Item(i);
|
1596
|
-
sameTrans = this.Transaction != null && task.Transaction != null && this.Transaction.getTransId() === task.Transaction.getTransId();
|
1597
|
-
if (!task.IsSubForm && (scopeTrans && sameTrans) && task.isStarted()) {
|
1598
|
-
if (task.getForm().FormRefreshed && internalEvtCode === InternalInterface.MG_ACT_REC_PREFIX && task.getLevel() === Constants.TASK_LEVEL_TASK)
|
1599
|
-
await task.DataView.currRecCompute(false);
|
1600
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(task, internalEvtCode);
|
1601
|
-
hasSlaves = true;
|
1602
|
-
}
|
1603
|
-
}
|
1604
|
-
for (; isOwner && i < orphans.length && !AccessHelper.eventsManager.GetStopExecutionFlag(); i++) {
|
1605
|
-
task = orphans.get_Item(i);
|
1606
|
-
if (task.getForm().FormRefreshed && internalEvtCode === InternalInterface.MG_ACT_REC_PREFIX && task.getLevel() === Constants.TASK_LEVEL_TASK)
|
1607
|
-
await task.DataView.currRecCompute(false);
|
1608
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(task, internalEvtCode);
|
1609
|
-
hasSlaves = true;
|
1610
|
-
}
|
1611
|
-
if (hasSlaves && AccessHelper.eventsManager.GetStopExecutionFlag())
|
1612
|
-
failureTask = task;
|
1613
|
-
if (isOwner)
|
1614
|
-
AccessHelper.eventsManager.clearEventScope();
|
1615
|
-
return failureTask;
|
1616
|
-
}
|
1617
|
-
async enableRecordActions() {
|
1618
|
-
let dataview = this.DataView;
|
1619
|
-
await this.setCreateDeleteActsEnableState();
|
1620
|
-
if (dataview.IncludesFirst() || dataview.IsOneWayKey) {
|
1621
|
-
if (dataview.isEmptyDataview() || dataview.getCurrRecIdx() === 0) {
|
1622
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVLINE, false);
|
1623
|
-
if (dataview.IsOneWayKey)
|
1624
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_BEGTBL, true);
|
1625
|
-
else
|
1626
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_BEGTBL, false);
|
1627
|
-
if (this.Form.isScreenMode())
|
1628
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVPAGE, false);
|
1629
|
-
}
|
1630
|
-
else {
|
1631
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVLINE, true);
|
1632
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_BEGTBL, true);
|
1633
|
-
if (this.Form.isScreenMode())
|
1634
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVPAGE, true);
|
1635
|
-
}
|
1636
|
-
if (!this.Form.isScreenMode())
|
1637
|
-
if (dataview.isEmptyDataview() || (dataview.getCurrRecIdx() === 0) || (dataview.getTopRecIdx() === 0))
|
1638
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVPAGE, false);
|
1639
|
-
else
|
1640
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVPAGE, true);
|
1641
|
-
}
|
1642
|
-
else {
|
1643
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_BEGTBL, true);
|
1644
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVPAGE, true);
|
1645
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_PRVLINE, true);
|
1646
|
-
}
|
1647
|
-
if (dataview.IncludesLast()) {
|
1648
|
-
if (((this.getMode() === Constants.TASK_MODE_QUERY) || dataview.isEmptyDataview() ||
|
1649
|
-
((this.getMode() === Constants.TASK_MODE_MODIFY) &&
|
1650
|
-
(!Environment.Instance.allowCreateInModifyMode(this.getCompIdx()) ||
|
1651
|
-
!await this.checkProp(PropInterface.PROP_TYPE_ALLOW_CREATE, true)))) && (dataview.getCurrRecIdx() + 1) === dataview.getSize()) {
|
1652
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTLINE, false);
|
1653
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_ENDTBL, false);
|
1654
|
-
if (this.Form.isScreenMode())
|
1655
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTPAGE, false);
|
1656
|
-
}
|
1657
|
-
else {
|
1658
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTLINE, true);
|
1659
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_ENDTBL, true);
|
1660
|
-
if (this.Form.isScreenMode())
|
1661
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTPAGE, true);
|
1662
|
-
}
|
1663
|
-
if (!this.Form.isScreenMode()) {
|
1664
|
-
if (dataview.isEmptyDataview() || ((dataview.getSize() - dataview.getTopRecIdx()) <= this.Form.getRowsInPage()))
|
1665
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTPAGE, false);
|
1666
|
-
else
|
1667
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTPAGE, true);
|
1668
|
-
}
|
1669
|
-
}
|
1670
|
-
else {
|
1671
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTLINE, true);
|
1672
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_NXTPAGE, true);
|
1673
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_TBL_ENDTBL, true);
|
1674
|
-
}
|
1675
|
-
if (dataview.isEmptyDataview())
|
1676
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_CANCEL, false);
|
1677
|
-
else
|
1678
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_CANCEL, true);
|
1679
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_ENTER_ROW_EDITING, true);
|
1680
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_NO_PROG_EXE_RIGHTS, true);
|
1681
|
-
}
|
1682
|
-
isStarted() {
|
1683
|
-
return this._isStarted;
|
1684
|
-
}
|
1685
|
-
getSubTasks() {
|
1686
|
-
return this.SubTasks;
|
1687
|
-
}
|
1688
|
-
refreshesOn(fldId) {
|
1689
|
-
let result = false;
|
1690
|
-
for (let i = 0; !result && this.RefreshOnVars !== null && i < this.RefreshOnVars.length; i++) {
|
1691
|
-
result = (this.RefreshOnVars[i] === fldId);
|
1692
|
-
}
|
1693
|
-
return result;
|
1694
|
-
}
|
1695
|
-
AbortTransaction() {
|
1696
|
-
this.DataviewManager.RemoteDataviewManager.Transaction = null;
|
1697
|
-
}
|
1698
|
-
setPreventRecordSuffix(val) {
|
1699
|
-
this._preventRecordSuffix = val;
|
1700
|
-
}
|
1701
|
-
getPreventRecordSuffix() {
|
1702
|
-
return this._preventRecordSuffix;
|
1703
|
-
}
|
1704
|
-
setPreventControlChange(val) {
|
1705
|
-
this._preventControlChange = val;
|
1706
|
-
}
|
1707
|
-
getPreventControlChange() {
|
1708
|
-
return this._preventControlChange;
|
1709
|
-
}
|
1710
|
-
resetKnownToServer() {
|
1711
|
-
this._knownToServer = false;
|
1712
|
-
}
|
1713
|
-
evaluateDescriptor() {
|
1714
|
-
let result = "";
|
1715
|
-
let res;
|
1716
|
-
if (this.DvPosDescriptor == null)
|
1717
|
-
return HashUtils.GetHashCode(result);
|
1718
|
-
let first = true;
|
1719
|
-
for (let i = 0; i < this.DvPosDescriptor.length; i++) {
|
1720
|
-
if (!first)
|
1721
|
-
result += ";";
|
1722
|
-
let currentCell = this.DvPosDescriptor.get_Item(i);
|
1723
|
-
let currentTag = currentCell[0];
|
1724
|
-
let currentVeeIdx = NNumber.Parse(currentCell[1]);
|
1725
|
-
let currentTask = AccessHelper.mgDataTable.GetTaskByID(currentTag);
|
1726
|
-
let currentField = currentTask.DataView.getField(currentVeeIdx);
|
1727
|
-
let dispVal = currentField.getDispValue();
|
1728
|
-
if (currentField.isNull())
|
1729
|
-
dispVal = "";
|
1730
|
-
let pic;
|
1731
|
-
switch (currentField.getType()) {
|
1732
|
-
case StorageAttribute.BOOLEAN:
|
1733
|
-
case StorageAttribute.ALPHA:
|
1734
|
-
case StorageAttribute.UNICODE:
|
1735
|
-
case StorageAttribute.BLOB:
|
1736
|
-
case StorageAttribute.BLOB_VECTOR:
|
1737
|
-
result += dispVal;
|
1738
|
-
break;
|
1739
|
-
case StorageAttribute.DATE:
|
1740
|
-
case StorageAttribute.TIME:
|
1741
|
-
if (dispVal !== "") {
|
1742
|
-
pic = new PIC(currentField.getPicture(), currentField.getType(), 0);
|
1743
|
-
let conv = DisplayConvertor.Instance;
|
1744
|
-
result += conv.mg2disp(dispVal, "", pic, false, this.getCompIdx(), false);
|
1745
|
-
}
|
1746
|
-
break;
|
1747
|
-
case StorageAttribute.NUMERIC:
|
1748
|
-
if (dispVal !== "") {
|
1749
|
-
res = new NUM_TYPE(dispVal);
|
1750
|
-
pic = new PIC(currentField.getPicture(), currentField.getType(), 0);
|
1751
|
-
result += res.to_a(pic);
|
1752
|
-
}
|
1753
|
-
break;
|
1754
|
-
}
|
1755
|
-
first = false;
|
1756
|
-
}
|
1757
|
-
let tmpStr2 = StrUtil.stringToHexaDump(result, 4);
|
1758
|
-
return HashUtils.GetHashCode(tmpStr2);
|
1759
|
-
}
|
1760
|
-
setDescriptor(newDesc) {
|
1761
|
-
if (!(newDesc.trim() === "")) {
|
1762
|
-
let desc = StrUtil.tokenize(newDesc, ";");
|
1763
|
-
this.DvPosDescriptor = new List();
|
1764
|
-
for (let i = 0; i < desc.length; i = i + 1) {
|
1765
|
-
let cell = new Array(2);
|
1766
|
-
let tagVeePair = StrUtil.tokenize(desc[i], ",");
|
1767
|
-
cell[0] = tagVeePair[0];
|
1768
|
-
cell[1] = tagVeePair[1];
|
1769
|
-
this.DvPosDescriptor.push(cell);
|
1770
|
-
}
|
1771
|
-
}
|
1772
|
-
}
|
1773
|
-
getTaskCache() {
|
1774
|
-
return this._dvCache;
|
1775
|
-
}
|
1776
|
-
async prepareCache(ignoreCurr) {
|
1777
|
-
let success = true;
|
1778
|
-
if (!ignoreCurr) {
|
1779
|
-
if (await this.isCached()) {
|
1780
|
-
if (this.DataView.getChanged()) {
|
1781
|
-
this._dvCache.removeDvFromCache(this.DataView.getDvPosValue(), true);
|
1782
|
-
success = false;
|
1783
|
-
}
|
1784
|
-
}
|
1785
|
-
else {
|
1786
|
-
if (this.IsSubForm && !await this.isCached()) {
|
1787
|
-
success = false;
|
1788
|
-
}
|
1789
|
-
}
|
1790
|
-
}
|
1791
|
-
let curretTask;
|
1792
|
-
if (this.hasSubTasks()) {
|
1793
|
-
for (let i = 0; i < this.SubTasks.getSize(); i = i + 1) {
|
1794
|
-
curretTask = this.SubTasks.getTask(i);
|
1795
|
-
if (!await curretTask.prepareCache(false)) {
|
1796
|
-
success = false;
|
1797
|
-
}
|
1798
|
-
}
|
1799
|
-
}
|
1800
|
-
return success;
|
1801
|
-
}
|
1802
|
-
async testAndSet(ignoreCurr) {
|
1803
|
-
if (!ignoreCurr && await this.isCached()) {
|
1804
|
-
let requestedDv = this.evaluateDescriptor();
|
1805
|
-
if (requestedDv !== this.DataView.getDvPosValue()) {
|
1806
|
-
let fromCache = this._dvCache.getCachedDataView(requestedDv);
|
1807
|
-
if (fromCache == null)
|
1808
|
-
return false;
|
1809
|
-
await this.changeDv(fromCache);
|
1810
|
-
}
|
1811
|
-
this.DoSubformPrefixSuffix = true;
|
1812
|
-
}
|
1813
|
-
if (this.hasSubTasks()) {
|
1814
|
-
for (let i = 0; i < this.SubTasks.getSize(); i++) {
|
1815
|
-
if (!await this.SubTasks.getTask(i).testAndSet(false))
|
1816
|
-
return false;
|
1817
|
-
}
|
1818
|
-
}
|
1819
|
-
return true;
|
1820
|
-
}
|
1821
|
-
async changeDv(fromCache) {
|
1822
|
-
let dataview = this.DataView;
|
1823
|
-
if (!this.hasLocate) {
|
1824
|
-
if (!dataview.getChanged() && dataview.IncludesFirst())
|
1825
|
-
this._dvCache.putInCache(dataview.replicate());
|
1826
|
-
}
|
1827
|
-
else
|
1828
|
-
this.locatePutInCache();
|
1829
|
-
await dataview.setSameAs(fromCache);
|
1830
|
-
dataview.takeFldValsFromCurrRec();
|
1831
|
-
this.Form.SetTableItemsCount(0, true);
|
1832
|
-
this.Form.setTableItemsCount(false);
|
1833
|
-
await this.Form.RefreshDisplay(Constants.TASK_REFRESH_FORM);
|
1834
|
-
this.setOriginalTaskMode(this.getMode());
|
1835
|
-
}
|
1836
|
-
setOriginalTaskMode(originalTaskMode) {
|
1837
|
-
this._originalTaskMode = originalTaskMode.charAt(0);
|
1838
|
-
}
|
1839
|
-
getOriginalTaskMode() {
|
1840
|
-
return this._originalTaskMode;
|
1841
|
-
}
|
1842
|
-
async isCached() {
|
1843
|
-
return this.IsSubForm && await this.Form.getSubFormCtrl().checkProp(PropInterface.PROP_TYPE_IS_CACHED, false);
|
1844
|
-
}
|
1845
|
-
locatePutInCache() {
|
1846
|
-
let cached = this._dvCache.getCachedDataView(this.DataView.getDvPosValue());
|
1847
|
-
if (cached != null) {
|
1848
|
-
if (this.DataView.checkFirst(cached.getLocateFirstRec()) && !this.DataView.getChanged()) {
|
1849
|
-
this.DataView.setLocateFirstRec(cached.getLocateFirstRec());
|
1850
|
-
this._dvCache.putInCache(this.DataView.replicate());
|
1851
|
-
}
|
1852
|
-
else
|
1853
|
-
this._dvCache.removeDvFromCache(this.DataView.getDvPosValue(), true);
|
1854
|
-
}
|
1855
|
-
else {
|
1856
|
-
if (!this.DataView.getChanged())
|
1857
|
-
this._dvCache.putInCache(this.DataView.replicate());
|
1858
|
-
}
|
1859
|
-
}
|
1860
|
-
HasLoacte() {
|
1861
|
-
return this.hasLocate;
|
1862
|
-
}
|
1863
|
-
setRemoteTransaction(transId) {
|
1864
|
-
let mgdTab = AccessHelper.mgDataTable;
|
1865
|
-
let transTask;
|
1866
|
-
let isFind = false;
|
1867
|
-
mgdTab.startTasksIteration();
|
1868
|
-
while ((transTask = mgdTab.getNextTask()) != null) {
|
1869
|
-
if (transTask.DataviewManager.RemoteDataviewManager.Transaction != null &&
|
1870
|
-
transTask.DataviewManager.RemoteDataviewManager.Transaction.getTransId() === transId) {
|
1871
|
-
isFind = true;
|
1872
|
-
break;
|
1873
|
-
}
|
1874
|
-
}
|
1875
|
-
this.DataviewManager.RemoteDataviewManager.Transaction = (isFind ?
|
1876
|
-
transTask.DataviewManager.RemoteDataviewManager.Transaction :
|
1877
|
-
new Transaction(this, transId));
|
1878
|
-
}
|
1879
|
-
setTransOwnerTask() {
|
1880
|
-
this.Transaction.setOwnerTask(this);
|
1881
|
-
this.Transaction.setTransBegin('T');
|
1882
|
-
}
|
1883
|
-
getLoopCounter() {
|
1884
|
-
let result = 0;
|
1885
|
-
if (this._useLoopStack && this._loopStack !== null && !(this._loopStack.count() === 0)) {
|
1886
|
-
result = this._loopStack.peek();
|
1887
|
-
}
|
1888
|
-
return result;
|
1889
|
-
}
|
1890
|
-
enterLoop() {
|
1891
|
-
if (this._loopStack === null)
|
1892
|
-
this._loopStack = new Stack();
|
1893
|
-
this._loopStack.push(0);
|
1894
|
-
}
|
1895
|
-
leaveLoop() {
|
1896
|
-
this.popLoopCounter();
|
1897
|
-
}
|
1898
|
-
popLoopCounter() {
|
1899
|
-
let result = 0;
|
1900
|
-
if (this._loopStack !== null && !(this._loopStack.count() === 0))
|
1901
|
-
result = this._loopStack.pop();
|
1902
|
-
return result;
|
1903
|
-
}
|
1904
|
-
increaseLoopCounter() {
|
1905
|
-
this._loopStack.push(this.popLoopCounter() + 1);
|
1906
|
-
}
|
1907
|
-
getLoopStackSize() {
|
1908
|
-
if (this._loopStack !== null)
|
1909
|
-
return this._loopStack.count();
|
1910
|
-
return 0;
|
1911
|
-
}
|
1912
|
-
setUseLoopStack(val) {
|
1913
|
-
this._useLoopStack = val;
|
1914
|
-
}
|
1915
|
-
getDataviewHeaders() {
|
1916
|
-
return this.DataviewHeadersTable;
|
1917
|
-
}
|
1918
|
-
isFirstRecordCycle(Value_) {
|
1919
|
-
if (arguments.length === 0) {
|
1920
|
-
return this.isFirstRecordCycle_0();
|
1921
|
-
}
|
1922
|
-
return this.isFirstRecordCycle_1(Value_);
|
1923
|
-
}
|
1924
|
-
isFirstRecordCycle_0() {
|
1925
|
-
return this._firstRecordCycle;
|
1926
|
-
}
|
1927
|
-
isFirstRecordCycle_1(Value_) {
|
1928
|
-
this._firstRecordCycle = Value_;
|
1929
|
-
}
|
1930
|
-
getPublicName() {
|
1931
|
-
return this.PublicName;
|
1932
|
-
}
|
1933
|
-
async isAllowEvents() {
|
1934
|
-
let prop = this.getProp(PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS);
|
1935
|
-
return await prop.getValueBoolean();
|
1936
|
-
}
|
1937
|
-
getExternalTaskId() {
|
1938
|
-
let taskId = "";
|
1939
|
-
let prop = this.getProp(PropInterface.PROP_TYPE_TASK_ID);
|
1940
|
-
if (prop != null)
|
1941
|
-
taskId = prop.GetComputedValue();
|
1942
|
-
return taskId;
|
1943
|
-
}
|
1944
|
-
isTransactionOwner() {
|
1945
|
-
let isTransOwner = false;
|
1946
|
-
if (this.Transaction != null && this.Transaction.isOwner(this))
|
1947
|
-
isTransOwner = true;
|
1948
|
-
return isTransOwner;
|
1949
|
-
}
|
1950
|
-
isTransactionOnLevel(level) {
|
1951
|
-
return this.isTransactionOwner() && this.Transaction.getLevel() === level;
|
1952
|
-
}
|
1953
|
-
isProgram() {
|
1954
|
-
return this._isPrg;
|
1955
|
-
}
|
1956
|
-
async enableModes() {
|
1957
|
-
let enable = await this.checkProp(PropInterface.PROP_TYPE_ALLOW_MODIFY, true);
|
1958
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_RTO_MODIFY, enable);
|
1959
|
-
enable = await this.checkProp(PropInterface.PROP_TYPE_ALLOW_CREATE, true);
|
1960
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_RTO_CREATE, enable);
|
1961
|
-
enable = await this.checkProp(PropInterface.PROP_TYPE_ALLOW_QUERY, true);
|
1962
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_RTO_QUERY, enable);
|
1963
|
-
enable = await this.checkProp(PropInterface.PROP_TYPE_ALLOW_RANGE, true);
|
1964
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_RTO_RANGE, enable);
|
1965
|
-
enable = await this.checkProp(PropInterface.PROP_TYPE_ALLOW_LOCATE, true);
|
1966
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_RTO_LOCATE, enable);
|
1967
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_RTO_SEARCH, enable);
|
1968
|
-
enable = await this.checkProp(PropInterface.PROP_TYPE_ALLOW_SORT, true);
|
1969
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_SORT_RECORDS, enable);
|
1970
|
-
enable = await this.checkProp(PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX, true);
|
1971
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_VIEW_BY_KEY, enable);
|
1972
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_DUMP_ENVIRONMENT, true);
|
1973
|
-
}
|
1974
|
-
setEnableZoomHandler() {
|
1975
|
-
this._enableZoomHandler = true;
|
1976
|
-
}
|
1977
|
-
getEnableZoomHandler() {
|
1978
|
-
return this._enableZoomHandler;
|
1979
|
-
}
|
1980
|
-
isDestinationSubform() {
|
1981
|
-
return this._destinationSubform;
|
1982
|
-
}
|
1983
|
-
setDestinationSubform(destinationSubform) {
|
1984
|
-
this._destinationSubform = destinationSubform;
|
1985
|
-
}
|
1986
|
-
getIsDestinationCall() {
|
1987
|
-
return this._isDestinationCall;
|
1988
|
-
}
|
1989
|
-
setIsDestinationCall(isDestinationCall) {
|
1990
|
-
this._isDestinationCall = isDestinationCall;
|
1991
|
-
}
|
1992
|
-
setCancelWasRaised(val) {
|
1993
|
-
this._cancelWasRaised = val;
|
1994
|
-
}
|
1995
|
-
cancelWasRaised() {
|
1996
|
-
return this._cancelWasRaised;
|
1997
|
-
}
|
1998
|
-
enableCreateActs(val) {
|
1999
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_CRELINE, val);
|
2000
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_CRELINE_ABOVE, (this.getForm().HasTable()) ? val : false);
|
2001
|
-
}
|
2002
|
-
async setCreateDeleteActsEnableState() {
|
2003
|
-
if (!(this.DataView).isEmptyDataview() && await this.checkProp(PropInterface.PROP_TYPE_ALLOW_DELETE, true) &&
|
2004
|
-
this.getMode() === Constants.TASK_MODE_MODIFY && this.DataView.HasMainTable)
|
2005
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_DELLINE, true);
|
2006
|
-
else
|
2007
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_DELLINE, false);
|
2008
|
-
if ((await this.checkProp(PropInterface.PROP_TYPE_ALLOW_CREATE, true)) &&
|
2009
|
-
(this.DataView.HasMainTable &&
|
2010
|
-
(this.getMode() === Constants.TASK_MODE_MODIFY && Environment.Instance.allowCreateInModifyMode(this.getCompIdx())) ||
|
2011
|
-
(this.getMode() === Constants.TASK_MODE_CREATE)))
|
2012
|
-
this.enableCreateActs(true);
|
2013
|
-
else
|
2014
|
-
this.enableCreateActs(false);
|
2015
|
-
}
|
2016
|
-
setEmptyDataview(emptyDataview) {
|
2017
|
-
this.DataView.setEmptyDataview(emptyDataview);
|
2018
|
-
}
|
2019
|
-
getName() {
|
2020
|
-
return this.Name;
|
2021
|
-
}
|
2022
|
-
async emptyDataviewOpen(subformRefresh) {
|
2023
|
-
if (this.getLevel() === Constants.TASK_LEVEL_TASK) {
|
2024
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_EMPTY_DATAVIEW, true);
|
2025
|
-
if (this.IsSubForm) {
|
2026
|
-
let rtEvnt = AccessHelper.eventsManager.getLastRtEvent();
|
2027
|
-
if ((rtEvnt != null && rtEvnt.getInternalCode() == InternalInterface.MG_ACT_RT_REFRESH_VIEW) || subformRefresh) {
|
2028
|
-
let rtEvt = new RunTimeEvent(this);
|
2029
|
-
rtEvt.setInternal(InternalInterface.MG_ACT_EMPTY_DATAVIEW);
|
2030
|
-
rtEvt.SetEventSubType(EventSubType.Normal);
|
2031
|
-
await AccessHelper.eventsManager.handleEvent(rtEvt, false);
|
2032
|
-
}
|
2033
|
-
}
|
2034
|
-
else
|
2035
|
-
AccessHelper.eventsManager.addInternalEventWithItaskAndCode(this, InternalInterface.MG_ACT_EMPTY_DATAVIEW);
|
2036
|
-
this.setLevel(Constants.TASK_LEVEL_RECORD);
|
2037
|
-
if (this.SubformExecMode !== Task_SubformExecModeEnum.FIRST_TIME && subformRefresh && await this.CheckRefreshSubTasks()) {
|
2038
|
-
await this.DataView.computeSubForms();
|
2039
|
-
await this.doSubformRecPrefixSuffix();
|
2040
|
-
}
|
2041
|
-
await this.enableRecordActions();
|
2042
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_RT_REFRESH_RECORD, false);
|
2043
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_RT_REFRESH_SCREEN, false);
|
2044
|
-
}
|
2045
|
-
}
|
2046
|
-
emptyDataviewClose() {
|
2047
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_EMPTY_DATAVIEW, false);
|
2048
|
-
this.setLevel(Constants.TASK_LEVEL_TASK);
|
2049
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_RT_REFRESH_RECORD, true);
|
2050
|
-
this.ActionManager.enable(InternalInterface.MG_ACT_RT_REFRESH_SCREEN, true);
|
2051
|
-
}
|
2052
|
-
async SubformRefresh(subformTask, explicitSubformRefresh) {
|
2053
|
-
let currTask = LastFocusedManager.Instance.getLastFocusedTask();
|
2054
|
-
let isInside = await subformTask.ExecuteNestedRS(currTask);
|
2055
|
-
if (AccessHelper.eventsManager.GetStopExecutionFlag())
|
2056
|
-
return;
|
2057
|
-
if (subformTask.getLevel() !== Constants.TASK_LEVEL_TASK && !AccessHelper.eventsManager.GetStopExecutionFlag()) {
|
2058
|
-
AccessHelper.eventsManager.pushNewExecStacks();
|
2059
|
-
await AccessHelper.eventsManager.handleInternalEventWithTaskAndSubformRefresh(subformTask, InternalInterface.MG_ACT_REC_SUFFIX, true);
|
2060
|
-
AccessHelper.eventsManager.popNewExecStacks();
|
2061
|
-
isInside = true;
|
2062
|
-
if (AccessHelper.eventsManager.GetStopExecutionFlag())
|
2063
|
-
return;
|
2064
|
-
}
|
2065
|
-
let cmd = CommandFactory.CreateSubformRefreshCommand(this.getTaskTag(), subformTask.getTaskTag(), explicitSubformRefresh);
|
2066
|
-
await subformTask.DataviewManager.Execute(cmd);
|
2067
|
-
if (subformTask.isAborting())
|
2068
|
-
return;
|
2069
|
-
if (explicitSubformRefresh) {
|
2070
|
-
AccessHelper.eventsManager.pushNewExecStacks();
|
2071
|
-
let performParentRecordPrefixOrg = subformTask.PerformParentRecordPrefix;
|
2072
|
-
subformTask.PerformParentRecordPrefix = false;
|
2073
|
-
await AccessHelper.eventsManager.handleInternalEventWithTaskAndSubformRefresh(subformTask, InternalInterface.MG_ACT_REC_PREFIX, true);
|
2074
|
-
subformTask.PerformParentRecordPrefix = performParentRecordPrefixOrg;
|
2075
|
-
AccessHelper.eventsManager.popNewExecStacks();
|
2076
|
-
if (AccessHelper.eventsManager.GetStopExecutionFlag())
|
2077
|
-
return;
|
2078
|
-
}
|
2079
|
-
if (isInside) {
|
2080
|
-
}
|
2081
|
-
else {
|
2082
|
-
if (!AccessHelper.eventsManager.GetStopExecutionFlag()) {
|
2083
|
-
if (explicitSubformRefresh) {
|
2084
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(subformTask, InternalInterface.MG_ACT_REC_SUFFIX);
|
2085
|
-
if (currTask != null)
|
2086
|
-
currTask.DataView.setPrevCurrRec();
|
2087
|
-
subformTask.DoSubformPrefixSuffix = false;
|
2088
|
-
}
|
2089
|
-
}
|
2090
|
-
}
|
2091
|
-
}
|
2092
|
-
async ExecuteNestedRS(lastTask) {
|
2093
|
-
let isExecuteNestedRS = false;
|
2094
|
-
if (lastTask == null)
|
2095
|
-
return isExecuteNestedRS;
|
2096
|
-
if (this.getLevel() !== Constants.TASK_LEVEL_TASK && lastTask.getMgdID() !== this.getMgdID())
|
2097
|
-
return isExecuteNestedRS;
|
2098
|
-
for (let task = lastTask; task !== this && task.pathContains(this) && task.getLevel() !== Constants.TASK_LEVEL_TASK; task = task.getParent()) {
|
2099
|
-
AccessHelper.eventsManager.pushNewExecStacks();
|
2100
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
2101
|
-
AccessHelper.eventsManager.popNewExecStacks();
|
2102
|
-
isExecuteNestedRS = true;
|
2103
|
-
}
|
2104
|
-
return isExecuteNestedRS;
|
2105
|
-
}
|
2106
|
-
async execSubformRecSuffix(newTask) {
|
2107
|
-
let subfTask;
|
2108
|
-
let i, idx = 0;
|
2109
|
-
for (i = this._taskPath.length; i > 0; i--) {
|
2110
|
-
subfTask = this._taskPath.get_Item(i - 1);
|
2111
|
-
if (!newTask._taskPath.Contains(subfTask)) {
|
2112
|
-
await AccessHelper.eventsManager.handleInternalEventWithTask(subfTask, InternalInterface.MG_ACT_REC_SUFFIX);
|
2113
|
-
if (AccessHelper.eventsManager.GetStopExecutionFlag())
|
2114
|
-
break;
|
2115
|
-
if (subfTask.getMode() === Constants.TASK_MODE_CREATE && !(subfTask.DataView.getCurrRec()).isNewRec())
|
2116
|
-
subfTask.setMode(Constants.TASK_MODE_MODIFY);
|
2117
|
-
}
|
2118
|
-
else {
|
2119
|
-
idx = newTask._taskPath.indexOf(subfTask);
|
2120
|
-
break;
|
2121
|
-
}
|
2122
|
-
}
|
2123
|
-
Debug.Assert(i > 0);
|
2124
|
-
return idx;
|
2125
|
-
}
|
2126
|
-
getCounter() {
|
2127
|
-
return this._counter;
|
2128
|
-
}
|
2129
|
-
increaseCounter() {
|
2130
|
-
this._counter = this._counter + 1;
|
2131
|
-
}
|
2132
|
-
setCounter(cnt) {
|
2133
|
-
this._counter = cnt;
|
2134
|
-
}
|
2135
|
-
isCurrentStartProgLevel() {
|
2136
|
-
return this._currStartProgLevel === Task.StartProgLevel;
|
2137
|
-
}
|
2138
|
-
static isMainProgramField(fieldStr) {
|
2139
|
-
let Field = XmlParser.getTokens(fieldStr, ',');
|
2140
|
-
let mainProgField = false;
|
2141
|
-
if (Field.length === 2) {
|
2142
|
-
let parent = NNumber.Parse(Field.get_Item(0));
|
2143
|
-
if (parent === TaskBase.MAIN_PRG_PARENT_ID)
|
2144
|
-
mainProgField = true;
|
2145
|
-
}
|
2146
|
-
return mainProgField;
|
2147
|
-
}
|
2148
|
-
getTaskInfo() {
|
2149
|
-
let taskName = (this.getProp(PropInterface.PROP_TYPE_NAME)).GetComputedValue();
|
2150
|
-
return NString.Format('{0} {1}', this.isProgram() ? 'Program' : 'Subtask', taskName);
|
2151
|
-
}
|
2152
|
-
toString() {
|
2153
|
-
return NString.Format("(task {0}-\"{1}\"{2})", this._taskTag, this.Name, super.isMainProg() ? (" ctl " + this._ctlIdx) : "");
|
2154
|
-
}
|
2155
|
-
ConstructMgForm(alreadySetParentForm) {
|
2156
|
-
let form = new MgForm();
|
2157
|
-
let parentForm = (this.ParentTask != null ? this.ParentTask.getForm() : null);
|
2158
|
-
while (parentForm != null && !parentForm.getTask().isOpenWin()) {
|
2159
|
-
parentForm = parentForm.ParentForm;
|
2160
|
-
}
|
2161
|
-
form.ParentForm = parentForm;
|
2162
|
-
alreadySetParentForm.value = true;
|
2163
|
-
return form;
|
2164
|
-
}
|
2165
|
-
getMgdID() {
|
2166
|
-
return this._mgData.GetId();
|
2167
|
-
}
|
2168
|
-
getMGData() {
|
2169
|
-
return this._mgData;
|
2170
|
-
}
|
2171
|
-
async RefreshDisplay() {
|
2172
|
-
if (this.Form !== null && !this.isAborting() && this.isStarted()) {
|
2173
|
-
Logger.Instance.WriteDevToLog("Start task.RefreshDisplay()");
|
2174
|
-
if (this._refreshType !== Constants.TASK_REFRESH_NONE) {
|
2175
|
-
let form = this.Form;
|
2176
|
-
let wasRefreshed = await form.RefreshDisplay(Constants.TASK_REFRESH_FORM);
|
2177
|
-
if (wasRefreshed) {
|
2178
|
-
this._refreshType = Constants.TASK_REFRESH_NONE;
|
2179
|
-
}
|
2180
|
-
}
|
2181
|
-
Logger.Instance.WriteDevToLog("End task.RefreshDisplay()");
|
2182
|
-
}
|
2183
|
-
}
|
2184
|
-
getFieldDisplayValue(fieldDef, value, isNull) {
|
2185
|
-
value.value = fieldDef.getDispValue();
|
2186
|
-
isNull.value = fieldDef.isNull();
|
2187
|
-
}
|
2188
|
-
async UpdateFieldValueAndStartRecompute(fieldDef, value, isNull) {
|
2189
|
-
if (this.TaskPrefixExecuted) {
|
2190
|
-
await fieldDef.setValueAndStartRecompute(value, isNull, true, false, false);
|
2191
|
-
}
|
2192
|
-
}
|
2193
|
-
ShouldNonInteractiveChildBeModal() {
|
2194
|
-
return this.ShouldChildBeModal();
|
2195
|
-
}
|
2196
|
-
ShouldChildBeModal() {
|
2197
|
-
let childShouldBehaveAsModal = false;
|
2198
|
-
if ((this.Form.ConcreteWindowType === WindowType.Overlay) && this.getForm().Opened)
|
2199
|
-
childShouldBehaveAsModal = true;
|
2200
|
-
else if (!this.IsInteractive) {
|
2201
|
-
childShouldBehaveAsModal = true;
|
2202
|
-
}
|
2203
|
-
return childShouldBehaveAsModal;
|
2204
|
-
}
|
2205
|
-
getParent() {
|
2206
|
-
return this._parentTask;
|
2207
|
-
}
|
2208
|
-
isDescendentOf(chkTask) {
|
2209
|
-
if (chkTask === this)
|
2210
|
-
return true;
|
2211
|
-
else if (chkTask === null || this._parentTask === null)
|
2212
|
-
return false;
|
2213
|
-
return this._parentTask.isDescendentOf(chkTask);
|
2214
|
-
}
|
2215
|
-
GetSubformModalParentTask() {
|
2216
|
-
let currTask = this;
|
2217
|
-
while (currTask._parentTask != null && currTask._parentTask.getIsDestinationCall()) {
|
2218
|
-
let subformCtrl = (currTask._parentTask.getForm().getSubFormCtrl());
|
2219
|
-
if (subformCtrl.IsModal()) {
|
2220
|
-
return subformCtrl;
|
2221
|
-
}
|
2222
|
-
currTask = currTask._parentTask;
|
2223
|
-
}
|
2224
|
-
return null;
|
2225
|
-
}
|
2226
|
-
ShouldEvaluatePropertyLocally(propId) {
|
2227
|
-
return this.TaskService.ShouldEvaluatePropertyLocally(propId);
|
2228
|
-
}
|
2229
|
-
EnsureValidForm() {
|
2230
|
-
if (this._isMainPrg && this.Form !== null) {
|
2231
|
-
if (!this._openWin || !this.Form.isLegalForm) {
|
2232
|
-
this.Form = null;
|
2233
|
-
}
|
2234
|
-
}
|
2235
|
-
}
|
2236
|
-
async ComputeMainDisplay() {
|
2237
|
-
let propMainDisplay = this.getProp(PropInterface.PROP_TYPE_MAIN_DISPLAY);
|
2238
|
-
let mainDisplayIndex = await propMainDisplay.getValueInt();
|
2239
|
-
mainDisplayIndex = this.GetRealMainDisplayIndexOnCurrentTask(mainDisplayIndex);
|
2240
|
-
this._forms.InitFormFromXmlString(mainDisplayIndex);
|
2241
|
-
this.EnsureValidForm();
|
2242
|
-
}
|
2243
|
-
async PrepareTaskForm() {
|
2244
|
-
await TaskServiceBase.PreparePropOpenTaskWindow(this);
|
2245
|
-
return await RemoteTaskService.PreparePropMainDisplay(this);
|
2246
|
-
}
|
2247
|
-
FormIsLegal() {
|
2248
|
-
let isFormIsLegal = super.isMainProg();
|
2249
|
-
return isFormIsLegal || super.getForm().isLegalForm;
|
2250
|
-
}
|
2251
|
-
GetRealMainDisplayIndexOnDepth(mainDspIdx) {
|
2252
|
-
let task = this.LogicalStudioParentTask;
|
2253
|
-
while (task != null) {
|
2254
|
-
mainDspIdx += task._forms.Count;
|
2255
|
-
task = task.LogicalStudioParentTask;
|
2256
|
-
}
|
2257
|
-
return mainDspIdx;
|
2258
|
-
}
|
2259
|
-
GetRealMainDisplayIndexOnCurrentTask(mainDspIdx) {
|
2260
|
-
if (mainDspIdx > 1) {
|
2261
|
-
let task = this.LogicalStudioParentTask;
|
2262
|
-
while (task != null) {
|
2263
|
-
mainDspIdx -= task._forms.Count;
|
2264
|
-
task = task.LogicalStudioParentTask;
|
2265
|
-
}
|
2266
|
-
}
|
2267
|
-
return mainDspIdx;
|
2268
|
-
}
|
2269
|
-
GetAncestorTaskByTaskDefinitionId(findTaskDefinitionId) {
|
2270
|
-
let currentTask = this;
|
2271
|
-
if (findTaskDefinitionId.IsMainProgram())
|
2272
|
-
return GuiDataCollection.MGDataTable.GetMainProgByCtlIdx(this.ContextID, findTaskDefinitionId.CtlIndex);
|
2273
|
-
while (currentTask != null) {
|
2274
|
-
if (currentTask.TaskDefinitionId.Equals(findTaskDefinitionId))
|
2275
|
-
return currentTask;
|
2276
|
-
currentTask = currentTask._parentTask;
|
2277
|
-
}
|
2278
|
-
return null;
|
2279
|
-
}
|
2280
|
-
SetDataControlValuesReference(controlId, dcValuesId) {
|
2281
|
-
let ctrl = super.getForm().getCtrl(controlId);
|
2282
|
-
ctrl.setDcValId(dcValuesId);
|
2283
|
-
}
|
2284
|
-
DisplayMessageToStatusBar(text) {
|
2285
|
-
let taskToVerifyOn = this.GetContextTask();
|
2286
|
-
if (taskToVerifyOn.getForm() == null)
|
2287
|
-
taskToVerifyOn = LastFocusedManager.Instance.getLastFocusedTask();
|
2288
|
-
taskToVerifyOn.WriteToMessagePane(text);
|
2289
|
-
}
|
2290
|
-
isTableWithAbsolutesScrollbar() {
|
2291
|
-
let isTableWithAbsolutesScrollbar = false;
|
2292
|
-
if (this.getForm() != null)
|
2293
|
-
isTableWithAbsolutesScrollbar = this.getForm().isTableWithAbsoluteScrollbar();
|
2294
|
-
return isTableWithAbsolutesScrollbar;
|
2295
|
-
}
|
2296
|
-
GetTaskDetails() {
|
2297
|
-
let names = (this.getProp(PropInterface.PROP_TYPE_NAME)).GetComputedValue();
|
2298
|
-
let task = this;
|
2299
|
-
while (task.ParentTask !== null && !task.ParentTask.isMainProg()) {
|
2300
|
-
task = task.ParentTask;
|
2301
|
-
names = (task.getProp(PropInterface.PROP_TYPE_NAME)).GetComputedValue() + "." + names;
|
2302
|
-
}
|
2303
|
-
return names;
|
2304
|
-
}
|
2305
|
-
static async ProcessTaskURL() {
|
2306
|
-
let xmlData = RuntimeContextBase.Instance.Parser.getXMLdata();
|
2307
|
-
let endTaskUrlIdx = xmlData.indexOf(XMLConstants.TAG_CLOSE, RuntimeContextBase.Instance.Parser.getCurrIndex());
|
2308
|
-
Debug.Assert(endTaskUrlIdx !== -1 && endTaskUrlIdx < xmlData.length);
|
2309
|
-
let tag = RuntimeContextBase.Instance.Parser.getXMLsubstring(endTaskUrlIdx);
|
2310
|
-
RuntimeContextBase.Instance.Parser.add2CurrIndex(tag.indexOf(ConstInterface.MG_TAG_TASKURL) + ConstInterface.MG_TAG_TASKURL.length);
|
2311
|
-
let tokensVector = XmlParser.getTokens(RuntimeContextBase.Instance.Parser.getXMLsubstring(endTaskUrlIdx), XMLConstants.XML_ATTR_DELIM);
|
2312
|
-
let taskCacheURL = tokensVector.get_Item(1);
|
2313
|
-
let refListStr = tokensVector.get_Item(3);
|
2314
|
-
let taskContentOriginal = "";
|
2315
|
-
if (taskCacheURL.trim() != "") {
|
2316
|
-
if (taskCacheURL.startsWith("./"))
|
2317
|
-
taskCacheURL = NString.Replace(taskCacheURL, './', './assets/cache/');
|
2318
|
-
taskContentOriginal = await Task.CommandsProcessor.GetContent(taskCacheURL, true);
|
2319
|
-
}
|
2320
|
-
let taskContentFinal = new StringBuilder(xmlData.substr(0, RuntimeContextBase.Instance.Parser.getCurrIndex() - (ConstInterface.MG_TAG_TASKURL.length + 1)), taskContentOriginal.length);
|
2321
|
-
let reflist = this.getReflist(refListStr, ';', true, -1);
|
2322
|
-
let refListIdx = 0;
|
2323
|
-
let currIdx = taskContentOriginal.indexOf("[:");
|
2324
|
-
let prevIdx = 0;
|
2325
|
-
while (currIdx !== -1) {
|
2326
|
-
taskContentFinal.Append(taskContentOriginal.substr(prevIdx, currIdx - prevIdx));
|
2327
|
-
taskContentFinal.Append(reflist.get_Item(refListIdx++));
|
2328
|
-
currIdx += 2;
|
2329
|
-
prevIdx = currIdx;
|
2330
|
-
currIdx = taskContentOriginal.indexOf("[:", prevIdx);
|
2331
|
-
}
|
2332
|
-
taskContentFinal.Append(taskContentOriginal.substr(prevIdx));
|
2333
|
-
taskContentFinal.Append(xmlData.substr(xmlData.indexOf(XMLConstants.TAG_CLOSE, endTaskUrlIdx + 1) + 1));
|
2334
|
-
xmlData = taskContentFinal.ToString();
|
2335
|
-
Logger.Instance.WriteDevToLog(NString.Format("{0} -------> {1}", taskCacheURL, xmlData));
|
2336
|
-
RuntimeContextBase.Instance.Parser.setXMLdata(xmlData);
|
2337
|
-
RuntimeContextBase.Instance.Parser.setCurrIndex(RuntimeContextBase.Instance.Parser.getCurrIndex() - (ConstInterface.MG_TAG_TASKURL.length + 1));
|
2338
|
-
}
|
2339
|
-
static getReflist(data, delim, trunc, maxTokens) {
|
2340
|
-
let currStr = new StringBuilder();
|
2341
|
-
let list = new List();
|
2342
|
-
let tokensCnt = 0;
|
2343
|
-
for (let i = 1; i < data.length; i++) {
|
2344
|
-
let curr = data.charAt(i);
|
2345
|
-
if (curr !== '\\' && curr !== delim)
|
2346
|
-
currStr.Append(curr);
|
2347
|
-
else if (curr === delim) {
|
2348
|
-
list.push(currStr.ToString());
|
2349
|
-
currStr = new StringBuilder();
|
2350
|
-
tokensCnt++;
|
2351
|
-
if (tokensCnt === maxTokens)
|
2352
|
-
break;
|
2353
|
-
}
|
2354
|
-
else if (curr === '\\') {
|
2355
|
-
if (!trunc && data.charAt(i + 1) !== delim)
|
2356
|
-
currStr.Append(data.charAt(i));
|
2357
|
-
i++;
|
2358
|
-
currStr.Append(data.charAt(i));
|
2359
|
-
}
|
2360
|
-
}
|
2361
|
-
list.push(currStr.ToString());
|
2362
|
-
return list;
|
2363
|
-
}
|
2364
|
-
static async StartProgram(callByDestSubForm, moveToFirstControl) {
|
2365
|
-
let orgStopExecution = AccessHelper.eventsManager.GetStopExecutionFlag();
|
2366
|
-
let nonInteractiveTaskAlreadyExecuted = null;
|
2367
|
-
let allowEvents = AccessHelper.eventsManager.getAllowEvents();
|
2368
|
-
AccessHelper.eventsManager.setAllowEvents(EventsAllowedType.ALL);
|
2369
|
-
Logger.Instance.WriteDevToLog("Start \"startProg\"");
|
2370
|
-
Task.StartProgLevel++;
|
2371
|
-
AccessHelper.eventsManager.setStopExecution(false);
|
2372
|
-
nonInteractiveTaskAlreadyExecuted = await this.ExecuteComponentMainPrograms(callByDestSubForm, moveToFirstControl);
|
2373
|
-
let nonInteractiveTaskAlreadyExecutedRef = new RefParam(nonInteractiveTaskAlreadyExecuted);
|
2374
|
-
let currentNonInteractiveTaskRef = new RefParam(null);
|
2375
|
-
await Task.ExecuteMainProgram(0, callByDestSubForm, moveToFirstControl, nonInteractiveTaskAlreadyExecutedRef, currentNonInteractiveTaskRef, AccessHelper.mgDataTable);
|
2376
|
-
nonInteractiveTaskAlreadyExecuted = nonInteractiveTaskAlreadyExecutedRef.value;
|
2377
|
-
if (!Task._idleTimerStarted) {
|
2378
|
-
GUIManager.Instance.startTimer(AccessHelper.mgDataTable.getMGData(0), Environment.Instance.getIdleTime(0), true);
|
2379
|
-
Task._idleTimerStarted = true;
|
2380
|
-
}
|
2381
|
-
await this.OpenForms(callByDestSubForm);
|
2382
|
-
await this.DoFirstRecordCycle();
|
2383
|
-
await this.MoveToFirstControls(callByDestSubForm);
|
2384
|
-
if (Task.StartProgLevel === 1) {
|
2385
|
-
let resetAllowEvents = false;
|
2386
|
-
let canExecuteEvents = true;
|
2387
|
-
if (nonInteractiveTaskAlreadyExecuted !== null && nonInteractiveTaskAlreadyExecuted.isStarted()) {
|
2388
|
-
resetAllowEvents = true;
|
2389
|
-
AccessHelper.eventsManager.setNonInteractiveAllowEvents(await nonInteractiveTaskAlreadyExecuted.isAllowEvents());
|
2390
|
-
canExecuteEvents = await nonInteractiveTaskAlreadyExecuted.isAllowEvents();
|
2391
|
-
}
|
2392
|
-
if (LastFocusedManager.Instance.getLastFocusedTask() !== null && canExecuteEvents) {
|
2393
|
-
AccessHelper.eventsManager.pushNewExecStacks();
|
2394
|
-
await AccessHelper.eventsManager.handleEvents(AccessHelper.mgDataTable.getCurrMGData(), 0);
|
2395
|
-
AccessHelper.eventsManager.popNewExecStacks();
|
2396
|
-
}
|
2397
|
-
if (resetAllowEvents)
|
2398
|
-
AccessHelper.eventsManager.setAllowEvents(allowEvents);
|
2399
|
-
}
|
2400
|
-
Task.StartProgLevel--;
|
2401
|
-
Logger.Instance.WriteDevToLog("End \"startProg\"");
|
2402
|
-
if (orgStopExecution && !AccessHelper.eventsManager.GetStopExecutionFlag())
|
2403
|
-
if (orgStopExecution && !AccessHelper.eventsManager.GetStopExecutionFlag())
|
2404
|
-
AccessHelper.eventsManager.setStopExecution(orgStopExecution);
|
2405
|
-
return nonInteractiveTaskAlreadyExecuted;
|
2406
|
-
}
|
2407
|
-
static async ExecuteComponentMainPrograms(callByDestSubForm, moveToFirstControl) {
|
2408
|
-
let currentNonInteractiveTask = new RefParam(null);
|
2409
|
-
let nonInteractiveTaskAlreadyExecuted = new RefParam(null);
|
2410
|
-
let maxCtlIdx = AccessHelper.mgDataTable.getMGData(0).getMaxCtlIdx();
|
2411
|
-
for (let i = 1; i <= maxCtlIdx; i = i + 1) {
|
2412
|
-
let componentMainProgram = AccessHelper.mgDataTable.GetMainProgByCtlIdx(-1, i);
|
2413
|
-
if (componentMainProgram !== null)
|
2414
|
-
await Task.ExecuteMainProgram(i, callByDestSubForm, moveToFirstControl, currentNonInteractiveTask, nonInteractiveTaskAlreadyExecuted, AccessHelper.mgDataTable);
|
2415
|
-
}
|
2416
|
-
return nonInteractiveTaskAlreadyExecuted.value;
|
2417
|
-
}
|
2418
|
-
static async ExecuteMainProgram(CtlIndex, callByDestSubForm, moveToFirstControl, currentNonInteractiveTask, nonInteractiveTaskAlreadyExecuted, mgDataTable) {
|
2419
|
-
let mainProgramTask = mgDataTable.GetMainProgByCtlIdx(-1, CtlIndex);
|
2420
|
-
Logger.Instance.WriteDevToLog(NString.Format(" ClientManager.startProg: ctlIdx={0}, task={1}", CtlIndex, mainProgramTask));
|
2421
|
-
currentNonInteractiveTask.value = (await mainProgramTask.Start(moveToFirstControl, callByDestSubForm));
|
2422
|
-
if (nonInteractiveTaskAlreadyExecuted.value === null)
|
2423
|
-
nonInteractiveTaskAlreadyExecuted.value = currentNonInteractiveTask.value;
|
2424
|
-
else if (currentNonInteractiveTask.value !== null) {
|
2425
|
-
Debug.Assert(false, "more than 1 non interactive tasks in startProg");
|
2426
|
-
}
|
2427
|
-
}
|
2428
|
-
static async OpenForms(callByDestSubForm) {
|
2429
|
-
let createdForms = MgForm.CreatedForms;
|
2430
|
-
if (createdForms.Count() > 0) {
|
2431
|
-
let i = 0;
|
2432
|
-
while (i < createdForms.Count()) {
|
2433
|
-
let mgForm = createdForms.get(i);
|
2434
|
-
let canOpen = false;
|
2435
|
-
if (mgForm.isSubForm()) {
|
2436
|
-
let opened = mgForm.getSubFormCtrl().getForm().Opened;
|
2437
|
-
if (opened) {
|
2438
|
-
canOpen = true;
|
2439
|
-
}
|
2440
|
-
}
|
2441
|
-
else {
|
2442
|
-
if (mgForm.getTask().isCurrentStartProgLevel()) {
|
2443
|
-
canOpen = true;
|
2444
|
-
}
|
2445
|
-
}
|
2446
|
-
if (canOpen) {
|
2447
|
-
Manager.OpenForm(mgForm);
|
2448
|
-
await Manager.DoFirstRefreshTable(mgForm);
|
2449
|
-
}
|
2450
|
-
if (mgForm.Opened) {
|
2451
|
-
createdForms.remove(mgForm);
|
2452
|
-
}
|
2453
|
-
else
|
2454
|
-
i++;
|
2455
|
-
}
|
2456
|
-
}
|
2457
|
-
}
|
2458
|
-
static async DoFirstRecordCycle() {
|
2459
|
-
for (let i = 0; i < AccessHelper.mgDataTable.getSize(); i++) {
|
2460
|
-
let mgd = AccessHelper.mgDataTable.getMGData(i);
|
2461
|
-
if (mgd === null || mgd.IsAborting)
|
2462
|
-
continue;
|
2463
|
-
for (let j = 0; j < mgd.getTasksCount(); j++) {
|
2464
|
-
let task = mgd.getTask(j);
|
2465
|
-
if (task !== null) {
|
2466
|
-
let mgForm = task.getForm();
|
2467
|
-
if (mgForm !== null && task.isCurrentStartProgLevel() && !mgForm.IgnoreFirstRecordCycle) {
|
2468
|
-
mgForm.IgnoreFirstRecordCycle = true;
|
2469
|
-
await task.doFirstRecordCycle();
|
2470
|
-
}
|
2471
|
-
}
|
2472
|
-
}
|
2473
|
-
}
|
2474
|
-
}
|
2475
|
-
static async MoveToFirstControls(callByDestSubForm) {
|
2476
|
-
for (let i = 0; i < AccessHelper.mgDataTable.getSize(); i++) {
|
2477
|
-
let mgd = AccessHelper.mgDataTable.getMGData(i);
|
2478
|
-
if (mgd === null || mgd.IsAborting)
|
2479
|
-
continue;
|
2480
|
-
let tasksCount = mgd.getTasksCount();
|
2481
|
-
for (let j = 0; j < tasksCount; j++) {
|
2482
|
-
let task = mgd.getTask(j);
|
2483
|
-
let mgForm = task.getForm();
|
2484
|
-
if (task.isCurrentStartProgLevel() && mgForm !== null && mgForm.MovedToFirstControl) {
|
2485
|
-
mgForm.MovedToFirstControl = false;
|
2486
|
-
if (!callByDestSubForm)
|
2487
|
-
await AccessHelper.eventsManager.HandleNonParkableControls(task);
|
2488
|
-
}
|
2489
|
-
}
|
2490
|
-
}
|
2491
|
-
}
|
2492
|
-
}
|
2493
|
-
Task.StartProgLevel = 0;
|
2494
|
-
Task._idleTimerStarted = false;
|
2495
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVGFzay5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2VuZ2luZS9zcmMvdGFza3MvVGFzay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsS0FBSyxFQUFFLFNBQVMsRUFBRSxJQUFJLEVBQUUsT0FBTyxFQUFFLE9BQU8sRUFBRSxRQUFRLEVBQUUsS0FBSyxFQUFFLGFBQWEsRUFBRSxpQkFBaUIsRUFBQyxNQUFNLHNCQUFzQixDQUFDO0FBQ2pJLE9BQU8sRUFDTCxTQUFTLEVBQ1QsaUJBQWlCLEVBQ2pCLE1BQU0sRUFDTixnQkFBZ0IsRUFDaEIsZ0JBQWdCLEVBQ2hCLE9BQU8sRUFFUCxVQUFVLEVBQ1YsWUFBWSxFQUNaLFNBQVMsRUFDVixNQUFNLGtCQUFrQixDQUFDO0FBQzFCLE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B0YXNrOiBudW1iZXIgPSB0cmVlUm91dGUubGVuZ3RoIC0gMTsgdGFzayA+PSAwOyB0YXNrLS0pIHtcclxuXHJcbiAgICAgICAgY3VyclRhc2sgPSB0cmVlUm91dGVbdGFza107XHJcblxyXG4gICAgICAgIGlmIChjdXJyVGFzay5Gb3JtICE9IG51bGwpIHtcclxuICAgICAgICAgIG5vT2ZDb250cm9sc0luQ3VycnRhc2sgPSBjdXJyVGFzay5Gb3JtLmdldEN0cmxDb3VudCgpO1xyXG5cclxuICAgICAgICAgIC8vIEZvdW5kIHRoZSB0YXNrIHdoaWNoIGNvbnRhaW5zIHRoZSBuZWVkZWQgY29udHJvbFxyXG4gICAgICAgICAgaWYgKGNvbnRyb2xJRCA8IChub09mQ29udHJvbHNCZWZvcmVDdXJyVGFzayArIG5vT2ZDb250cm9sc0luQ3VycnRhc2spKSB7XHJcbiAgICAgICAgICAgIC8vIElkeCBvZiB0aGUgY29udHJvbCBpbiBjdXJyZW50IHRhc2tcclxuICAgICAgICAgICAgY29udHJvbElkeCA9IGNvbnRyb2xJRCAtIG5vT2ZDb250cm9sc0JlZm9yZUN1cnJUYXNrO1xyXG4gICAgICAgICAgICBjb250cm9sID0gPE1nQ29udHJvbD5jdXJyVGFzay5Gb3JtLkN0cmxUYWIuZ2V0Q3RybChjb250cm9sSWR4KTtcclxuICAgICAgICAgICAgY2FsbGVyVGFzayA9IGN1cnJUYXNrO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICBub09mQ29udHJvbHNCZWZvcmVDdXJyVGFzayArPSBub09mQ29udHJvbHNJbkN1cnJ0YXNrO1xyXG4gICAgICAgIH1cclxuICAgICAgfVxyXG5cclxuICAgICAgLy8gR2V0IHBhcmVudFxyXG4gICAgICBpZiAoY29udHJvbCAhPSBudWxsKSB7XHJcbiAgICAgICAgcGFyZW50LnZhbHVlID0gMDtcclxuICAgICAgICBsZXQgcHJldkN0bElkeDogbnVtYmV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YgKHRoaXMuaGFzU3ViVGFza3MoKSkge1xyXG5cclxuICAgICAgICAgICAgaWYgKCFSZW1vdGVDb21tYW5kc1Byb2Nlc3Nvci5HZXRJbnN0YW5jZSgpLkRlbGF5Q29tbWFuZEV4ZWN1dGlvbikge1xyXG4gICAgICAgICAgICAgIGxldCBwZW5kaW5nVHJhbnNhY3Rpb25zOiBib29sZWFuID0gdHJ1ZTtcclxuICAgICAgICAgICAgICBsZXQgY2xpZW50T3BlckV4aXN0OiBib29sZWFuID0gYXdhaXQgdGhpcy5DaGVja0lmQ2xpZW50T3BlcmF0aW9uRXhpc3RzSW5TdWJmb3JtVGFza3ModGhpcyxcclxuICAgICAgICAgICAgICAgIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9UQVNLX1NVRkZJWCk7XHJcbiAgICAgICAgICAgICAgaWYgKCFjbGllbnRPcGVyRXhpc3QpIHtcclxuICAgICAgICAgICAgICAgIGNsaWVudE9wZXJFeGlzdCA9IGF3YWl0IHRoaXMuQ2hlY2tJZkNsaWVudE9wZXJhdGlvbkV4aXN0c0luU3ViZm9ybVRhc2tzKHRoaXMsXHJcbiAgICAgICAgICAgICAgICAgIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SRUNfU1VGRklYKTtcclxuICAgICAgICAgICAgICBpZiAoIWNsaWVudE9wZXJFeGlzdClcclxuICAgICAgICAgICAgICAgICAgcGVuZGluZ1RyYW5zYWN0aW9ucyA9IHRoaXMuQ2hlY2tJZlBlbmRpbmdUcmFuc2FjdGlvbnModGhpcyk7XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIGlmICghY2xpZW50T3BlckV4aXN0ICYmICFwZW5kaW5nVHJhbnNhY3Rpb25zKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmFsbG93UmVtb3RlQ21kRXhlY3V0aW9uID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICB0aGlzLlNldFNlcnZlclNpZGVUYXNrU3VmZml4KHRoa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uZ2V0Rmlyc3RUYXNrKCk7XHJcbiAgICAgICAgICAgICAgICBsZXQgZW5kTWFpblByZzogYm9vbGVhbiA9IGF3YWl0IG1haW5QcmdUYXNrLmNoZWNrUHJvcChQcm9wSW50ZXJmYWNlLlBST1BfVFlQRV9FTkRfQ09ORElUSU9OLCBmYWxzZSk7XHJcblxyXG4gICAgICAgICAgICAgICAgLy8gTm8gbmVlZCB0byBlbmQgdGhlIHJvb3QgdGFzayBpZiB3ZSBhcmUgYWxyZWFkeSBkb2luZyBpdC5cclxuICAgICAgICAgICAgICAgIGlmICh0aGlzICE9PSByb290VGFzayAmJiBlbmRNYWluUHJnKSB7XHJcbiAgICAgICAgICAgICAgICAgIGxldCBydEV2dCA9IG5ldyBSdW5UaW1lRXZlbnQocm9vdFRhc2spO1xyXG4gICAgICAgICAgICAgICAgICBydEV2dC5zZXRJbnRlcm5hbChJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfQ0xPU0UpO1xyXG4gICAgICAgICAgICAgICAgICBydEV2dC5zZXRDdHJsKG51bGwpO1xyXG4gICAgICAgICAgICAgICAgICBydEV2dC5zZXRBcmdMaXN0KG51bGwpO1xyXG4gICAgICAgICAgICAgICAgICBBY2Nlc3NIZWxwZXIuZXZlbnRzTWFuYWdlci5hZGRUb1RhaWwocnRFdnQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICBNZ0Zvcm0uQ3JlYXRlZEZvcm1zLnJlbW92ZSg8TWdGb3JtPnRoaXMuRm9ybSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuXHJcbiAgICAgIGZpbmFsbHkge1xyXG4gICAgICAgIGlmICghdGhpcy5Jc1N1YkZvcm0gfHwgc3ViZm9ybURlc3RpbmF0aW9uKVxyXG4gICAgICAgICAgdGhpcy5oYW5kbGVGaW5hbGx5RW5kVGFzayhzdWNjZWVkZW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5kbGVyICE9IG51bGwgJiYgIWNsaWVudE9wZXJhdGlvbkV4aXN0KSB7XHJcbiAgICAgICAgbGV0IGNudCA9IGhhbmRsZXIuZ2V0T3BlcmF0aW9uVGFiKCkuZ2V0U2l6ZSgpO1xyXG5cclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNudDsgaSsrKSB7XHJcbiAgICAgICAgICBsZXQgb3BlciA9IGhhbmRsZXIuZ2V0T3BlcmF0aW9uVGFiKCkuZ2V0T3BlcmF0aW9uKGkpO1xyXG4gICAgICAgICAgaWYgKG9wZXIuZ2V0RXhlY09uQ2xpZW50KCkpIHtcclxuICAgICAgICAgICAgY2xpZW50T3BlcmF0aW9uRXhpc3QgPSB0cnVlO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgIH1cclxuICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBpZiAob3Blci5nZXRUeXBlKCkgPT0gQ29uc3RJbnRlcmZhY2UuTUdfT1BFUl9SQUlTRV9FVkVOVCl7XHJcbiAgICAgICAgICAgICAgaWYgKG9wZXIuR2V0UnVudGltZUV2ZW50KCkuZ2V0VHlwZSgpID09IENvbnN0SW50ZXJmYWNlLkVWRU5UX1RZUEVfSU5URVJOQUwgJiZcclxuICAgICAgICAgICAgICBvcGVyLkdldFJ1bnRpbWVFdmVudCgpLmdldEludGVybmFsQ29kZSgpID09PSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfUlRfUkVGUkVTSF9WSUVXKSB7XHJcbiAgICAgICAgICAgICAgICBjbGllbnRPcGVyYXRpb25FeGlzdCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuXHJcbiAgICAgIGlmICghY2xpZW50T3BlcmF0aW9uRXhpc3QgJiYgdGFzay5oYXNTdWJUYXNrcygpKSB7XHJ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