Guardian Programmer's Guide

Table Of Contents
Writing a Server Program
Guardian Programmer’s Guide 421922-014
22 - 28
The Process-Order Server ($SER2)
22 Writing a Server Program
The Process-Order Server ($SER2)
Figure 22-4 shows the function of each procedure in the process-order server and the
relationships among the procedures.
As you can see from Figure 22-4, the structure of the process-order server is similar to
that of the part-query server. The SERVER procedure and the procedures for handling
system messages are the same as for the part-query server. The differences are in
the PROCESS^USER^REQUEST procedure.
The user message read by the SERVER procedure contains information needed to
process an order request. This information includes the part number and quantity of
the requested item, and the name, address, and credit-card number of the customer.
If the requester process is in the opener table, then the PROCESS^USER^REQUEST
procedure modifies the application database as follows:
It retrieves the part record from the inventory file and checks that there are enough
items in stock to satisfy the request. If so, the PROCESS^USER^REQUEST
procedure updates the part record with the new stock level. If there is not enough
stock to satisfy the request, then the procedure returns to the SERVER procedure
Figure 22-4. Relationship Between Major Procedures in the Process-Order
Server
VST111.VSD