Single-run/singleton procedure example
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
User-defined function defined by CustomerInfo.p
A procedure called CustomerInfo.p contains
a user-defined function with the following definition.
|
OpenAPI code to run the single-run procedure
The version of CustomerInfo.p in the
following code example (Persistent procedure ABL for the OpenAPI)cannot be run as a
single-run (or singleton) because it has a parameter in the main block. Creating another
internal procedure to set CustNum would also not work,
because a single-run procedure is deleted from the application server after each call.
Context must be established for each call. So in the previous code example (User-defined
function defined by CustomerInfo.p), CustNum is passed as a
parameter to the user-defined function GetTotalOrdersByNumber instead.
The OpenAPI code, in the following code example, runs CustomerInfo.p as a
single-run procedure and then calls its user-defined function. The code also shows how to
access the procedure type using the getProcedureType() method.
|
A singleton procedure can be run in the same way, with ProcedureType.SINGLETON substituted into the createPO method. Unlike a single-run procedure, a singleton
procedure remains instantiated on the application server after execution, but as with a
single-run procedure, you need to use _release() to clean
up resources on the client side.