DEFINE VARIABLE rqInfo AS Progress.Lang.OERequestInfo NO-UNDO.
DEFINE VARIABLE callerProcedureName AS CHARACTER NO-UNDO. rqInfo = SESSION:CURRENT-REQUEST-INFO. callerProcedureName = rqInfo:ProcedureName. |
/* 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. |
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(" -H localhost -S 3090 -DirectConnect -AppService asbroker1","","") 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. |