Event procedures
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
To handle the response from an asynchronous request,
you must define an event procedure. In this context, an event
procedure is an internal procedure that executes in response
to a PROCEDURE-COMPLETE event. To define an event
procedure you must:
- Specify the name of the event procedure using the
EVENT-PROCEDUREoption on theRUN...ASYNCHRONOUSstatement that executes the request. - Define an internal procedure with the same name as the event
procedure specified in the
RUN...ASYNCHRONOUSstatement.
Typical places where you might define the specified internal procedure include:
- The same procedure context as the
RUN...ASYNCHRONOUSstatement that specifies the event procedure. - An external procedure context that you specify using the
EVENT-PROCEDUREoption on theRUN...ASYNCHRONOUSstatement using its procedure handle. In this case, the external procedure context must be active in the client session before you execute theRUN...ASYNCHRONOUSstatement.
You must define the specified internal procedure with INPUT parameters
that correspond in type and order to the OUTPUT and INPUT-OUTPUT parameters that
you specify on the RUN...ASYNCHRONOUS statement.
To receive results from the asynchronous request in an event procedure, you can access:
- The asynchronous request handle for the request using the
SELFsystem handle - The attributes and methods of the
ERROR-STATUSsystem handle to obtain error information from the request - Values passed as output parameters from the remote procedure to corresponding input parameters in the event procedure
- The
RETURN-VALUEfunction to get the return value from the request