Consultor Eletrônico



Kbase P74827: What is the purpose of the environment options in the ubroker.properties
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   05/04/2004
Status: Unverified

GOAL:

What is the purpose of the environment options in the ubroker.properties

FIX:

AppServer, Webspeed and Dataserver Brokers may have upto 20 environment variables defined for use within each of those processes.
This 20 environment variables includes both Progress defined and user defined variables.

For AppServers, these environment variables are accessible within code run by those AppServer servers.
This example requires adding 20 variables for asbroker1 X1 to X20 and assigning some character value to each.

/* Example of Code to be run on Appserver: appServer.p */
DEF INPUT PARAM osVar AS CHAR.
DEF OUTPUT PARAM osValue AS CHAR.

ASSIGN osValue = OS-GETENV(osVar).

/* Write a small program that will connect to the AppServer you just have */
/* created. Eg: */
DEF VAR hAS AS HANDLE.
DEF VAR count AS INT.
DEF VAR osVar AS CHAR.
DEF VAR osValue AS CHAR.

ASSIGN osValue = OS-GETENV(osVar).
CREATE SERVER hAS.
hAS:CONNECT("-H hostname -AppService asbroker1").

DO count = 1 TO 20:
ASSIGN osVar = "X" + String(count).
RUN appServer.p ON SERVER hAS (INPUT osVar, OUTPUT osValue).

/* Let's complain if value is not what is expected */
IF osValue <> "1" THEN
MESSAGE "Variable:" osVar SKIP
"Value:" osValue
VIEW-AS ALERT-BOX.
END.

hAS:DISCONNECT().
DELETE OBJECT hAS.

These environment variables may be used internal to the applications to hold different broker or site specific information.