Question

Reading environment variables inside an activity or a R-U-F

Hi All,

I have a functionality where i have some custom environment variables loaded in to the system. I would like to access those variables from an activity or a RUF function.

Please share your ideas on this.

Correct Answer
August 20, 2019 - 7:50pm

Besides you try System.getenv(), you may also try System.getProperty(). 

eg. 

System.getProperty("java.io.tmpdir"); 

System.getProperty("user.name")

System.getProperty("os.name")

System.getProperty("file.encoding")

 

 

 

Comments

Keep up to date on this post and subscribe to comments

August 20, 2019 - 4:20pm

You may try System.getenv("ENVIRONMENT_VARIABLE"); in a java step of an activity. It works!

Pega
August 20, 2019 - 7:50pm

Besides you try System.getenv(), you may also try System.getProperty(). 

eg. 

System.getProperty("java.io.tmpdir"); 

System.getProperty("user.name")

System.getProperty("os.name")

System.getProperty("file.encoding")

 

 

 

August 21, 2019 - 1:42am
Response to SusanLiu

System.getProperty("os.name"); is working