TRANSFER Programming Manual

Sample Agent Functional Description
Designing and Writing an Agent
069138, Update 1 to 040970 Tandem Computers Incorporated 10–13
A Sample TRANSFER
Agent
The TRANSFER program described on the following pages is an example of a very
simple agent that performs the following operations:
Forwards each package received at the depot to which it is attached to another
correspondent
Removes the package from the depot's INBOX folder
Acknowledges receipt of the package
The correspondent to whom the package should be forwarded is specified through the
Agent Selection function in the ADMIN application. When you insert the agent, you
specify this name on the agent data line at the bottom of the Agent Configuration
screen.
Note This code is intended as an example only. It is meant to be used for reference purposes and does not
necessarily show the best or only way for you to code your particular application.
UOWs The sample agent code sends the following UOWs to the TRANSFER Interactive
Server (TISERV):
ACK-RECEIPT CREATE-ITEM
ADD-ITEM-REC SUBMIT-PKG
ATTACH-COMPNT-A01 UNSAVE-ITEM
ADD-RECIP
Sample Agent Functional
Description
The sample agent takes the following actions whenever a package is received at the
depot to which the agent is attached:
Step 1: Create a new item for the forwarded package.
To create the new item, the program sends the CREATE-ITEM UOW to TISERV. The
item ID is returned in the response UOW.
Step 2: Add the name of the intended recipient of the forwarded package as a recipient .
The program sends the ADD-RECIP UOW to TISERV. The name of the intended
recipient is obtained from the ag-lnk-agent-data parameter field; this is the name that
was entered on the agent data line in the ADMIN Default Agent Configuration screen
and passed to the program through the Linkage Section.
Step 3: Add a subject record to the new item.
The subject line of the forwarded message will read "Package forwarded by sample
agent." To add this data to the message, the program assigns the string to the client-
data field and sends the ADD-ITEM-REC UOW to TISERV, using the item ID that was
returned in Step 1. The value used in the rec-type field is 115 (subject text).