Consultor Eletrônico



Kbase P148748: How to determine which AppServer agent a program is running in
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   04/01/2010
Status: Verified

GOAL:

How to determine which AppServer agent a program is running in

GOAL:

How to find the AppServer ID

GOAL:

How can I tell which AppServer agent I'm in relative to the first?

FACT(s) (Environment):

All Supported Operating Systems
OpenEdge 10.1x
OpenEdge 10.2x

FIX:

When AppServer agents are started they are listed numerically from first to last using a one-based numbering system. For instance if you start 5 agents you have agent 1, 2, 3, 4 & 5. There may be some cases where you need to identify which agent your program is running in. To support this there is a startup parameter that is used by the AdminServer when starting the _proapsv.exe process called -ASID.
To get the value from this parameter you would parse it from the SESSION:STARTUP-PARAMETERS value as follows:

DEFINE VARIABLE cParams AS CHARACTER NO-UNDO.
DEFINE VARIABLE cParam AS CHARACTER NO-UNDO.

DEFINE VARIABLE iParam AS INTEGER NO-UNDO.
DEFINE VARIABLE iAsid AS INTEGER NO-UNDO.

cParams = SESSION:STARTUP-PARAMETERS.
DO iParam = 1 TO NUM-ENTRIES(cParams):
cParam = TRIM(ENTRY(iParam,cParams)).
IF cParam BEGINS "-ASID" THEN
iAsid = ENTRY(2,cParam," ").
END.