OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
A-1
A
TAL Program Example
-----------------------------------------------------------------------------
--
-- Description: This program shows how a client program, operating
-- through a NORMAL type GPI gateway, calls each GPI procedure. It opens a
-- session, creates a root object, transfers the root object out, transfers
-- the root object back in, shows values of root object attributes, then
-- closes the session. For purposes of a simple example, some procedures
-- may be called in a slightly different context from their normal use. In
-- addition, the program assumes the root object transferred in is the same
-- as that which was transferred out.
--
-- The program sequence is as follows:
--
-- - Start program and enter main
-- - CALL GPI_INITIALIZE_
-- - CALL GPI_OPEN_
-- - CALL build_root_object (a procedure local to this example)
-- - CALL GPI_MT_TRANSFER_OUT_
-- - CALL GPI_MT_WAIT_
-- - CALL GPI_MT_START_TRANSFER_IN_
-- - CALL show_message (a procedure local to this example)
-- - CALL GPI_MT_FINISH_TRANSFER_IN_
-- - CALL GPI_CLOSE_
-- - Terminate program
--
-- The build_root_object procedure shows how to build a root object. It
-- does the following:
--
-- - Creates the root object
-- - Creates and inserts the bilateral information
-- - Creates and inserts the content
-- - Creates and inserts the external trace
-- - Creates and inserts the mts identifier
-- - Creates and inserts the original eits
-- - Creates and inserts the originator name
-- - Creates and inserts the recipient descriptor
--
-- Each action is handled by a lower-level procedure. Each creates a
-- subobject, fills it with attributes, and inserts it into the root
-- object. Some of the subobjects are created with the initialize flag
-- set; as a result, these objectsare filled with default first-level
-- attributes.
--
-- The show_message procedure shows how to inspect an inbound root object.
-- It gets the class of the inbound root object (message class) and
-- displays:
--
-- - All root level attributes that are not objects
-- - Bilateral information
-- - Interpersonal message (P2 content)
-- - External trace entry
-- - MTS identifier
-- - EITS
-- - OR name
-- - Message recipient descriptor
-- - Message recipient OR name (assuming certain attributes are used)
--