Tivoli Service Desk 6.0 Developer's Toolkit Script Programming Guide

Chapter 1:Developer's Toolkit Overview

Back to Table of Contents


New Features in Developer's Toolkit

What is Developer's Toolkit?

Developer's Toolkit is the development environment for the TSD Script programming language. Developer's Toolkit includes a set of tools that can be used to develop Developer's Toolkit applications. One of the tools referred to in this book is the IDE, or Integrated Development Environment. The IDE is used to create knowledgebase files.

Note: Detailed information about Developer's Toolkit can be found in the Developer's Toolkit Tools and Utilities Guide.

List of new features

Following are the new features included in Developer's Toolkit.
32-bit Windows support (Windows 95 and Windows NT) UNIX support (HP/UX) Tool Tips (balloon help) for menu toolbars Windows 95-style tabbed dialog boxes Smaller toolbar in Windows Support for Asian locales (DBCS support) Geometry Management for form creation A new user interface design tool that is identical for all platforms The ability to define menus, toolbars, and string tables in the user interface design tool Support for SMTP and POP mail protocols Support for CPIC in Windows

Introduction to TSD Script

What is TSD Script?

This chapter introduces TSD Script and the basic structure of applications that are built using this language. TSD Script is a block-structured, high-level programming language used by Developer's Toolkit. Programs are composed of a series of nested blocks, where each can have multiple sections.

The TSD Script language is:

Note: A Developer's Toolkit application that uses both mail and SQL can be written once and deployed to a number of different operating system, database management system, or mail protocol platforms.

Knowledgebases

Developer's Toolkit programs represent business rules and other forms of data in addition to procedural statement code. Thus, the modules of code in Developer's Toolkit are referred to as knowledgebases or .kb files.

Information forms

Information can exist in Developer's Toolkit in one of three forms:

Developer's Toolkit exchanges information in one of these three forms with external entities such as databases and user interfaces.

Data types

Information held in any external entity is determined by the data type assigned to it. Data types define the nature of a variable. Developers declare variables and determine the range of values a variable can take, as well as the operations that can be performed.

Some entities may hold only numbers, while others may hold strings of characters. The type assigned to the data remains through the life of the program, and is decided by the programmer.

Knowledgebase Conventions

Identifiers

Identifiers are the names used to refer to entities such as knowledgebases, constants, types, variables, and routines.

Note: Routines, as they are referred to in Developer's Toolkit, are procedures, functions, and other groups of Developer's Toolkit statements that can be executed within a program.

A Developer's Toolkit identifier begins with a letter (A through Z) or an underscore (_) and can be followed by any number of letters, digits (0 through 9), and underscores. Foreign language characters can not be used as identifiers in Developer's Toolkit.

Use of quotes

In Developer's Toolkit, all strings are surrounded by single quotes (or apostrophes). To include a single quote (or apostrophe) in a Developer's Toolkit string literal, you must include two single quotes. For example, to assign the string "Tom's Place" to a Developer's Toolkit variable, you must insert the following:

s := 'Tom''s Place';

Comments

Any comments regarding a constant should be surrounded by comment characters "(*" and "*)" or "--". For example:

(*This is a comment*) 
--This is a comment 

Required naming conventions

The file name of every knowledgebase has a .kb extension. The file name must also be the same as the name of the knowledgebase. If a knowledgebase has more than eight characters, the file name must contain the first eight characters in Windows and OS/2 (UNIX file names may be longer). For instance, a knowledgebase named "example" is stored in a file called "EXAMPLE.KB." A knowledgebase named "example1A" is stored in a file called example1.kb.

Caution: Because UNIX is case-sensitive, file names and knowledgebase names should have the same case. The .kb extension is always lowercase.

Optional naming conventions

The following naming conventions are suggested, but not required, for proper Developer's Toolkit syntax.

Constant names are usually upper case and use underscores between words. For example:

MAX_VALUES

Type names and procedures are mixed-cased, beginning with an upper case letter. There are no underscores. Instead, combined words begin with upper case letters. For example:

EmployeeRecord, PersonHistoryList 

The first word in a variable name should always be lower case.

myFile 

If you choose to use underscores, all letters of your variable name should be lower case. If you do not use underscores, the first letter of each word should be capitalized. For example:

current_employee, currentEmployee


Major Sections

Introduction

Every knowledgebase begins with the keyword KNOWLEDGEBASE followed by its name and a semi-colon. In addition, there are two major required sections in all knowledgebases:

The KNOWLEDGEBASE keyword indicates the start of the public section and the PRIVATE keyword indicates the start of the private section, as shown in this example:

KNOWLEDGEBASE Example;
  ... 
PRIVATE 
  ... 

Public sections

Declarations of constants, data types, variables, and routines can be made available for other knowledgebases. Available routines appear in the public section and are used in the private section. Routines are the only entities that other knowledgebases can access in the private section.

The Developer's Toolkit keyword, USES, allows one module to make use of public identifiers declared in another knowledgebase. The last public routine declared in a knowledgebase automatically executes when a program runs.

Private sections

The private section of a knowledgebase can also contain declarations of constants, data types, routines, and variables. These declarations are available only in that knowledgebase.

Minor Sections

Optional sections

There are several minor, optional sections that can occur in any order in a public or private section of a knowledgebase:

Knowledgebase Example

The following is a simple example of a knowledgbase.

KNOWLEDGEBASE Example; 
 (*begins public section*) 
   CONSTANTS 
     MAX_EMPLOYEES IS 500;
   VARIABLES 
     total: INTEGER;
   ROUTINES 
     PROCEDURE PrintEmployeeInfo(VALUE 
                                 whichEmployee:Integer);
PRIVATE
(*begins private section*)
  CONSTANTS 
    ARRAY_SIZE IS 1000;
  VARIABLES 
   Employees: ARRAY[ARRAY_SIZE] OF String;
  ROUTINES
    PROCEDURE SendStringToPrinter(VALUE s: String) IS
       ... 
    END; 
    PROCEDURE EjectPageFromPrinter IS
       ... 
    END; 
    PROCEDURE PrintEmployeeInfo(VALUE 
                              whichEmployee:Integer)IS
    ACTIONS
       SendStringToPrinter(employee[whichEmployee]);
       EjectPageFromPrinter;
    END;
END;

Identifier examples

The preceding knowledgebase declares three identifiers in its public section:

Constant, variable, and procedure examples

The private section also contains:

USES example

Another knowledgebase could make use of the public information MAX_EMPLOYEES, total, and PrintEmployeeInfo in Example.kb by adding the line,

USES Example; 

after its KNOWLEDGEBASE keyword.


Tivoli Service Desk 6.0 Developer's Toolkit Script Programming Guide

Back to Table of Contents

Copyright