How containers control the pipeline protocols

The contents of the DFHFUNCTION, DFHREQUEST, and DFHRESPONSE containers together control the pipeline protocols.

During the two phases of the execution of a pipeline (the request phase and the response phase) the value of DFHFUNCTION determines which control containers are passed to each message handler:
DFHFUNCTION Context DFHREQUEST DFHRESPONSE
RECEIVE-REQUEST Service provider; request phase Present (length > 0) Present (length = 0)
SEND-RESPONSE Service provider; response phase Absent Present (length > 0)
SEND-REQUEST Service requester; request phase Present (length > 0) Present (length = 0)
RECEIVE-RESPONSE Service requester; response phase Absent Present (length > 0)
PROCESS-REQUEST Service provider; terminal handler Present (length > 0) Present (length = 0)
HANDLER-ERROR Service requester or provider; either phase Absent Present (length = 0)
NO-RESPONSE Service requester or provider; response phase Absent Absent
Subsequent processing is determined by the containers that your message handler passes back to the pipeline:
During the request phase
  • Your message handler can return the DFHREQUEST container. Processing continues in the request phase with the next handler. The length of the data in the container must not be zero.
  • Your message handler can return the DFHRESPONSE container. Processing switches to the response phase, and the same handler is called with DFHFUNCTION set to SEND-RESPONSE in a service provider and to RECEIVE-RESPONSE in a service requester. The length of the data in the container must not be zero.
  • Your message handler can return no containers. Processing switches to the response phase, and the same handler is called with DFHFUNCTION set to NO-RESPONSE.
In the terminal handler (service provider only)
  • Your message handler can return the DFHRESPONSE container. Processing switches to the response phase, and the previous handler is called with a new value of DFHFUNCTION (SEND-RESPONSE). The length of the data in the container must not be zero.
  • Your message handler can return no containers. Processing switches to the response phase, and the previous handler is called with a new value of DFHFUNCTION (NO-RESPONSE).
During the response phase
  • Your message handler can return the DFHRESPONSE container. Processing continues in the response phase, and the next handler is called. The length of the data in the container must not be zero.
  • Your message handler can return no containers. Processing continues in the response phase, and the next handler in sequence is called with a new value of DFHFUNCTION (NO-RESPONSE).
Important: During the request phase, your message handler can return DFHREQUEST or DFHRESPONSE, but not both. Because both containers are present when your message handler is called, you must delete one of them.
This table shows the action taken by the pipeline for all values of DFHFUNCTION and all combinations of DFHREQUEST and DFHRESPONSE returned by each message handler.
DFHFUNCTION Context DFHREQUEST DFHRESPONSE Action
RECEIVE-REQUEST Service provider; request phase Present (length > 0) Present (error)
RECEIVE-REQUEST Service provider; request phase Present (length > 0) Absent Call the next handler with the RECEIVE-REQUEST function
RECEIVE-REQUEST Service provider; request phase Present (length = 0) Not applicable (error)
RECEIVE-REQUEST Service provider; request phase Absent Present (length > 0) Switch to response phase, and invoke the same handler with the SEND-RESPONSE function
RECEIVE-REQUEST Service provider; request phase Absent Present (length = 0) (error)
RECEIVE-REQUEST Service provider; request phase Absent Absent Call the same handler with the NO-RESPONSE function
SEND-RESPONSE Service provider; response phase Not applicable Present (length > 0) Call the previous handler with the SEND-RESPONSE function
SEND-RESPONSE Service provider; response phase Not applicable Present (length = 0) (error)
SEND-RESPONSE Service provider; response phase Not applicable Absent Call the same handler with the NO-RESPONSE function
SEND-REQUEST Service requester; request phase Present (length > 0) Present (length ≥ 0) (error)
SEND-REQUEST Service requester; request phase Present (length > 0) Absent Call the next handler with the SEND-REQUEST function
SEND-REQUEST Service requester; request phase Present (length = 0) Not applicable (error)
SEND-REQUEST Service requester; request phase Absent Present (length > 0) Switch to response phase, and call the previous handler with the RECEIVE-RESPONSE function
SEND-REQUEST Service requester; request phase Absent Present (length = 0) (error)
SEND-REQUEST Service requester; request phase Absent Absent Call the same handler with the NO-RESPONSE function
RECEIVE-RESPONSE Service requester; response phase Not applicable Present (length > 0) Call the previous handler with the RECEIVE-RESPONSE function
RECEIVE-RESPONSE Service requester; response phase Not applicable Present (length = 0) (error)
RECEIVE-RESPONSE Service requester; response phase Not applicable Absent Call the same handler with the NO-RESPONSE function
PROCESS-REQUEST Service provider; terminal handler Not applicable Present (length > 0) Call the previous handler with the RECEIVE-RESPONSE function
PROCESS-REQUEST Service provider; terminal handler Not applicable Present (length = 0) (error)
PROCESS-REQUEST Service provider; terminal handler Not applicable Absent Call the same handler with the NO-RESPONSE function
HANDLER-ERROR Service requester or provider; either phase Not applicable Present (length > 0) Call the previous handler with the SEND-RESPONSE function or the RECEIVE-RESPONSE function
HANDLER-ERROR Service requester or provider; either phase Not applicable Present (length = 0) (error)
HANDLER-ERROR Service requester or provider; either phase Not applicable Absent Call the same handler with the NO-RESPONSE function