Edit Global Scripts
Select a script type from the drop-down menu and edit the script in the text area below. There is also a Reference List to the right for easy drag-and-drop of common helper methods / code templates.
The following global script types can be edited:
- Deploy Script: This script executes once whenever any channel or set of channels deploys. You have access to the global / configuration maps here. Typically this script is used to perform a one-time operation, such as loading a properties file from disk, or instantiate a database connection.
- Undeploy Script: This script executes once whenever any channel or set of channels is undeployed. You have access to the global / configuration maps here. Typically this script is used to cleanup any data created from the deploy script, such as closing a database connection.
- Preprocessor Script: This script applies across all channels, and executes once for every message, after the attachment handler has run but before the message reaches the source filter/transformer. You have access to "message", a string variable containing the incoming data. Whatever you return from the preprocessor script will be stored as the Processed Raw content and used to feed into the source filter/transformer. First the global preprocessor is executed and then the channel-level preprocessor.
- Post Processor Script: This script applies across all channels, and executes once for every message, after all destinations have completed processed (not including queued messages which are processed asynchronously). You have access to "message", which is an ImmutableMessage object containing information about the state of all connector messages. The channel-level postprocessor script will execute first, and then the global postprocessor. If the channel-level post processor returned a response, it is available as the variable "response" in the global post processor. This script may be used as a general tool to perform a custom cleanup script. It can also be used to return a custom response that is sent back to the originating system.