Try OpenEdge Now
skip to main content
Application Migration and Development Guide
Application Development with PAS for OpenEdge : Programming the Progress Application Server for OpenEdge : Accessing the name of the current remote procedure : Accessing a procedure name on PAS for OpenEdge
 
Accessing a procedure name on PAS for OpenEdge
You can access the path or file name of a remote procedure running on a PAS for OE instance that an ABL client has invoked using the following code fragment:
DEFINE VARIABLE rqInfo AS Progress.Lang.OERequestInfo NO-UNDO.
DEFINE VARIABLE callerProcedureName AS CHARACTER NO-UNDO.
rqInfo = SESSION:CURRENT-REQUEST-INFO.
callerProcedureName = rqInfo:ProcedureName.
Suppose external procedures on the PAS for OpenEdge instance define at least one of two internal procedures, UsefulRoutine1 and UsefulRoutine2, that implement some logic in two different ways, as in the following external procedure fragment:
/* h-UsefulProc.p -- has an internal procedure others want to find. */
PROCEDURE UsefulRoutine1:
/*Does something useful */
END PROCEDURE.
PROCEDURE UsefulRoutine2:
/*Does something useful in a different way*/
END PROCEDURE.
An ABL client might invoke these internal procedures in persistent procedures currently running on this PAS for OpenEdge instance as shown in the following client code fragment:
DEFINE VARIABLE happsrv AS HANDLE NO-UNDO.
DEFINE VARIABLE hUseful AS HANDLE NO-UNDO.
DEFINE VARIABLE hProc AS HANDLE NO-UNDO.
CREATE SERVER happsrv.
IF happsrv:CONNECT(" -URL http://localhost:3090/apsv","","") THEN
DO:
  RUN h-UsefulProc.p ON happsrv PERSISTENT SET hUseful.  hProc = happsrv:FIRST-PROCEDURE.
  DO WHILE VALID-HANDLE(hProc):
    IF LOOKUP("UsefulRoutine1", hProc:INTERNAL-ENTRIES) NE 0 THEN
       RUN UsefulRoutine1 IN hProc.    ELSE
      RUN UsefulRoutine2 IN hProc.    hProc = hProc:NEXT-SIBLING.
  END.
  DELETE PROCEDURE hUseful.
  happsrv:DISCONNECT().
END.
ELSE
  MESSAGE "Failed to connect" VIEW-AS ALERT-BOX.
For the client remote request that runs h-UsefulProc.p persistently, the value of the ProcedureName property is "h-UsefulProc.p".
For a client remote request that runs one of the specified internal procedures in hProc when the remote procedure handle refers to any instance of the h-UsefulProc.p persistent procedure currently instantiated on the PAS for OE instance, the value of the ProcedureName property is one of the following, depending on the internal procedure that the client is executing:
*"h-UsefulProc.p&UsefulRoutine1"
*"h-UsefulProc.p&UsefulRoutine2"