No, PASOE does not have the Environment Variables tab in the Configuration settings. This is expected and Progress has no plans to add an environment block to the properties file at this time.
There are two ways to set environment variables:
- Create a [prefix-anything]_setenv.(bat/sh) script and place it in the <PASOE>\bin directory. Different files with different prefix could be created to handle logically each environment variables per application. User controls the application variables in each file, but they are accessible to all applications running on PASOE instance.
- All environment variables are placed in one file, proset.env (Linux/Unix) or proset.bat (Windows). In this case the proset.bat|env will be placed in the OpenEdge Working directory. All variables will be accessible the same way for all applications on PASOE instance.
PASOE instance needs to be restarted once these files are created so environment variables are accessible to the web applications.
Example:
For proset.
- Create a text file named proset.env (Linux/Unix) or proset.bat (Windows). Add the following text:
Windows
set WHOIS=IAM
Linux/Unix
WHOIS=IAM;export WHOIS
- Copy proset.bat|env to the working directory (%WRKDIR% | $WRKDIR)of the OpenEdge installation.
For _setenv
- Create a text file named myenv_setenv.sh (Linux/Unix) or myenv_setenv.bat (Windows). Add the following text:
Windows
set WHOIS=IAM
Linux/Unix
WHOIS=IAM;export WHOIS
- Copy myenv_setenv.bat|sh to the <PASOE-Instance>/bin directory.
- Write an ABL procedure or Class to get the value of the environment variable :
MESSAGE "THIS IS WHOIS: " OS-GETENV("WHOIS").
- Deploy the r-code to <PASOE-Instance>/openedge directory or to a directory in the PROPATH.
- Make a test call using an ABL client connection code:
DEFINE VARIABLE hAppSrv AS HANDLE NO-UNDO.
DEFINE VARIABLE ret AS LOGICAL NO-UNDO.
CREATE SERVER hAppSrv.
// If using the ROOT webapp the URL would be https://: port>/apsv instead
ret = hAppSrv:CONNECT("-URL http://localhost:<instanceport>/apsv","","").
IF NOT ret THEN
DO:
DELETE OBJECT hAppSrv NO-ERROR.
RETURN ERROR "Failed to connect to the PASOE instance via HTTPS " + RETURN-VALUE.
END.
ELSE
DO:
message "Connection successful" view-as alert-box.
RUN <testprocedure>.p ON hAppSrv.
END.
ret = hAppSrv:DISCONNECT().
DELETE OBJECT hAppSrv NO-ERROR.
- Check the <instance.agent.log> file located at {CATALINA_BASE}/logs:
[<any time stamp>] P-003064 T-003070 1 AS-7 -- (Procedure: 'yourtestprocedure.p' Line:1) THIS IS WHOIS: IAM
[<any time stamp>] P-003064 T-003070 2 AS-7 AS Application Server disconnected with connection id: FA0F121146566656566F4B6D4F1211F94B4E345938F6.<instance>. (8359)