Documentation forKiwi CatTools

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.

Prerequisites

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.

Overview

To add support for a custom activity in CatTools, four files are required. Three activity files and one custom device file:

Activity files

  1. The activity type file (.ini file), which defines the following:
    • activity name
    • activity ID
    • activity main script filename (associated with the activity)
    • activity client script filename (associated with the activity)
    • the user interface field values and defaults which are displayed in the activity form Options tab when adding or editing an activity.
  2. 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.
  3. 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.

Device file

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 cl. and ct. functions and variables have also been made available within this chapter to help assist in the development of your custom activity scripts.