@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,766 @@
|
|
1
|
+
import { ApplicationException, Exception, NString, RefParam, StringBuilder, isNullOrUndefined } from "@magic-xpa/mscorelib";
|
2
|
+
import { BrkScope, Constants, InternalInterface, Logger, Logger_LogLevels, StorageAttributeCheck, XMLConstants, XmlParser } from "@magic-xpa/utils";
|
3
|
+
import { Event } from "./Event";
|
4
|
+
import { FieldBase } from "../data/FieldBase";
|
5
|
+
import { OperationTable } from "../rt/OperationTable";
|
6
|
+
import { FlowMonitorQueue } from "../util/FlowMonitorQueue";
|
7
|
+
import { ServerError } from "../remote/ServerError";
|
8
|
+
import { YesNoExp } from "../exp/YesNoExp";
|
9
|
+
import { ConstInterface } from "../ConstInterface";
|
10
|
+
import { FlowMonitorInterface } from "../FlowMonitorInterface";
|
11
|
+
import { LastFocusedManager } from "../rt/LastFocusedManager";
|
12
|
+
import { AccessHelper } from "../AccessHelper";
|
13
|
+
import { RemoteCommandsProcessor } from "../remote/RemoteCommandsProcessor";
|
14
|
+
import { Environment } from "../env/Environment";
|
15
|
+
export class EventHandler {
|
16
|
+
_enabledExp = new YesNoExp(true);
|
17
|
+
_operationTab = null;
|
18
|
+
_propagateExp = new YesNoExp(true);
|
19
|
+
_isHandlerOnForm = false;
|
20
|
+
_ctrl = null;
|
21
|
+
_ctrlName = null;
|
22
|
+
_dvLen = 0;
|
23
|
+
_dvPos = 0;
|
24
|
+
_evt = null;
|
25
|
+
_handledByClient = false;
|
26
|
+
_handlerFld = null;
|
27
|
+
_hasParameters = false;
|
28
|
+
_id = 0;
|
29
|
+
_level = '\0';
|
30
|
+
_scope = null;
|
31
|
+
_task = null;
|
32
|
+
_taskMgdID = -1;
|
33
|
+
constructor() {
|
34
|
+
this._operationTab = new OperationTable();
|
35
|
+
}
|
36
|
+
getCtrlName() {
|
37
|
+
return this._ctrlName;
|
38
|
+
}
|
39
|
+
fillData(taskRef, parser) {
|
40
|
+
if (this._task === null) {
|
41
|
+
this._task = taskRef;
|
42
|
+
this._taskMgdID = this._task.getMgdID();
|
43
|
+
}
|
44
|
+
while (this.initInnerObjects(parser, parser.getNextTag())) {
|
45
|
+
}
|
46
|
+
let dataView = this._task.DataView;
|
47
|
+
this._hasParameters = dataView.ParametersExist(this._dvPos, this._dvLen);
|
48
|
+
}
|
49
|
+
initInnerObjects(parser, foundTagName) {
|
50
|
+
if (foundTagName === null)
|
51
|
+
return false;
|
52
|
+
if (foundTagName === ConstInterface.MG_TAG_HANDLER)
|
53
|
+
this.initInnerElements(parser, this._task);
|
54
|
+
else if (foundTagName === ConstInterface.MG_TAG_OPER)
|
55
|
+
this._operationTab.fillData(this._task, this, parser);
|
56
|
+
else if (foundTagName === ConstInterface.MG_TAG_EVENT && this._evt === null) {
|
57
|
+
this._evt = new Event();
|
58
|
+
this._evt.fillData(parser, this._task);
|
59
|
+
if (this._evt.getType() === ConstInterface.EVENT_TYPE_TIMER ||
|
60
|
+
(this._evt.getType() === ConstInterface.EVENT_TYPE_USER && this._evt.getUserEventType() === ConstInterface.EVENT_TYPE_TIMER))
|
61
|
+
this._task.getMGData().addTimerHandler(this);
|
62
|
+
if (((this._evt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && this._evt.getInternalCode() === InternalInterface.MG_ACT_ZOOM) || (this._evt.getType() === ConstInterface.EVENT_TYPE_USER && this._evt.getUserEvent() !== null && this._evt.getUserEventType() === ConstInterface.EVENT_TYPE_INTERNAL && this._evt.getUserEvent().getInternalCode() === InternalInterface.MG_ACT_ZOOM)) && !this._task.getEnableZoomHandler()) {
|
63
|
+
if (this._handlerFld !== null)
|
64
|
+
this._handlerFld.setHasZoomHandler();
|
65
|
+
else if (this._ctrl !== null)
|
66
|
+
this._ctrl.HasZoomHandler = true;
|
67
|
+
else
|
68
|
+
this._task.setEnableZoomHandler();
|
69
|
+
}
|
70
|
+
}
|
71
|
+
else if (foundTagName === '/' + ConstInterface.MG_TAG_HANDLER) {
|
72
|
+
parser.setCurrIndex2EndOfTag();
|
73
|
+
return false;
|
74
|
+
}
|
75
|
+
else {
|
76
|
+
Logger.Instance.WriteExceptionToLogWithMsg("there is no such tag in EventHandler.initInnerObjects() " + foundTagName);
|
77
|
+
return false;
|
78
|
+
}
|
79
|
+
return true;
|
80
|
+
}
|
81
|
+
initInnerElements(parser, taskRef) {
|
82
|
+
let endContext = parser.getXMLdata().indexOf(XMLConstants.TAG_CLOSE, parser.getCurrIndex());
|
83
|
+
if (endContext !== -1 && endContext < parser.getXMLdata().length) {
|
84
|
+
let tag = parser.getXMLsubstring(endContext);
|
85
|
+
parser.add2CurrIndex(tag.indexOf(ConstInterface.MG_TAG_HANDLER) + ConstInterface.MG_TAG_HANDLER.length);
|
86
|
+
let tokensVector = XmlParser.getTokens(parser.getXMLsubstring(endContext), XMLConstants.XML_ATTR_DELIM);
|
87
|
+
this.initElements(tokensVector, taskRef);
|
88
|
+
parser.setCurrIndex(++endContext);
|
89
|
+
return;
|
90
|
+
}
|
91
|
+
Logger.Instance.WriteExceptionToLogWithMsg("in Handler.FillData() out of string bounds");
|
92
|
+
}
|
93
|
+
initElements(tokensVector, taskRef) {
|
94
|
+
for (let j = 0; j < tokensVector.length; j += 2) {
|
95
|
+
let attribute = (tokensVector.get_Item(j));
|
96
|
+
let valueStr = (tokensVector.get_Item(j + 1));
|
97
|
+
switch (attribute) {
|
98
|
+
case ConstInterface.MG_ATTR_HANDLEDBY:
|
99
|
+
this._handledByClient = (valueStr.toUpperCase() === "C".toUpperCase());
|
100
|
+
break;
|
101
|
+
case XMLConstants.MG_ATTR_ID:
|
102
|
+
this._id = XmlParser.getInt(valueStr);
|
103
|
+
break;
|
104
|
+
case ConstInterface.MG_ATTR_LEVEL:
|
105
|
+
this._level = valueStr[0];
|
106
|
+
break;
|
107
|
+
case ConstInterface.MG_ATTR_OBJECT:
|
108
|
+
let valueStringCtrlName = XmlParser.unescape(valueStr);
|
109
|
+
this._ctrlName = XmlParser.unescape(valueStringCtrlName).toUpperCase();
|
110
|
+
this.calculateCtrlFromControlName(taskRef);
|
111
|
+
break;
|
112
|
+
case ConstInterface.MG_ATTR_VARIABLE:
|
113
|
+
this._handlerFld = this._task.DataView.getField(XmlParser.getInt(valueStr));
|
114
|
+
this._handlerFld.setHasChangeEvent();
|
115
|
+
break;
|
116
|
+
case ConstInterface.MG_ATTR_SCOPE:
|
117
|
+
this._scope = valueStr[0];
|
118
|
+
break;
|
119
|
+
case ConstInterface.MG_ATTR_PROPAGATE:
|
120
|
+
this._propagateExp.setVal(taskRef, valueStr);
|
121
|
+
break;
|
122
|
+
case ConstInterface.MG_ATTR_ENABLED:
|
123
|
+
this._enabledExp.setVal(taskRef, valueStr);
|
124
|
+
break;
|
125
|
+
case ConstInterface.MG_ATTR_DVPOS:
|
126
|
+
let i = valueStr.indexOf(",");
|
127
|
+
if (i > -1) {
|
128
|
+
this._dvLen = XmlParser.getInt(valueStr.substr(0, i));
|
129
|
+
this._dvPos = XmlParser.getInt(valueStr.substr(i + 1));
|
130
|
+
for (let fldIdx = this._dvPos; fldIdx < this._dvPos + this._dvLen; fldIdx++) {
|
131
|
+
let field = this._task.DataView.getField(fldIdx);
|
132
|
+
field.IsEventHandlerField = true;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
break;
|
136
|
+
case ConstInterface.MG_ATTR_HANDLER_ONFORM:
|
137
|
+
this._isHandlerOnForm = XmlParser.getBoolean(valueStr);
|
138
|
+
break;
|
139
|
+
default:
|
140
|
+
Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in EventHandler class. Insert case to EventHandler.initElements for " + attribute);
|
141
|
+
break;
|
142
|
+
}
|
143
|
+
}
|
144
|
+
}
|
145
|
+
calculateCtrlFromControlName(taskRef) {
|
146
|
+
if (!NString.IsNullOrEmpty(this._ctrlName)) {
|
147
|
+
this._ctrl = ((taskRef.getForm() !== null) ? taskRef.getForm().getCtrlByCtrlName(this._ctrlName) : null);
|
148
|
+
}
|
149
|
+
}
|
150
|
+
isSpecificHandlerOf(rtEvt) {
|
151
|
+
if (this._ctrl === null && this._ctrlName === null && this._handlerFld === null && !this._isHandlerOnForm)
|
152
|
+
return false;
|
153
|
+
if (this._scope === BrkScope.Task && this._task !== rtEvt.getTask())
|
154
|
+
return false;
|
155
|
+
if (this._evt.equals(rtEvt)) {
|
156
|
+
if (this._handlerFld !== null) {
|
157
|
+
return (this._handlerFld === rtEvt.getFld());
|
158
|
+
}
|
159
|
+
if (rtEvt.Control !== null && !this._isHandlerOnForm) {
|
160
|
+
let eventCtrlName = rtEvt.Control.getControlNameForHandlerSearch();
|
161
|
+
if (eventCtrlName !== null && this._ctrlName.toLowerCase() === eventCtrlName.toLowerCase())
|
162
|
+
return true;
|
163
|
+
}
|
164
|
+
else if (rtEvt.Control === null && this._isHandlerOnForm)
|
165
|
+
return true;
|
166
|
+
}
|
167
|
+
return false;
|
168
|
+
}
|
169
|
+
isNonSpecificHandlerOf(rtEvt) {
|
170
|
+
if (this._ctrl !== null || this._ctrlName !== null || this._handlerFld !== null || this._isHandlerOnForm)
|
171
|
+
return false;
|
172
|
+
if (this._scope === BrkScope.Task && this._task !== rtEvt.getTask() && rtEvt.getType() !== ConstInterface.EVENT_TYPE_TIMER)
|
173
|
+
return false;
|
174
|
+
if (this._scope === BrkScope.Global && this._task !== rtEvt.getTask())
|
175
|
+
return false;
|
176
|
+
if (this._evt.getType() === ConstInterface.EVENT_TYPE_USER && this._evt.getUserEventType() === ConstInterface.EVENT_TYPE_NOTINITED) {
|
177
|
+
try {
|
178
|
+
this._evt.findUserEvent();
|
179
|
+
}
|
180
|
+
catch (applicationException) {
|
181
|
+
if (applicationException instanceof ApplicationException) {
|
182
|
+
}
|
183
|
+
else
|
184
|
+
throw applicationException;
|
185
|
+
}
|
186
|
+
}
|
187
|
+
return this._evt.equals(rtEvt);
|
188
|
+
}
|
189
|
+
isGlobalHandlerOf(rtEvt) {
|
190
|
+
if (this._scope !== BrkScope.Global)
|
191
|
+
return false;
|
192
|
+
if (this._ctrl != null || this._ctrlName != null || this._handlerFld != null || this._isHandlerOnForm)
|
193
|
+
return false;
|
194
|
+
return this._evt.equals(rtEvt);
|
195
|
+
}
|
196
|
+
isGlobalSpecificHandlerOf(rtEvt) {
|
197
|
+
if (this._scope !== BrkScope.Global)
|
198
|
+
return false;
|
199
|
+
if (this._ctrl == null && this._ctrlName == null && this._handlerFld == null)
|
200
|
+
return false;
|
201
|
+
return (this._ctrlName != null && this._evt.equals(rtEvt) &&
|
202
|
+
NString.Equals(this._ctrlName, rtEvt.Control.Name, true));
|
203
|
+
}
|
204
|
+
async execute(rtEvt, returnedFromServer, enabledCndCheckedAndTrue) {
|
205
|
+
let ctrl = null;
|
206
|
+
let retVal;
|
207
|
+
let depth = 0;
|
208
|
+
let taskEnd = false;
|
209
|
+
let brkLevel = this._task.getBrkLevel();
|
210
|
+
let brkLevelIndex = this._task.getBrkLevelIndex();
|
211
|
+
let initialLoopStackSize = 0;
|
212
|
+
if (taskEnd !== null && this._evt.getType() !== ConstInterface.EVENT_TYPE_EXPRESSION && (this._evt.getType() !== ConstInterface.EVENT_TYPE_USER || (this._evt.getUserEvent().getType() !== ConstInterface.EVENT_TYPE_EXPRESSION && this._evt.getUserEvent().getType() !== ConstInterface.EVENT_TYPE_TIMER))) {
|
213
|
+
if (this._evt.getType() !== ConstInterface.EVENT_TYPE_USER_FUNC)
|
214
|
+
this._task.setBrkLevel(rtEvt.getBrkLevel(), this._id);
|
215
|
+
}
|
216
|
+
else
|
217
|
+
this._task.setBrkLevel(this._evt.getBrkLevel(), this._id);
|
218
|
+
let args = rtEvt.getArgList();
|
219
|
+
try {
|
220
|
+
let flowMonitor = FlowMonitorQueue.Instance;
|
221
|
+
if (rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && rtEvt.getInternalCode() === InternalInterface.MG_ACT_WEBCLIENT_ROUTE) {
|
222
|
+
if (!this._task.IsRoute() && this._task !== AccessHelper.mgDataTable.StartupMgData.getFirstTask()) {
|
223
|
+
return new RetVals(true, true);
|
224
|
+
}
|
225
|
+
}
|
226
|
+
let nextOperIdx = -1;
|
227
|
+
if (returnedFromServer) {
|
228
|
+
nextOperIdx = AccessHelper.eventsManager.getNextOperIdx(this._operationTab.getOperation(0), false);
|
229
|
+
}
|
230
|
+
if (nextOperIdx === -1 && !enabledCndCheckedAndTrue && !await this.isEnabled())
|
231
|
+
return new RetVals(true, false);
|
232
|
+
if (this._scope === BrkScope.Task && (rtEvt.getType() === ConstInterface.EVENT_TYPE_TIMER || rtEvt.getType() === ConstInterface.EVENT_TYPE_EXPRESSION)) {
|
233
|
+
let currTask = LastFocusedManager.Instance.getLastFocusedTask();
|
234
|
+
if (this._task !== currTask)
|
235
|
+
return new RetVals(true, true);
|
236
|
+
}
|
237
|
+
if (!this._handledByClient) {
|
238
|
+
return new RetVals(false, true);
|
239
|
+
}
|
240
|
+
if (rtEvt.getType() !== ConstInterface.EVENT_TYPE_USER && !await this._evt.dataEventIsTrue())
|
241
|
+
return new RetVals(false, true);
|
242
|
+
if (rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && rtEvt.getInternalCode() === InternalInterface.MG_ACT_TASK_SUFFIX)
|
243
|
+
taskEnd = true;
|
244
|
+
if (rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL) {
|
245
|
+
switch (rtEvt.getInternalCode()) {
|
246
|
+
case InternalInterface.MG_ACT_REC_PREFIX:
|
247
|
+
flowMonitor.addTaskFlowRec(InternalInterface.MG_ACT_REC_PREFIX, FlowMonitorInterface.FLWMTR_START, this._task.GetTaskDetails());
|
248
|
+
break;
|
249
|
+
case InternalInterface.MG_ACT_REC_SUFFIX:
|
250
|
+
flowMonitor.addTaskFlowRec(InternalInterface.MG_ACT_REC_SUFFIX, FlowMonitorInterface.FLWMTR_START, this._task.GetTaskDetails());
|
251
|
+
break;
|
252
|
+
case InternalInterface.MG_ACT_CTRL_SUFFIX:
|
253
|
+
flowMonitor.addTaskFlowCtrl(InternalInterface.MG_ACT_CTRL_SUFFIX, rtEvt.Control.Name, FlowMonitorInterface.FLWMTR_START, this._task.GetTaskDetails());
|
254
|
+
break;
|
255
|
+
case InternalInterface.MG_ACT_CTRL_PREFIX:
|
256
|
+
flowMonitor.addTaskFlowCtrl(InternalInterface.MG_ACT_CTRL_PREFIX, rtEvt.Control.Name, FlowMonitorInterface.FLWMTR_START, this._task.GetTaskDetails());
|
257
|
+
break;
|
258
|
+
case InternalInterface.MG_ACT_VARIABLE:
|
259
|
+
flowMonitor.addTaskFlowFld(InternalInterface.MG_ACT_VARIABLE, rtEvt.getFld().getName(), FlowMonitorInterface.FLWMTR_START, this._task.GetTaskDetails());
|
260
|
+
break;
|
261
|
+
case InternalInterface.MG_ACT_CTRL_VERIFICATION:
|
262
|
+
flowMonitor.addTaskFlowCtrl(InternalInterface.MG_ACT_CTRL_VERIFICATION, rtEvt.Control.Name, FlowMonitorInterface.FLWMTR_START, this._task.GetTaskDetails());
|
263
|
+
break;
|
264
|
+
case InternalInterface.MG_ACT_TASK_PREFIX:
|
265
|
+
flowMonitor.addTaskFlowRec(InternalInterface.MG_ACT_TASK_PREFIX, FlowMonitorInterface.FLWMTR_START, this._task.GetTaskDetails());
|
266
|
+
break;
|
267
|
+
case InternalInterface.MG_ACT_TASK_SUFFIX:
|
268
|
+
flowMonitor.addTaskFlowRec(InternalInterface.MG_ACT_TASK_SUFFIX, FlowMonitorInterface.FLWMTR_START, this._task.GetTaskDetails());
|
269
|
+
break;
|
270
|
+
default:
|
271
|
+
flowMonitor.addTaskFlowHandler(this._evt.getBrkLevel(true), FlowMonitorInterface.FLWMTR_START, this._task.GetTaskDetails());
|
272
|
+
break;
|
273
|
+
}
|
274
|
+
}
|
275
|
+
else
|
276
|
+
flowMonitor.addTaskFlowHandler(this._evt.getBrkLevel(true), FlowMonitorInterface.FLWMTR_START, this._task.GetTaskDetails());
|
277
|
+
try {
|
278
|
+
if (taskEnd !== null)
|
279
|
+
ctrl = rtEvt.Control;
|
280
|
+
let mgdID = AccessHelper.mgDataTable.currMgdID;
|
281
|
+
let isChangedCurrWnd = false;
|
282
|
+
let isChangedCurrWndRef = new RefParam(isChangedCurrWnd);
|
283
|
+
if (this._evt.getType() === ConstInterface.EVENT_TYPE_TIMER && mgdID !== rtEvt.getMgdID()) {
|
284
|
+
AccessHelper.mgDataTable.currMgdID = rtEvt.getMgdID();
|
285
|
+
isChangedCurrWndRef.value = true;
|
286
|
+
}
|
287
|
+
await this.resetLocalVariables(args);
|
288
|
+
initialLoopStackSize = this._task.getLoopStackSize();
|
289
|
+
let retVals = null;
|
290
|
+
if (this._operationTab.getSize() > 0)
|
291
|
+
retVals = await this.executeOperations(0, this._operationTab.getSize() - 1, taskEnd, mgdID, depth, isChangedCurrWndRef, false, false, -1);
|
292
|
+
isChangedCurrWnd = isChangedCurrWndRef.value;
|
293
|
+
if (retVals !== null)
|
294
|
+
return retVals;
|
295
|
+
if (!taskEnd)
|
296
|
+
await this._task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE);
|
297
|
+
if (isChangedCurrWnd) {
|
298
|
+
let oldMgd = AccessHelper.mgDataTable.getMGData(mgdID);
|
299
|
+
if (oldMgd !== null && !oldMgd.IsAborting)
|
300
|
+
AccessHelper.mgDataTable.currMgdID = mgdID;
|
301
|
+
}
|
302
|
+
}
|
303
|
+
catch (ex) {
|
304
|
+
if (ex instanceof ServerError) {
|
305
|
+
if (Logger.Instance.LogLevel !== Logger_LogLevels.Basic)
|
306
|
+
Logger.Instance.WriteExceptionToLog(ex);
|
307
|
+
throw ex;
|
308
|
+
}
|
309
|
+
else if (ex instanceof Exception) {
|
310
|
+
Logger.Instance.WriteExceptionToLog(ex);
|
311
|
+
return new RetVals(false, true);
|
312
|
+
}
|
313
|
+
else
|
314
|
+
throw ex;
|
315
|
+
}
|
316
|
+
finally {
|
317
|
+
retVal = await this._propagateExp.getVal();
|
318
|
+
let currLoopStackSize = this._task.getLoopStackSize();
|
319
|
+
for (; currLoopStackSize > initialLoopStackSize; currLoopStackSize = currLoopStackSize--)
|
320
|
+
this._task.popLoopCounter();
|
321
|
+
}
|
322
|
+
if (args !== null)
|
323
|
+
await this.getArgValsFromFlds(args);
|
324
|
+
if (rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL) {
|
325
|
+
switch (rtEvt.getInternalCode()) {
|
326
|
+
case InternalInterface.MG_ACT_REC_PREFIX:
|
327
|
+
flowMonitor.addTaskFlowRec(InternalInterface.MG_ACT_REC_PREFIX, FlowMonitorInterface.FLWMTR_END, this._task.GetTaskDetails());
|
328
|
+
break;
|
329
|
+
case InternalInterface.MG_ACT_REC_SUFFIX:
|
330
|
+
flowMonitor.addTaskFlowRec(InternalInterface.MG_ACT_REC_SUFFIX, FlowMonitorInterface.FLWMTR_END, this._task.GetTaskDetails());
|
331
|
+
break;
|
332
|
+
case InternalInterface.MG_ACT_TASK_PREFIX:
|
333
|
+
flowMonitor.addTaskFlowRec(InternalInterface.MG_ACT_TASK_PREFIX, FlowMonitorInterface.FLWMTR_END, this._task.GetTaskDetails());
|
334
|
+
break;
|
335
|
+
case InternalInterface.MG_ACT_TASK_SUFFIX:
|
336
|
+
flowMonitor.addTaskFlowRec(InternalInterface.MG_ACT_TASK_SUFFIX, FlowMonitorInterface.FLWMTR_END, this._task.GetTaskDetails());
|
337
|
+
break;
|
338
|
+
case InternalInterface.MG_ACT_CTRL_SUFFIX:
|
339
|
+
flowMonitor.addTaskFlowCtrl(InternalInterface.MG_ACT_CTRL_SUFFIX, ctrl.Name, FlowMonitorInterface.FLWMTR_END, this._task.GetTaskDetails());
|
340
|
+
break;
|
341
|
+
case InternalInterface.MG_ACT_CTRL_PREFIX:
|
342
|
+
flowMonitor.addTaskFlowCtrl(InternalInterface.MG_ACT_CTRL_PREFIX, ctrl.Name, FlowMonitorInterface.FLWMTR_END, this._task.GetTaskDetails());
|
343
|
+
break;
|
344
|
+
case InternalInterface.MG_ACT_VARIABLE:
|
345
|
+
flowMonitor.addTaskFlowFld(InternalInterface.MG_ACT_VARIABLE, rtEvt.getFld().getName(), FlowMonitorInterface.FLWMTR_END, this._task.GetTaskDetails());
|
346
|
+
break;
|
347
|
+
case InternalInterface.MG_ACT_CTRL_VERIFICATION:
|
348
|
+
flowMonitor.addTaskFlowCtrl(InternalInterface.MG_ACT_CTRL_VERIFICATION, ctrl.Name, FlowMonitorInterface.FLWMTR_END, this._task.GetTaskDetails());
|
349
|
+
break;
|
350
|
+
default:
|
351
|
+
flowMonitor.addTaskFlowHandler(this._evt.getBrkLevel(true), FlowMonitorInterface.FLWMTR_END, this._task.GetTaskDetails());
|
352
|
+
break;
|
353
|
+
}
|
354
|
+
}
|
355
|
+
else
|
356
|
+
flowMonitor.addTaskFlowHandler(this._evt.getBrkLevel(true), 1, this._task.GetTaskDetails());
|
357
|
+
}
|
358
|
+
finally {
|
359
|
+
this._task.setBrkLevel(brkLevel, brkLevelIndex);
|
360
|
+
}
|
361
|
+
return new RetVals(retVal, true);
|
362
|
+
}
|
363
|
+
async executeOperations(fromIdx, toIdx, taskEnd, mgdID, depth, isChangedCurrWndRef, inBlockIf, inReturnedFromServer, inNextOperIdx) {
|
364
|
+
let oper;
|
365
|
+
let operType;
|
366
|
+
let nextOperIdx = -1;
|
367
|
+
let returnedFromServer = false;
|
368
|
+
let mgd = this._task.getMGData();
|
369
|
+
let execFlowIdx = fromIdx;
|
370
|
+
let retvals;
|
371
|
+
let blockIfReturnedFromServer = false;
|
372
|
+
let executeBlock;
|
373
|
+
let blockLoopExeconServer;
|
374
|
+
let flowMonitor = FlowMonitorQueue.Instance;
|
375
|
+
let routeOperationExecuted = false;
|
376
|
+
if (!inReturnedFromServer) {
|
377
|
+
oper = this._operationTab.getOperation(execFlowIdx);
|
378
|
+
nextOperIdx = AccessHelper.eventsManager.getNextOperIdx(oper, true);
|
379
|
+
if (nextOperIdx > -1) {
|
380
|
+
returnedFromServer = true;
|
381
|
+
if (inBlockIf)
|
382
|
+
blockIfReturnedFromServer = true;
|
383
|
+
}
|
384
|
+
else
|
385
|
+
returnedFromServer = false;
|
386
|
+
}
|
387
|
+
else {
|
388
|
+
returnedFromServer = inReturnedFromServer;
|
389
|
+
nextOperIdx = inNextOperIdx;
|
390
|
+
}
|
391
|
+
for (; execFlowIdx <= toIdx &&
|
392
|
+
(!AccessHelper.eventsManager.GetStopExecutionFlag()) &&
|
393
|
+
!mgd.IsAborting && !routeOperationExecuted; execFlowIdx += 1) {
|
394
|
+
if (inBlockIf && blockIfReturnedFromServer && this._operationTab.getOperation(toIdx).getServerId() < nextOperIdx)
|
395
|
+
break;
|
396
|
+
oper = this._operationTab.getOperation(execFlowIdx);
|
397
|
+
operType = oper.getType();
|
398
|
+
blockIfReturnedFromServer = false;
|
399
|
+
if (RemoteCommandsProcessor.GetInstance().DelayCommandExecution) {
|
400
|
+
this._task.setUseLoopStack(depth > 0);
|
401
|
+
await oper.operServer(null);
|
402
|
+
break;
|
403
|
+
}
|
404
|
+
if (returnedFromServer && oper.getServerId() < nextOperIdx)
|
405
|
+
if (operType !== ConstInterface.MG_OPER_BLOCK)
|
406
|
+
continue;
|
407
|
+
else if (this._operationTab.getOperation(oper.getBlockEnd()).getServerId() < nextOperIdx)
|
408
|
+
continue;
|
409
|
+
if (!taskEnd) {
|
410
|
+
let mainLevel = this._task.getMainLevel().toLowerCase();
|
411
|
+
if (await this._task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE) && Environment.Instance.getSpecialImmediateHandlerEnd() &&
|
412
|
+
mainLevel != "RP".toLowerCase() && mainLevel != "TP".toLowerCase() && mainLevel != "RS".toLowerCase() && mainLevel != "TS".toLowerCase())
|
413
|
+
break;
|
414
|
+
}
|
415
|
+
if (this._taskMgdID !== mgdID)
|
416
|
+
isChangedCurrWndRef.value = true;
|
417
|
+
if (!this._task.isMainProg() && this._task.isOpenWin())
|
418
|
+
AccessHelper.mgDataTable.currMgdID = this._taskMgdID;
|
419
|
+
await AccessHelper.eventsManager.CheckAndShowSpinner(true);
|
420
|
+
switch (operType) {
|
421
|
+
case ConstInterface.MG_OPER_VERIFY:
|
422
|
+
if (await oper.execute(returnedFromServer)) {
|
423
|
+
if (!(this._task.getBrkLevel() === "TS")) {
|
424
|
+
AccessHelper.eventsManager.setStopExecution(true);
|
425
|
+
}
|
426
|
+
if (this._task.getInRecordSuffix() && this._task.getLevel() === Constants.TASK_LEVEL_TASK)
|
427
|
+
this._task.setLevel(Constants.TASK_LEVEL_RECORD);
|
428
|
+
return new RetVals(false, true);
|
429
|
+
}
|
430
|
+
break;
|
431
|
+
case ConstInterface.MG_OPER_LOOP:
|
432
|
+
this._task.enterLoop();
|
433
|
+
this._task.increaseLoopCounter();
|
434
|
+
this._task.setUseLoopStack(true);
|
435
|
+
await flowMonitor.addFlowFieldOperation(oper, true, this._task.GetTaskDetails());
|
436
|
+
blockLoopExeconServer = false;
|
437
|
+
if (!oper.getExecOnServer()) {
|
438
|
+
while (await oper.execute(false)) {
|
439
|
+
retvals = await this.executeOperations(execFlowIdx + 1, oper.getBlockClose() - 1, taskEnd, mgdID, depth + 1, isChangedCurrWndRef, false, false, -1);
|
440
|
+
if (retvals !== null)
|
441
|
+
return retvals;
|
442
|
+
if ((mgd.IsAborting || AccessHelper.eventsManager.GetStopExecutionFlag()))
|
443
|
+
break;
|
444
|
+
this._task.increaseLoopCounter();
|
445
|
+
this._task.setUseLoopStack(true);
|
446
|
+
}
|
447
|
+
}
|
448
|
+
else {
|
449
|
+
if (await oper.execute(false))
|
450
|
+
blockLoopExeconServer = true;
|
451
|
+
}
|
452
|
+
if (!blockLoopExeconServer)
|
453
|
+
execFlowIdx = oper.getBlockEnd() - 1;
|
454
|
+
this._task.leaveLoop();
|
455
|
+
break;
|
456
|
+
case ConstInterface.MG_OPER_BLOCK:
|
457
|
+
if (!oper.getExecOnServer() || (returnedFromServer && oper.getServerId() < nextOperIdx)) {
|
458
|
+
this._task.setUseLoopStack(true);
|
459
|
+
if (!returnedFromServer || oper.getServerId() >= nextOperIdx)
|
460
|
+
execFlowIdx = await this.getSignificantBlock(execFlowIdx, oper.getBlockEnd());
|
461
|
+
else
|
462
|
+
execFlowIdx = this.getStartBlockIfIdxByOper(execFlowIdx, nextOperIdx);
|
463
|
+
}
|
464
|
+
else {
|
465
|
+
this._task.setUseLoopStack(depth > 0);
|
466
|
+
await oper.operServer(null);
|
467
|
+
nextOperIdx = AccessHelper.eventsManager.getNextOperIdx(oper, true);
|
468
|
+
if (nextOperIdx > -1) {
|
469
|
+
returnedFromServer = true;
|
470
|
+
if (inBlockIf)
|
471
|
+
blockIfReturnedFromServer = true;
|
472
|
+
if (nextOperIdx < this._operationTab.getOperation(oper.getBlockEnd()).getServerId()) {
|
473
|
+
while (this._operationTab.getOperation(oper.getBlockClose()).getServerId() < nextOperIdx) {
|
474
|
+
execFlowIdx = oper.getBlockClose();
|
475
|
+
oper = this._operationTab.getOperation(execFlowIdx);
|
476
|
+
}
|
477
|
+
}
|
478
|
+
}
|
479
|
+
else {
|
480
|
+
returnedFromServer = false;
|
481
|
+
execFlowIdx = -1;
|
482
|
+
}
|
483
|
+
}
|
484
|
+
if (execFlowIdx !== -1) {
|
485
|
+
executeBlock = true;
|
486
|
+
oper = this._operationTab.getOperation(execFlowIdx);
|
487
|
+
if (returnedFromServer) {
|
488
|
+
if (this._operationTab.getOperation(oper.getBlockClose()).getServerId() <= nextOperIdx) {
|
489
|
+
executeBlock = false;
|
490
|
+
blockIfReturnedFromServer = true;
|
491
|
+
}
|
492
|
+
}
|
493
|
+
if (executeBlock) {
|
494
|
+
retvals = await this.executeOperations(execFlowIdx + 1, oper.getBlockClose() - 1, taskEnd, mgdID, depth + 1, isChangedCurrWndRef, true, returnedFromServer, nextOperIdx);
|
495
|
+
if (retvals !== null)
|
496
|
+
if (!retvals.ReturnedFromServer)
|
497
|
+
return retvals;
|
498
|
+
else {
|
499
|
+
returnedFromServer = retvals.ReturnedFromServer;
|
500
|
+
nextOperIdx = retvals.NextOperIdx;
|
501
|
+
blockIfReturnedFromServer = retvals.BlockIfReturnedFromServer;
|
502
|
+
execFlowIdx = oper.getBlockEnd() - 1;
|
503
|
+
continue;
|
504
|
+
}
|
505
|
+
}
|
506
|
+
}
|
507
|
+
execFlowIdx = oper.getBlockEnd() - 1;
|
508
|
+
break;
|
509
|
+
case ConstInterface.MG_OPER_ENDBLOCK:
|
510
|
+
await flowMonitor.addFlowFieldOperation(oper, true, this._task.GetTaskDetails());
|
511
|
+
break;
|
512
|
+
case ConstInterface.MG_OPER_CALL:
|
513
|
+
this._task.setUseLoopStack(depth > 0);
|
514
|
+
routeOperationExecuted = await oper.execute(returnedFromServer);
|
515
|
+
break;
|
516
|
+
default:
|
517
|
+
this._task.setUseLoopStack(depth > 0);
|
518
|
+
await oper.execute(returnedFromServer);
|
519
|
+
break;
|
520
|
+
}
|
521
|
+
if (!blockIfReturnedFromServer) {
|
522
|
+
nextOperIdx = AccessHelper.eventsManager.getNextOperIdx(oper, true);
|
523
|
+
if (nextOperIdx > -1) {
|
524
|
+
returnedFromServer = true;
|
525
|
+
if (inBlockIf)
|
526
|
+
blockIfReturnedFromServer = true;
|
527
|
+
}
|
528
|
+
else
|
529
|
+
returnedFromServer = false;
|
530
|
+
}
|
531
|
+
}
|
532
|
+
if (routeOperationExecuted)
|
533
|
+
retvals = new RetVals(false, true);
|
534
|
+
else if (blockIfReturnedFromServer)
|
535
|
+
retvals = new RetVals(nextOperIdx, returnedFromServer, blockIfReturnedFromServer);
|
536
|
+
else
|
537
|
+
retvals = null;
|
538
|
+
return retvals;
|
539
|
+
}
|
540
|
+
async getSignificantBlock(startBlockIdx, endIdx) {
|
541
|
+
let retIdx = -1;
|
542
|
+
while (startBlockIdx < endIdx) {
|
543
|
+
let oper = this._operationTab.getOperation(startBlockIdx);
|
544
|
+
let operType = oper.getType();
|
545
|
+
if (operType !== ConstInterface.MG_OPER_BLOCK && operType !== ConstInterface.MG_OPER_ELSE && operType !== ConstInterface.MG_OPER_SERVER)
|
546
|
+
break;
|
547
|
+
if (await oper.execute(false)) {
|
548
|
+
retIdx = startBlockIdx;
|
549
|
+
break;
|
550
|
+
}
|
551
|
+
else
|
552
|
+
startBlockIdx = oper.getBlockClose();
|
553
|
+
}
|
554
|
+
return retIdx;
|
555
|
+
}
|
556
|
+
getStartBlockIdxByEnd(endIdx) {
|
557
|
+
let retIdx = -1;
|
558
|
+
let found = false;
|
559
|
+
let j;
|
560
|
+
for (j = endIdx - 1; j >= 0 && !found; j--) {
|
561
|
+
let oper = this._operationTab.getOperation(j);
|
562
|
+
let operType = oper.getType();
|
563
|
+
if (operType === ConstInterface.MG_OPER_BLOCK || operType === ConstInterface.MG_OPER_LOOP) {
|
564
|
+
if (oper.getBlockEnd() === endIdx) {
|
565
|
+
retIdx = j;
|
566
|
+
found = true;
|
567
|
+
}
|
568
|
+
}
|
569
|
+
}
|
570
|
+
return retIdx;
|
571
|
+
}
|
572
|
+
getStartBlockIdxByElse(elseIdx) {
|
573
|
+
let retIdx = -1;
|
574
|
+
let found = false;
|
575
|
+
let elseBlockEnd = this._operationTab.getOperation(elseIdx).getBlockEnd();
|
576
|
+
let j;
|
577
|
+
for (j = elseIdx - 1; j >= 0 && !found; j--) {
|
578
|
+
let oper = this._operationTab.getOperation(j);
|
579
|
+
let operType = oper.getType();
|
580
|
+
if (operType === ConstInterface.MG_OPER_BLOCK) {
|
581
|
+
if (oper.getBlockEnd() === elseBlockEnd) {
|
582
|
+
retIdx = j;
|
583
|
+
found = true;
|
584
|
+
}
|
585
|
+
}
|
586
|
+
}
|
587
|
+
return retIdx;
|
588
|
+
}
|
589
|
+
getStartBlockIfIdxByOper(blockOperIdx, srvrOperIdx) {
|
590
|
+
let retIdx = -1;
|
591
|
+
let found = false;
|
592
|
+
let j = this._operationTab.serverId2operIdx(srvrOperIdx, blockOperIdx) - 1;
|
593
|
+
if (j === -2) {
|
594
|
+
j = this._operationTab.serverId2FollowingOperIdx(srvrOperIdx, blockOperIdx) - 1;
|
595
|
+
}
|
596
|
+
while (j >= 0 && !found) {
|
597
|
+
let oper = this._operationTab.getOperation(j);
|
598
|
+
let operType = oper.getType();
|
599
|
+
if (operType === ConstInterface.MG_OPER_BLOCK) {
|
600
|
+
if (j === blockOperIdx) {
|
601
|
+
retIdx = j;
|
602
|
+
found = true;
|
603
|
+
}
|
604
|
+
else
|
605
|
+
j--;
|
606
|
+
}
|
607
|
+
else if (operType === ConstInterface.MG_OPER_ELSE) {
|
608
|
+
let blockStrt = this.getStartBlockIdxByElse(j);
|
609
|
+
if (blockStrt === blockOperIdx) {
|
610
|
+
retIdx = j;
|
611
|
+
found = true;
|
612
|
+
}
|
613
|
+
else
|
614
|
+
j = blockStrt - 1;
|
615
|
+
}
|
616
|
+
else if (operType === ConstInterface.MG_OPER_ENDBLOCK)
|
617
|
+
j = this.getStartBlockIdxByEnd(j) - 1;
|
618
|
+
else
|
619
|
+
j--;
|
620
|
+
}
|
621
|
+
return retIdx;
|
622
|
+
}
|
623
|
+
getLevel() {
|
624
|
+
return this._level;
|
625
|
+
}
|
626
|
+
getEvent() {
|
627
|
+
return this._evt;
|
628
|
+
}
|
629
|
+
getId() {
|
630
|
+
return this._id;
|
631
|
+
}
|
632
|
+
async isEnabled() {
|
633
|
+
return await this._enabledExp.getVal();
|
634
|
+
}
|
635
|
+
async resetLocalVariables(args) {
|
636
|
+
let dv = this._task.DataView;
|
637
|
+
let argIdx = 0;
|
638
|
+
try {
|
639
|
+
for (let fieldIdx = this._dvPos; fieldIdx < this._dvPos + this._dvLen; fieldIdx++) {
|
640
|
+
let aField = dv.getField(fieldIdx);
|
641
|
+
let varIsParm = !this._hasParameters || aField.isParam();
|
642
|
+
if ((args !== null && argIdx < args.getSize()) && varIsParm) {
|
643
|
+
if (!args.getArg(argIdx).skipArg()) {
|
644
|
+
await args.getArg(argIdx).setValueToField(aField);
|
645
|
+
}
|
646
|
+
else {
|
647
|
+
aField.invalidate(true, FieldBase.CLEAR_FLAGS);
|
648
|
+
await aField.compute(false);
|
649
|
+
}
|
650
|
+
argIdx++;
|
651
|
+
}
|
652
|
+
else {
|
653
|
+
aField.invalidate(true, FieldBase.CLEAR_FLAGS);
|
654
|
+
await aField.compute(false);
|
655
|
+
}
|
656
|
+
await aField.updateDisplay();
|
657
|
+
}
|
658
|
+
}
|
659
|
+
catch (exception) {
|
660
|
+
throw exception;
|
661
|
+
}
|
662
|
+
}
|
663
|
+
async getArgValsFromFlds(args) {
|
664
|
+
let dv = this._task.DataView;
|
665
|
+
let k = 0;
|
666
|
+
let j;
|
667
|
+
for (j = this._dvPos; j < this._dvPos + this._dvLen && k < args.getSize(); j++) {
|
668
|
+
let aField = dv.getField(j);
|
669
|
+
if (!this._hasParameters || aField.isParam()) {
|
670
|
+
let arg = args.getArg(k);
|
671
|
+
if (arg.getType() === ConstInterface.ARG_TYPE_FIELD) {
|
672
|
+
let argFld = arg.getField();
|
673
|
+
if (argFld.getTask() !== null && !argFld.getTask().isAborting()) {
|
674
|
+
let val = aField.getValue(false);
|
675
|
+
await argFld.setValueAndStartRecompute(val, aField.isNull(), true, aField.isModified(), false);
|
676
|
+
await argFld.updateDisplay();
|
677
|
+
}
|
678
|
+
}
|
679
|
+
k++;
|
680
|
+
}
|
681
|
+
}
|
682
|
+
}
|
683
|
+
getTask() {
|
684
|
+
return this._task;
|
685
|
+
}
|
686
|
+
argsMatch(Exp_params) {
|
687
|
+
let argsMatched = true;
|
688
|
+
let dv = this._task.DataView;
|
689
|
+
let j = 0;
|
690
|
+
let paramCount = 0;
|
691
|
+
for (let i = this._dvPos; i < this._dvPos + this._dvLen; i++) {
|
692
|
+
let field = dv.getField(i);
|
693
|
+
if (field.isParam()) {
|
694
|
+
paramCount++;
|
695
|
+
if (j < Exp_params.length) {
|
696
|
+
let fieldAttr = field.getType();
|
697
|
+
let argAttr = Exp_params[j].Attr;
|
698
|
+
if (!Exp_params[j].IsNull && !StorageAttributeCheck.isTheSameType(fieldAttr, argAttr) && !StorageAttributeCheck.StorageFldAlphaUnicodeOrBlob(fieldAttr, argAttr)) {
|
699
|
+
argsMatched = false;
|
700
|
+
break;
|
701
|
+
}
|
702
|
+
j++;
|
703
|
+
}
|
704
|
+
}
|
705
|
+
}
|
706
|
+
if (paramCount !== Exp_params.length) {
|
707
|
+
argsMatched = false;
|
708
|
+
}
|
709
|
+
return argsMatched;
|
710
|
+
}
|
711
|
+
getOperationTab() {
|
712
|
+
return this._operationTab;
|
713
|
+
}
|
714
|
+
getControlNameForControlHeader() {
|
715
|
+
if (this.getEvent().getType() == ConstInterface.EVENT_TYPE_INTERNAL) {
|
716
|
+
if (this.getEvent().isControlHeader() && !isNullOrUndefined(this._ctrl))
|
717
|
+
return this.getCtrlName();
|
718
|
+
}
|
719
|
+
return NString.Empty;
|
720
|
+
}
|
721
|
+
getVarNameForVariableHeader() {
|
722
|
+
if (this.getEvent().isVariableHeader() && !isNullOrUndefined(this._handlerFld))
|
723
|
+
return this._handlerFld.getVarName().toUpperCase();
|
724
|
+
return NString.Empty;
|
725
|
+
}
|
726
|
+
getEventHandlerInfo() {
|
727
|
+
let eventDescription = new StringBuilder();
|
728
|
+
this.getEvent().AppendDescription(eventDescription);
|
729
|
+
let headerAdditionalInfo = this.getControlNameForControlHeader() + this.getVarNameForVariableHeader();
|
730
|
+
eventDescription.Append(headerAdditionalInfo);
|
731
|
+
if (!NString.IsNullOrEmpty(eventDescription.toString()))
|
732
|
+
eventDescription = new StringBuilder(' ' + eventDescription.toString(), eventDescription.toString().length + 1);
|
733
|
+
return NString.Format("Handler {0}{1}", this.getEvent().getEventType(), eventDescription);
|
734
|
+
}
|
735
|
+
toString() {
|
736
|
+
return NString.Format("(Handler for {0} on task {1}, scope {2})", this._evt, this._task, this._scope);
|
737
|
+
}
|
738
|
+
}
|
739
|
+
export class RetVals {
|
740
|
+
BlockIfReturnedFromServer = false;
|
741
|
+
Enabled = false;
|
742
|
+
NextOperIdx = 0;
|
743
|
+
Propagate = false;
|
744
|
+
ReturnedFromServer = false;
|
745
|
+
constructor(pOrOperIdx, eOrInReturnedFromServer, inBlockIfReturnedFromServer) {
|
746
|
+
if (arguments.length === 2)
|
747
|
+
this.constructor_0(pOrOperIdx, eOrInReturnedFromServer);
|
748
|
+
else
|
749
|
+
this.constructor_1(pOrOperIdx, eOrInReturnedFromServer, inBlockIfReturnedFromServer);
|
750
|
+
}
|
751
|
+
constructor_0(p, e) {
|
752
|
+
this.Propagate = p;
|
753
|
+
this.Enabled = e;
|
754
|
+
this.NextOperIdx = 0;
|
755
|
+
this.ReturnedFromServer = false;
|
756
|
+
this.BlockIfReturnedFromServer = false;
|
757
|
+
}
|
758
|
+
constructor_1(operIdx, inReturnedFromServer, inBlockIfReturnedFromServer) {
|
759
|
+
this.Propagate = false;
|
760
|
+
this.Enabled = true;
|
761
|
+
this.NextOperIdx = operIdx;
|
762
|
+
this.ReturnedFromServer = inReturnedFromServer;
|
763
|
+
this.BlockIfReturnedFromServer = inBlockIfReturnedFromServer;
|
764
|
+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bHNlLCAtMSk7XHJcbiAgICAgICAgICAgICAgaWYgKHJldHZhbHMgIT09IG51bGwpXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gcmV0dmFscztcclxuXHJcbiAgICAgICAgICAgICAgLy8gaWYgd2UgZ2V0IGEgcmV2ZXJ0IGluc2lkZSBhIGxvb3AsIGJyZWFrIHRoZSBsb29wXHJcbiAgICAgICAgICAgICAgaWYgKChtZ2QuSXNBYm9ydGluZyB8fCBBY2Nlc3NIZWxwZXIuZXZlbnRzTWFuYWdlci5HZXRTdG9wRXhlY3V0aW9uRmxhZygpKSlcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgICAgICB0aGlzLl90YXNrLmluY3JlYXNlTG9vcENvdW50ZXIoKTtcclxuICAgICAgICAgICAgICB0aGlzLl90YXNrLnNldFVzZUxvb3BTdGFjayh0cnVlKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIGlmIChhd2FpdCBvcGVyLmV4ZWN1dGUoZmFsc2UpKVxyXG4gICAgICAgICAgICAgIGJsb2NrTG9vcEV4ZWNvblNlcnZlciA9IHRydWU7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgICBpZiAoIWJsb2NrTG9vcEV4ZWNvblNlcnZlcilcclxuICAgICAgICAgIC8qXHJcbiAgICAgICAgICAgKiBPbmNlIHdlIGZpbmlzaCBleGVjdXRpbmcgdGhlIGxvb3AsXHJcbiAgICAgICAgICAgKiBpZiB3ZSBhcmUgbW92aW5nIGluIHRoZSBmb3J3YXJkIGRpcmVjdGlvbiwgbW92ZSB0byBCbG9ja0VuZC5cclxuICAgICAgICAgICAqL1xyXG4gICAgICAgICAgICBleGVjRmxvd0lkeCA9IG9wZXIuZ2V0QmxvY2tFbmQoKSAtIDE7XHJcbiAgICAgICAgICB0aGlzLl90YXNrLmxlYXZlTG9vcCgpO1xyXG4gICAgICAgICAgY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ICAgICAgbmV4dE9wZXJJZHggPSBBY2Nlc3NIZWxwZXIuZXZlbnRzTWFuYWdlci5nZXROZXh0T3BlcklkeChvcGVyLCB0cnVlKTtcclxuICAgICAgICAgICAgaWYgKG5leHRPcGVySWR4ID4gLTEpIHtcclxuICAgICAgICAgICAgICByZXR1cm5lZEZyb21TZXJ2ZXIgPSB0cnVlO1xyXG4gICAgICAgICAgICAgIGlmIChpbkJsb2NrSWYpXHJcbiAgICAgICAgICAgICAgICBibG9ja0lmUmV0dXJuZWRGcm9tU2VydmVyID0gdHJ1ZTtcclxuXHJcbiAgICAgICAgICAgICAgaWYgKG5leHRPcGVySWR4IDwgdGhpcy5fb3BlcmF0aW9uVGFiLmdldE9wZXJhdGlvbihvcGVyLmdldEJsb2NrRW5kKCkpLmdldFNlcnZlcklkKCkpIHtcclxuICAgICAgICAgICAgICAgIC8vIGZpbmQgdGhlIHNpZ25pZmljYW50IGJsb2NrIGluIHdoaWNoIHRoZSBuZXh0IG9wZXJhdGlvbiBpc1xyXG4gICAgICAgICAgICAgICAgd2hpbGUgKHRoaXMuX29wZXJhdGlvblRhYi5nZXRPcGVyYXRpb24ob3Blci5nZXRCbG9ja0Nsb3NlKCkpLmdldFNlcnZlcklkKCkgPCBuZXh0T3BlcklkeCkge1xyXG4gICAgICAgICAgICAgICAgICBleGVjRmxvd0lkeCA9IG9wZXIuZ2V0QmxvY2tDbG9zZSgpO1xyXG4gICAgICAgICAgICAgICAgICBvcGVyID0gdGhpcy5fb3BlcmF0aW9uVGFiLmdldE9wZXJhdGlvbihleGVjRmxvd0lkeCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgIHJldHVybmVkRnJvbVNlcnZlciA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgIGV4ZWNGbG93SWR4ID0gLTE7XHJcbiAgICAgICAgICAgIH1ccl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mV0dmFscy5SZXR1cm5lZEZyb21TZXJ2ZXIpXHJcbiAgICAgICAgICAgICAgICAgIHJldHVybiByZXR2YWxzO1xyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgIHJldHVybmVkRnJvbVNlcnZlciA9IHJldHZhbHMuUmV0dXJuZWRGcm9tU2VydmVyO1xyXG4gICAgICAgICAgICAgICAgICBuZXh0T3BlcklkeCA9IHJldHZhbHMuTmV4dE9wZXJJZHg7XHJcbiAgICAgICAgICAgICAgICAgIGJsb2NrSWZSZXR1cm5lZEZyb21TZXJ2ZXIgPSByZXR2YWxzLkJsb2NrSWZSZXR1cm5lZEZyb21TZXJ2ZXI7XHJcbiAgICAgICAgICAgICAgICAgIGV4ZWNGbG93SWR4ID0gb3Blci5nZXRCbG9ja0VuZCgpIC0gMTtcclxuICAgICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAvKlxyXG4gICAgICAgICAgICogT25jZSB3ZSBmaW5pc2ggZXhlY3V0aW5nIHRoZSBibG9jayxcclxuICAgICAgICAgICAqIGlmIHdlIGFyZSBtb3ZpbmcgaW4gdGhlIGZvcndhcmQgZGlyZWN0aW9uLCBtb3ZlIHRvIEJsb2NrRW5kLlxyXG4gICAgICAgICAgICogb3RoZXJ3aXNlLCBtb3ZlIHRvIEJsb2NrIElGXHJcbiAgICAgICAgICAgKi9cclxuICAgICAgICAgIGV4ZWNGbG93SWR4ID0gb3Blci5nZXRCbG9ja0VuZCgpIC0gMTtcclxuICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICBjYXNlIENvbnN0SW50ZXJmYWNlLk1HX09QRVJfRU5EQkxPQ0s6XHJcbiAgICAgICAgICBhd2FpdCBmbG93TW9uaXRvci5hZGRGbG93RmllbGRPcGVyYXRpb24ob3BlciwgdHJ1ZSwgdGhpcy5f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yYXRpb25UYWIuc2VydmVySWQyb3BlcklkeChzcnZyT3BlcklkeCwgYmxvY2tPcGVySWR4KSAtIDE7XHJcblxyXG4gICAgaWYgKGogPT09IC0yKSB7XHJcbiAgICAgIGogPSB0aGlzLl9vcGVyYXRpb25UYWIuc2VydmVySWQyRm9sbG93aW5nT3BlcklkeChzcnZyT3BlcklkeCwgYmxvY2tPcGVySWR4KSAtIDE7XHJcbiAgICB9XHJcblxyXG4gICAgd2hpbGUgKGogPj0gMCAmJiAhZm91bmQpIHtcclxuICAgICAgbGV0IG9wZXI6IE9wZXJhdGlvbiA9IHRoaXMuX29wZXJhdGlvblRhYi5nZXRPcGVyYXRpb24oaik7XHJcbiAgICAgIGxldCBvcGVyVHlwZTogbnVtYmVyID0gb3Blci5nZXRUeXBlKCk7XHJcbiAgICAgIGlmIChvcGVyVHlwZSA9PT0gQ29uc3RJbnRlcmZhY2UuTUdfT1BFUl9CTE9DSykge1xyXG4gICAgICAgIGlmIChqID09PSBibG9ja09wZXJJZHgpIHtcclxuICAgICAgICAgIHJldElkeCA9IGo7XHJcbiAgICAgICAgICBmb3VuZCA9IHRydWU7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2VcclxuICAgICAgICAgIGotLTtcclxuICAgICAgfVxyXG4gICAgICBlbHNlIGlmIChvcGVyVHlwZSA9PT0gQ29uc3RJbnRlcmZhY2UuTUdfT1BFUl9FTFNFKSB7XHJcbiAgICAgICAgbGV0IGJsb2NrU3RydDogbnVtYmVyID0gdGhpcy5nZXRTdGFydEJsb2NrSWR4QnlFbHNlKGopO1xyXG4gICAgICAgIGlmIChibG9ja1N0cnQgPT09IGJsb2NrT3BlcklkeCkge1xyXG4gICAgICAgICAgcmV0SWR4ID0gajtcclxuICAgICAgICAgIGZvdW5kID0gdHJ1ZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZVxyXG4gICAgICAgICAgaiA9IGJsb2NrU3RydCAtIDE7XHJcbiAgICAgIH1cclxuICAgICAg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