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