OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide
Writing Your Program
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
5-2
Developing Program Structure
The GPI portion of a client program consists of a sequence of calls to GPI environment
management, object management, and message transfer procedures. The GPI
procedures and supporting code are bound to the client program either at bind time or at
run time. Specifically, the GPI library components can be:
•
Bound to the client program after the client program is compiled
•
Bound to the client program at run time as a LIB option of the TACL RUN
command
The sequence of GPI procedures is listed in Table 5-1. As shown, each procedure or
group of procedures is associated with a gateway task. The tasks are listed in an order
that applies to most gateway scenarios. For purposes of a simple listing, outbound and
inbound tasks are grouped in this table as if they are part of the same session. However,
as mentioned previously, outbound and inbound processing might or might not be done
in the same session.
After a GPI workspace and session have been established, the gateway can do outbound
or inbound processing. In the table, outbound processing consists of Tasks 3 and 4;
inbound processing consists of tasks 5 through 8.
Note that the table does not show the looping that typically occurs during outbound or
inbound processing. For instance, it does not show that the tasks of building and
transferring an outbound root object typically are repeated until all proprietary messages
have passed through the gateway.
Figure 5-1 shows the sequence in the form of a flow diagram. The diagram is repeated
from Figure 2-1
on page 2-3, where it introduced the GPI procedures.
As described in Section 2, The GPI Library
, object management procedures are of four
types: composing procedures, decomposing procedures, inspecting procedures, and a
copying procedure. Any of these procedures can be used for outbound processing. For
Table 5-1. Sequence of GPI Procedures
Task Explanation GPI Procedure(s) Used
1 Initialize GPI library memory space GPI_INITIALIZE_
2 Open GPI session GPI_OPEN_
3 Build a root object GPI_OM_xxx_
4 Transfer out a root object GPI_MT_TRANSFER_OUT_
5 Initiate transfer-in of a root object GPI_MT_WAIT_ ,
GPI_MT_START_TRANSFER_IN_
6 Retrieve information from a root object GPI_OM_xxx_
1
7 Finish transfer-in of a root object GPI_MT_FINISH_TRANSFER_IN_
8 Edit a root object GPI_OM_xxx_
9 Close GPI session GPI_CLOSE_
1
GPI_STATUS_ can be used anytime after successful return of GPI_INITIALIZE_ .
2
Object is unmodifiable at this stage; only inspecting and copying procedures can be used.