Creating a custom activity
CatTools provides a facility to create your own custom activities and activity script files should the CatTools built-in activities not suffice your requirements.
A reasonable understanding or experience of Visual Basic Scripting is assumed in order to successfully add custom scripts to CatTools.
The help file documentation and comments within the example code template files found in the
/Templates sub folder of the CatTools root directory, should provide a reasonable level of assistance for a technically competent novice to follow.
To add support for a custom activity in CatTools, four files are required. Three activity files and one custom device file:
- The activity type file (.ini file), which defines the following:
- The activity main script file (.txt file), which contains code to read the activity options from the CatTools database, prepare folders and files to store output data, set variables, marshal the CatTools Client threads and do any post processing of results in order to create reports or send messages to the CatTools main program.
- The activity client script file (.txt file), which contains a number of common function calls to the device scripts, i.e. the scripts that send device specific commands in order to get the device to log in, issue the commands required to perform the activity, then log out of the device again.
The device script file - .custom file - which contains device type specific code for the custom activity, such as the commands to send to the device and any parsing of the data before sending the results back to the client activity script.
The activity client and main script files also contains function calls and references to variables within the internal CatTools program code. These are prefixed with
cl. in the client script and
ct. in the main script. A list of these
ct. functions and variables have also been made available within this chapter to help assist in the development of your custom activity scripts.
- How to create a custom activity - a simple step-by-step guide on how to create a custom activity.
- The custom activity type file (.ini) - information and how to create the custom activity type file.
- The custom activity main script file (.txt) - information and how to create the custom activity main script file.
- The custom activity client script file (.txt) - information and how to create the custom activity client script file.
- The custom activity device script file (.custom) - information and how to create the custom activity device script file.
- cl. / ct. variables and functionsClient script - cl. variables and functions.htm - information on the CatTools internal variables and functions exposed to the custom activity script files.
- Testing your custom activity - help and tips on testing your custom activity.