TRANSFER Programming Manual

Writing an Agent Tester
Designing and Writing an Agent
10–12 069138, Update 1 to 040970 Tandem Computers Incorporated
In this definition, the fields have the following meanings:
return-action-flag contains the result of your program's execution.
It can be set to one of the values in Table 10-2.
Table 10-2. RETURN-ACTION-FLAG Values
Value Meaning
-1 Your program rejected the configuration or deletion request, either by the
program’s intent or because of an error in any UOW or server request it
attempted. (The program might have placed a message in the error block.) The
TMF-STARTED-FLAG and RETURN-STATE fields should both be set to 0.
0 Your program completed the entire operation successfully and requires no action
by the TRANSFER delivery system. This implies that your program issued the
appropriate UOWs itself. The TMF-STARTED-FLAG should be set to 0.
1 Your program requested the TRANSFER delivery system to issue the ALTER-
AGENT-SELECT UOW. If your program sets the TMF-STARTED-FLAG, TMF will
honor the status of that flag. (Your program can do this if it writes data to another
file and then requires the TRANSFER delivery system to complete the agent
selection operation under the same transaction ID that your program obtained.)
The RETURN-STATE field should be set to 0.
AGENT-ALTER-DATA, on entry, contains the data for an ALTER-AGENT-
SELECT UOW appropriate for the add, alter, or delete agent operation being
performed. The fields either contain the current values or default to new
values. The user-supplied module can modify these values as appropriate and
then either issue the UOW itself or return with RETURN-ACTION-FLAG set
to 1 (in which case ADMIN will issue the modified UOW).
Writing an Agent
Tester
When debugging an agent, you can develop a program unit that calls the agent and
displays a screen that allows you to pass information to the agent, thus simulating a
TAREQ. Such a program lets you directly observe the interaction between the TAREQ
and agent. If this program is written as a user mail extension, it will even more closely
simulate the TAREQ environment. User mail extensions are discussed in Appendix A.
A sample agent test program is listed in Section 11.
To use the system debugging facilities, you can define the server class with the
DEBUG option of the ADD SERVER or SET SERVER PATHCOM command set to ON.