Using environment variables with http-connector

I have a BPMN model which uses an http-connector to get variables from other microservices before evaluation.

This model works fine, however, I have a requirement to switch the microservice endpoint based on some environment variable. (i.e. If the application was deployed to a development environment, QA env or production environment).

What I have now looks like this;
execution.setVariable("ENV", (java.lang.System).getenv('ENV'));
I get an empty value back even after attempting to set the environment variable with export ENV=dev.

Can I get some help with this?

Are you executing this as a script or a expression?

I am executing this as a script on the “Get Environment” task from my process image above.

Can you retry with code similar to described here: Using secrets/passwords securely in processes (Using Docker Secrets, not storing passwords in process variables)

If it does not work, then would say your env is not “typical” and something else is going on

Hi Stephen, thanks for the insight.
I was able to access the environment variable from my model using execution.setVariable("ENV", (java.lang.System).getenv('CAM_ENV')); after setting the variable with the docker environment keyword.

1 Like

:+1: great