TRANSFER Programming Manual

Working with TAREQ
Designing and Writing an Agent
069138, Update 1 to 040970 Tandem Computers Incorporated 10–3
through the ALTER-AGENT-SELECT UOW issued to TISERV. The sender can use
fields within package headers to specify information that must match the selection
criteria in the recipient's profile in order for the agent to be executed. Through the use
of selection criteria, different agents at a depot can handle different types of packages
and applications. More information about agent selection and the addition of agents
to depots appears in the discussion of the ALTER-AGENT-SELECT UOW.
Recipient and creator names are passed to an agent in the character map defined for
the depot.
Note
You can copy UOW data definitions for SCREEN COBOL, COBOL, FORTRAN, and TAL programs from
files supplied by Tandem, but you must write your own UOW definitions for Pascal or C programs, using
the UOW specifications that appear in the TRANSFER Reference Manual. Source file locations are listed
in Section 9, “Designing and Writing a Client.”
Coding an Agent An agent may need to perform the following tasks once TAREQ selects your agent:
Establish a session for a correspondent
Read the notification message from TAREQ
Reply to TAREQ
Perform processing related to the incoming message
Establishing Sessions for
Agents
If an agent needs access to a correspondent's depot, it must either establish a session or
be granted one. There are two ways to establish a session:
Use the START-SESSION UOW to start a session
Use the ALTER-AGENT-SELECT UOW to set up the correspondent's profile so
that the agent is automatically granted a session whenever it is invoked, in which
case the agent does not need to furnish the depot password.
When an application attempts to start a session for a correspondent, the TRANSFER
delivery system checks to ensure that another session is not already in progress for the
same correspondent. Sessions created for agents, however, are not counted in this
verification. Thus, the E-CONCURRENT-SESSION or W-CONCURRENT-SESSION
message is only issued if other nonagent sessions are active for the correspondent. If
an agent that requires a session is configured at a depot where concurrent sessions are
forbidden, the agent does not fail if invoked while the depot has an active session.
Working with TAREQ Upon package delivery, the responsible TAREQ selects an agent by matching delivery
parameters that accompany the package against agent selection criteria defined in
agent profile records at the recipient depot. The TAREQ passes delivery parameters as
part of an agent notification message. Your application establishes the agent selection
criteria through the ALTER-AGENT-SELECT UOW or the TRANSFER ADMIN client.
When the package arrives at the depot, the TAREQ selects the appropriate agents.
In selecting agents, the TAREQ sequentially searches the agent selection criteria in
the profiles for the depot. During this search, the TAREQ invokes, in sequence, each
agent whose selection criteria is satisfied by the delivery parameters in the notification