Original Message:
Sent: Mon September 18, 2023 02:36 AM
From: Matthias Blomme
Subject: EnvironmentVariables: in server.conf.yaml file
Hi Ravi
I don't beleive it is meant to be used that way. Have a look here: https://www.ibm.com/docs/en/app-connect/12.0?topic=servers-configuring-independent-integration-server-startup-script
As you can see from my screenshot in the previous post, you can access them from the mqinput node.
If you want to access env variables from anywhere in your flow you can always create a java function
public class ReadEnvVar_ReadEnvVar {
public static String getVar(String varName) {
return System.getenv(varName);
}
}
And an esql function that point to that java function
CREATE FUNCTION readEnvVar(IN varName CHARACTER)
RETURNS CHARACTER
LANGUAGE JAVA
EXTERNAL NAME "ReadEnvVar_ReadEnvVar.getVar";
So you can use it anywhere in esql like so
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyEntireMessage();
SET OutputRoot.JSON.Data.Result = readEnvVar(InputRoot.JSON.Data.Request);
RETURN TRUE;
END;
It works for any env var specified in your server.conf.yaml
------------------------------
Matthias Blomme
Original Message:
Sent: Fri September 15, 2023 10:04 AM
From: RAVI TEJA KATRAGADDA
Subject: EnvironmentVariables: in server.conf.yaml file
what is the Xpath used in Esql for accessing the below section variable (EnvironmentVariables:) from the server.conf.yaml from the execution group , attached below screen shot
EnvironmentVariables:
ENV_VAR_ONE: 'env_var_one_value' --> How to access this variable in Esql or what is the usecase in the server.conf.yaml
------------------------------
RAVI TEJA KATRAGADDA
Original Message:
Sent: Fri September 15, 2023 07:37 AM
From: Matthias Blomme
Subject: EnvironmentVariables: in server.conf.yaml file
Hi Ravi
You can get whatever you want from a java compute node, there you can just request environment variables with the standard java api
String value_name = System.getEnv(key_of_variable);
Depending on your use case, you can also access them on the mqinput node
the "encodedvar" being the name of the variable you want to use there.
------------------------------
Regards
Matthias Blomme
Original Message:
Sent: Wed September 13, 2023 05:56 AM
From: RAVI TEJA KATRAGADDA
Subject: EnvironmentVariables: in server.conf.yaml file
Hi Team,
How to access the EnvironmentVariables: from server.conf.yaml file into esql.
------------------------------
RAVI TEJA KATRAGADDA
------------------------------