In this chapter you will be presented with an initial overview of programming UTM applications. You will learn what services and program units are and how you can apply the openUTM concepts to implement the business logic of your applications.
A UTM application provides your users with certain services: it processes service requests (jobs) which are sent by terminal users, client programs or other applications.
A service serves to process a job from a UTM application. It consists of one or more transactions and one or more program runs. openUTM differentiates between dialog services and asynchronous services. A UTM service generally corresponds to a business transaction of the application logic.
When you design an application you program the business transactions of the application logic in the form of program units, also called service routines. The program units run as subprograms and are under the control of the main routine of a UTM application; the main routine is a component of the openUTM system code.
You specify the task of the service you wish to provide the users of your application with in the business logic implemented in the program units. The program units can be programmed in one of the common programming languages (C, C++, COBOL and others).
You can access UTM system functions and external resource managers such as databases from within the program units. The program units utilize the UTM system functions using integrated UTM calls, e.g. for transaction management or to send messages to a communication partner.
You can use various interfaces for these UTM calls: In addition to the KDCS interface described in this manual you can also use the X/Open interfaces CPI-C, XATMI and TX (see the openUTM manual “Creating Applications with X/Open Interfaces”).
In addition, openUTM provides you with the UTM-HTTP program interface functions that you can use when communicating with HTTP clients. These are described in the chapter "UTM-HTTP Calls".
Characteristics of the KDCS interface
The KDCS interface (compatible data communication system) has been defined and standardized (DIN 66 265) as a manufacturer-independent interface for transaction-oriented applications. openUTM supports the full extent of this standard and offers significant extensions, e.g. for distributed processing. For an overview of these extensions refer to the table in chapter "Complete overview of KDCS calls".
KDCS possesses the following function characteristics:
extensive range of function calls for universal use
(e.g. also for pseudo conversations, message queuing or direct communication with terminals)KDCS specific storage area for simple and safe programming
event functions for event control
KDCS is available for the C, C++ and COBOL programming languages;
on BS2000 systems, it is also available for Assembler, Fortran, PL/I and Pascal-XT.
UTM application program - UTM application
A UTM application program consists of the UTM main routine KDCROOT and the UTM program units.
The main routine KDCROOT controls the flow of the application as part of the UTM system code. It is created when the application is generated (see the openUTM manual “Generating Applications”).
In order to run the UTM program units under openUTM management, you have to link the compiled service routines, together with other modules (assignment tables, messages, used libraries, etc.) and the main routine KDCROOT to the UTM application program (see the openUTM manual “Using UTM Applications on BS2000 Systems” and the openUTM manual “Using UTM Applications on Unix, Linux and Windows Systems”).
The linking can be done statically (i.e. before the application is started) or dynamically (i.e. when the application is started or during its operation).
At UTM application startup the UTM application is started in a number of processes which is specified by you. From a technical point of view, the UTM application is therefore a processing group which constitutes a logical server unit at runtime.
Figure: Main routine KDCROOT and multiple program units
The program units and the main routine KDCROOT interact via KDCS calls. In a program unit, the KDCS calls are used to inform the main routine KDCROOT which function openUTM is to perform. You use the KDCS parameter area to specify the necessary entries and pass its address as the first parameter with each KDCS call.
Predefined language-specific data structures enable you to structure the KDCS parameter area, in COBOL these are located in the KCPAC COPY element and in C/C++ in the kcmac.h include file. For a language-independent description of the value to be entered in this area for the individual KDCS calls refer to chapter "KDCS calls". For language-specific particularities refer to the chapters "Additional information for C/C++" and "Additional information for COBOL".
The sections below explain the way in which you can structure an application program.