The MOVEit Automation standard functionality provides you with the features and functions to automate almost any file movement task. In addition to this, you can employ macros and parameters to apply basic customization, or utilize built-in scripts to add additional functionality. However, to create a task that performs actions that require advanced customizations, you may need a custom script. For more information about how traditional and advanced task files are processed when moving from a source to a destination, see Key Processing Concepts.
Custom scripts allow you to write custom code to interact with MOVEit Automation in a fundamental way. This allows the script to add custom logic to a task, making the task capable of performing advanced functionality which can interact with files as they move from source to destination if required. For example, a custom script can read a file and take special actions after it is downloaded from a source but before it is moved to a destination.
MOVEit Automation integrates with VBScript and PowerShell scripting languages, both of which are included in Microsoft Windows Server. Using these languages MOVEit Automation harnesses the ability of PowerShell to interface with .Net or VBScript's ability to interface with Microsoft's COM.
Custom script use examples
Data transformation. For example, converting files from CSV to JSON, or from XML to JSON.
Web/REST services integration. For example, PowerShell can call Web Services in a single line of code. A custom script might read some data from a file downloaded from a source, call a REST service with that data, get some return data, and then modify the original file or create a new one, and let it continue on to a destination.
Integrate with external databases. Similar to interfacing with Web Services, VBScript and PowerShell can perform queries against databases and use the results of those queries as part of the logic of a script. Or, they can use the results of those queries as data to create a new file that can be copied to a destination.
Fundamentals of using custom scripts
To begin using custom scripts, you must grasp a few high-level concepts that will give you an understanding of the tools that you can use to perform your custom logic.
Just like built-in scripts, custom scripts work inside process steps. Wherever you can add a Process, you can run a custom script. Since they are based on a process, they can be executed in loops, which executes the script for every file as it moves from source to destination. Alternatively, they can be run outside of a loop. In a Traditional task, this is done by selecting the run once option for the process. In this case, the process and and its custom script are executed after the files are downloaded from a source into the cache but before any other processing occurs and before any files are moved to their destination. In an Advanced task, a process and its custom script can be put almost anywhere in the task steps.
Custom scripts can utilize task and global parameters. All MOVEit Automation tasks can have parameters associated to them. They are like variables. When a custom script is executing, it can read the value of these parameters, and take action based on those values, just like any VBScript or PowerShell script might use a local variable. In this way, you can pass in data to the custom script. The parameters can be changed, and can be used in another part of the task. Any changes that you make to a parameter only last for that particular task run.
Custom scripts can utilize macros.
Custom scripts can utilize MI Functions ("em-eye"). MOVEit Automation ships with a standard set of special functions that allow a custom script to interact with the MOVEit service directly. Among other things, these functions allow the user to add, delete, and modify files in the current task as files move from source to destination.