Try OpenEdge Now
skip to main content
Developing AppServer Applications
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 the event procedure in the context of a blocking I/O statement much like it executes the trigger for a 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. 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 AppServer, and stores any error information returned from the AppServer for the request in the ERROR-STATUS system handle or, in the case when the remote procedure returns a class-based error object, by accessing the ERROR-OBJECT attribute of the Asynchronous request object handle
Note: See OpenEdge Development: ABL Reference for more information on handling class-based error objects, including an example of asynchronous error object handling in the RUN statement entry.
*Sets the return value for the RETURN-VALUE function, if a return value was returned by the AppServer
*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