TRANSFER Programming Manual

Examples of Agents
TRANSFER Application Components
2–6 40970 Tandem Computers Incorporated
An agent can be a requester or a PATHWAY server. In general, the following
statements are true of agents:
An agent that makes requests of TRANSFER server classes to retrieve, save, or
send packages should be a requester written in SCREEN COBOL.
An agent that accesses an input/output device, or that performs string handling,
complex computations, or tasks of long duration should be a server written in
COBOL, FORTRAN, TAL, Pascal, or C.
An agent that handles both the tasks in item 1 and the tasks in item 2 should be
written in SCREEN COBOL and should direct its requests to a special application-
defined server class.
Agents are invoked by TAREQs according to information in the incoming package
and in the recipient's profile. SCREEN COBOL agents run in the same TCPs as the
TAREQs that invoke the agents. Communication between TAREQ and agent is
program unit to program unit, not TCP to TCP.
Examples of Agents The precise responsibilities of agents vary considerably. Some agents retrieve and
save packages for their correspondents, delete packages that are not meaningful to
their recipients, present messages on output devices, or initiate transactions based
upon package delivery. Specific examples include:
A vacation agent that takes some kind of action in the absence of a package
recipient. This agent might reply automatically to all packages; forward the
packages to another correspondent, optionally appending text that provides
additional information or directives; file the packages for later retrieval; or delete
items according to some criteria in the package header.
A filtering agent that screens incoming mail according to certain criteria; for
example, filing packages that pertain to certain subjects or sorting packages
according to type before presenting them to a recipient. The agent might place
mail memos in one folder and reply messages in another. The agent might file
packages from different applications separately; then, the client can allow the
correspondent to retrieve the packages selectively.
An agent that arranges in proper sequence packages that are required to arrive in a
certain order. To use an agent in this way, the application would establish an
arrangement such as the following:
1. The sender embeds sequence numbers in the package. As an example, the
sequence numbers might be included as data records in the package headers.
2. The agent at the recipient's depot processes those packages that arrive in the
expected order, but saves in a folder any packages that arrive out of order.
The folder then becomes a queue for out-of-sequence packages.
Whenever a package has been processed, the agent checks the folder for a package
with the next higher sequence number. If the folder contains such a package, the
agent processes that package next.