SPI Programming Considerations for TMF
HP NonStop TMF Management Programming Manual—540140-008
3-7
Error Handling
TMF can return an empty response if an application returns a ZSPI-TKN-
CONTEXT token to the TMFSERVE process and there are no more responses to 
be returned. The return token ZSPI-TKN-RETCODE in an empty response record 
always has the value ZTMF-ERR-EMPTYRESPONSE.
6. Take action appropriate to the information in the response.
The response buffer always contains the return token, ZSPI-TKN-RETCODE. The 
value of the ZSPI-TKN-RETCODE token is either zero (to indicate that the command is 
successful), or it is a non-zero error number (to indicate that the command was not 
performed). The command can contain error lists in either case.
TMF supports multiple occurrences of the same token in responses for specific 
commands, and the TMFSERVE process returns multiple instances of the same token 
in responses for these commands.
TMF returns multiple response records in its responses to some commands, as 
described in the SPI Programming Manual. A response record normally contains 
response information for the operation of the command on a single object.
The recommended buffer size (in bytes) for all commands sent to TMF is ZMHS-VAL-
BUFLEN. The minimum buffer length is ZTMF-VAL-MINBUFLEN and the maximum 
buffer length is ZTMF-VAL-MAXBUFLEN.
Although TMF generates responses for all commands, responses from some 
commands (such as INFO AUDITTRAIL and STATUS AUDITTRAIL) must be obtained 
from fields within an extensible structured token. The token in this example contains all 
of the information about audit trails that is available from the TMFSERVE process. To 
refer to a field within an extensible structured token, you must first obtain the entire 
structured token using SSGET. Then you refer to the fields of the structure using the 
defined field names.
The TMFSERVE process does not provide support for selecting the types of responses 
to be returned with the SPI standard token ZSPI-TKN-RESPONSE-TYPE. TMF always 
returns a response for every object—whether or not errors or warnings occurred for the 
object. For more information about sending messages to TMFSERVE and receiving 
the responses, see the SPI Programming Manual.
Error Handling
Each response returned by TMF includes a return token (ZSPI-TKN-RETCODE), 
whose value indicates whether an error occurred when TMF attempted to perform the 
command. An error is a serious condition that prevents the command from being 
completed. If the command completed with no errors, the value of the return token is 
zero. If ZSPI-TKN-RETCODE has any non-zero value, this means that an error 
occurred. In this case, TMF includes an error list in the response, providing information 
about the error.
A warning reports a condition less serious than that of an error. If no errors occurred 
but a warning did occur, the return token has a value of zero, but an error list appears 
in the response, providing information about the warning condition.