TRANSFER Programming Manual
Working with TAREQ
Designing and Writing an Agent
10–4 069138, Update 1 to 040970 Tandem Computers Incorporated
message. The TAREQ continues this process until it encounters no further qualified
agents or until an agent requests the TAREQ to discontinue agent selection.
If an agent selection record for a selected agent specifies that a session should be
started when the agent is invoked, the TAREQ starts a session and obtains a session ID
from TISERV. The TAREQ includes the session ID in the agent notification message,
so that an agent that can be invoked by more than one depot can access depots for
which it is configured, without knowing the password for the depot.
When more than one agent requiring a session is selected, the TAREQ assigns each
agent an individual session. As each agent returns control, the TAREQ ends the
session on behalf of the agent. When two agents are involved, for example, the
TAREQ might begin by starting a session for agent A, and then invoking agent A.
When agent A completes its operations and terminates, the TAREQ would terminate
the session for agent A, start a session for agent B, and invoke agent B.
When a TAREQ invokes a SCREEN COBOL agent, the TAREQ must stop processing
and wait until the agent returns; when a TAREQ invokes a server class agent, the
TAREQ must stop processing and wait until the agent replies. While the agent is
performing its task, the TAREQ that invoked the agent remains busy with that agent
and can perform no other functions. Therefore, the more work an agent does, the
more TAREQs your application will require to handle the workload. This is
particularly true where many packages are each frequently delivered to many
recipients; the TAREQ must always perform a unique delivery for every recipient.
A SCREEN COBOL agent should perform all of its work within the framework of the
TMF transaction provided by the TAREQ.
A SCREEN COBOL agent must not issue a BEGIN-TRANSACTION, ABORT-
TRANSACTION, or END-TRANSACTION. A SCREEN COBOL agent can issue only
a RESTART-TRANSACTION.
If a SCREEN COBOL agent issues a RESTART-TRANSACTION, TMF backs out the
delivery as well as all work performed by preceding agents within the scope of the
TAREQ TMF transaction. Then the TAREQ retries the transaction for the number of
times specified by the MAXTMFRESTARTS configuration parameter in PATHWAY.
If the SCREEN COBOL agent persists in restarting the transaction, the current function
that the TAREQ is processing is placed on HOLD. HOLD always means that the
TAREQ will make no further attempt to deliver the package locally for the duration of
the HOLD. HOLD might also mean that an expiration function will not be scheduled,
and the package might not be transported to other nodes for the duration of the
HOLD. The function remains in the scheduler READY file, but is not subject to
selection until the TRANSFER administrator starts the scheduler with PARAM
UNHOLD TRUE.
If an agent is a requester written in SCREEN COBOL, the TAREQs invoke it with
CALL statements. If an agent belongs to a PATHWAY server class, TAREQs address
it by issuing SEND statements to the class.