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 a pipeline's execution (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 which containers your message handler passes back to the pipeline:
During the request phase
  • Your message handler can return container DFHREQUEST. 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 container DFHRESPONSE. Processing switches to the response phase, and the same handler is invoked with DFHFUNCTION set to SEND-RESPONSE in a service provider, and 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 invoked with DFHFUNCTION set to NO-RESPONSE.
In the terminal handler (service provider only)
  • Your message handler can return container DFHRESPONSE. Processing switches to the response phase, and the previous handler is invoked 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 invoked with a new value of DFHFUNCTION (NO-RESPONSE).
During the response phase
  • Your message handler can return container DFHRESPONSE. Processing continues in the response phase, and next handler is invoked. 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 invoked with a new value of DFHFUNCTION (NO-RESPONSE).
Important: During the request phase, your message handler can return DFHREQUEST or DFHRESPONSE, but not both. Since both containers are present when your message handler is invoked, 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)
Absent Invoke the next handler with function RECEIVE-REQUEST
Present (length = 0) Not applicable (error)
Absent Present (length > 0) Switch to response phase, and invoke the same handler with function SEND-RESPONSE
Present (length = 0) (error)
Absent Invoke the same handler with function NO-RESPONSE
SEND-RESPONSE Service provider; response phase Not applicable Present (length > 0) Invoke the previous handler with function SEND-RESPONSE
Present (length = 0) (error)
Absent Invoke the same handler with function NO-RESPONSE
SEND-REQUEST Service requester; request phase Present (length > 0) Present (length ≥ 0) (error)
Absent Invoke the next handler with function SEND-REQUEST
Present (length = 0) Not applicable (error)
Absent Present (length > 0) Switch to response phase, and invoke the previous handler with function RECEIVE-RESPONSE
Present (length = 0) (error)
Absent Invoke the same handler with function NO-RESPONSE
RECEIVE-RESPONSE Service requester; response phase Not applicable Present (length > 0) Invoke the previous handler with function RECEIVE-RESPONSE
Present (length = 0) (error)
Absent Invoke the same handler with function NO-RESPONSE
PROCESS-REQUEST Service provider; terminal handler Not applicable Present (length > 0) Invoke the previous handler with function RECEIVE-RESPONSE
Present (length = 0) (error)
Absent Invoke the same handler with function NO-RESPONSE
HANDLER-ERROR Service requester or provider; either phase Not applicable Present (length > 0) Invoke the previous handler with function SEND-RESPONSE or RECEIVE-RESPONSE
Present (length = 0) (error)
Absent Invoke the same handler with function NO-RESPONSE