Scripts & Routines
Routines are small programs that run at different trigger points within Umango and carry out unique, custom tasks. Umango scripts are very flexible as they can be written in almost any programming language and can be compiled to an executable or run as a batch file or VBS script etc. Using scripting does require a more advanced user that is familiar with the basics of programming in order to write and implement a routine. However, it also provides an extremely flexible way of facilitating very unique and specific requirements.
Routines and scripts fall into 3 main categories based on their trigger point.
- User Authentication - An event that that occurs when a user logs into Umango
- Zone Events - A group of events that relate to zone processing
- Export Events - A group of events that relate to batch exporting
Script arguments can be passed when the script is launched. This enabled the script to receive data as line arguments or program switches. Select the arguments to pass into the script by clicking the Select Arguments button. You will then be prompted with a dialog to build the argument list.
Building a List or Program Arguments
Using the available merge field, data can be selected for inclusion in each of the program arguments. Simply search or build the data required and select the Add button.
Custom Authentication Scripts
A custom user authentication can be used to validate user credentials in a way that is unique to your organization or is not a simple Windows/Domain authentication.
Authentication scripts receive 4 standard arguments that are passed. These are:
- Username - The user name enter by the user at the login screen
- Password - The user password entered by the user at the login screen
- Domain - The domain name portion of the user name entered by the user at the login screen (eg. userDomain\username would result in the domain userDomain being returned)
- SourceIP - The IP4 address of the device where the user attempted to login
An example authentication script is seen below. In this example, the username will always be set as as the username entered if their authentication details are valid.
Sample Authentication Script
Custom Zone Scripts
Zone routines can be run at two different events in the zone processing workflow. These are On-Change and On-Save.
On-Change Routines
A script can be run when the user types a value or any value is changed. Console output from the script is then displayed to the user during manual processing. Typical uses for this routine might be:
- Process complex validation tests and advise the user of results.
- Run some checks and then present to the user information that might affect how they process a related index.
Note that this routine cannot change the index value, however, it can return a message to the user.
Sample On Change Script
On-Save Routines
A script can also be run when a typed or extracted value is saved. This enables the user to type in a value, save it, and then have the script return a different value. Console output from the script is then saved as the zone value.
Sample On Save Script
Some typical uses for this routine might be:
- Clean up of data
- Replace characters (find any @ symbol and replace it with [at])
- Perform a complex database interrogation to determine a zone value.
Custom Export Routines
Export routines run at the time documents are exported as part of the batch processing workflow.
Export routines have four different trigger points:
- On-Index (Run after each index) - Runs for each zone, of each document in the batch
- On-Document (Run after each document) - Runs when the document has exported
- On-Batch (Run after each batch) - Runs after the batch has completed and closed
- On-Failure (Run after document export fails) - Runs only if an export error occurs
Custom export routines can be run to process documents or related index values when batches are exported. These can be helpful in carrying out special functions that are required during export that may otherwise not be possible. Typical uses might be to insert index values into databases, make changes to documents, rename or move files etc.
Sample Export Script