Try OpenEdge Now
skip to main content
Application Migration and Development Guide
Application Development with PAS for OpenEdge : Programming ABL Client Applications : Managing asynchronous requests : Handling the response from an asynchronous request : PROCEDURE-COMPLETE events
The PROCEDURE-COMPLETE event is an event on the asynchronous request handle. It indicates that the asynchronous request associated with the handle has completed execution, and that the corresponding event procedure can be executed. ABL executes an ABL callback procedure or the event procedure in the context of a blocking I/O statement much like it executes the trigger for an ABL user-interface event.
Note that you do not have to specify the PROCEDURE-COMPLETE event explicitly in your client code. ABL processes the event like any other ABL event or callback procedure. You also do not have to define a trigger for the event (for example, using an ON statement) because you specify an event procedure in the RUN...ASYNCHRONOUS statement that defines the "trigger code" for the event.
To process a PROCEDURE-COMPLETE event for a particular asynchronous request handle, ABL:
*Decrements the ASYNC-REQUEST-COUNT attribute on the following handles:
*The server handle contained in the SERVER attribute of the asynchronous request handle
*The procedure handle contained in the PERSISTENT-PROCEDURE attribute of the asynchronous request handle, if the PERSISTENT-PROCEDURE attribute refers to a valid persistent procedure
*Sets the COMPLETE attribute for the asynchronous request handle to TRUE
*Sets the STOP, QUIT, or ERROR attribute for the asynchronous request handle appropriately as indicated by the response message from the server, and stores any error information returned from the server for the request in the ERROR-STATUS system handle
*Sets the return value for the RETURN-VALUE function, if a return value was returned by the PAS for OpenEdge instance
*Attempts to execute the event procedure specified by the EVENT-PROCEDURE and the EVENT-PROCEDURE-CONTEXT attributes for the asynchronous request handle, if EVENT-PROCEDURE is not the empty string (""), and:
*Sets each INPUT parameter for the event procedure to the Unknown value (?) or, if the parameter is a TEMP-TABLE parameter, the temp-table remains unchanged, if the response message indicates that the remote request finished with a STOP, ERROR, or QUIT condition
*Sets the INPUT parameter values for the event procedure to the OUTPUT and INPUT-OUTPUT parameter values returned by the remote procedure, if the response message indicates that the remote request completed successfully
*Displays an error message, if a specified event procedure fails to execute for any reason