Is it possible to change the available gateway scripting functions on the fly after the module has come up and initializeScriptManager() has already been called? If so, how would one go about achieving this?
To make this more clear, I am working on a project with many scripting functions that we initialize and make available through the normal method of overriding initializeScriptManager() and then using manager.addScriptModule() to add the modules. This works great, but we are working on a new feature where we may only want to expose certain functions on the gateway based on other settings in the system that can be changed in the gateway web page at any time. I can easily set things up so that the right functions are conditionally added and made available based on the settings at the time initializeScriptManager() is called on module startup, but I can’t figure out how to change it later. I tried playing with the clearModule() and clearThirdPartyModule() methods of ScriptManager, but they had no discernible effect on which functions were available when I tested the intellisense within a gateway event script.
If it is simply set at initializeScriptManager() and cannot be changed dynamically later, we will probably have to document that a module restart is required for certain changes to take effect.
Another separate but related question which came up while playing with this and debugging… I noticed initializeScriptManager() being called on our gateway module 6 times with different script managers and I am curious what each of these may be or what the different types are. I understand that one is for the gateway context and is the same as what would be returned by GatewayContext.getScriptManager(), but I don’t know what the others are.
Thank you!