Get Enviroment Variable in http-connector

I want to read the host name of a restful web service from environment variable in input of http-connector. I use System.getProperty(“host”) but I got below error:

org.camunda.bpm.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier ‘System’

In this topic use javascript to read environment variable. Is there any way to use this in input tag?

camunda:inputOutput
<camunda:inputParameter name=“url”>${System.getProperty(“host”)}
</camunda:inputParameter>

Hi @Mohammad_Mahdavi,

System.getProperty() is a Java construct. That means, that if you want to call this function in your JavaScript you need to specify the whole packagename infront of the class. Resulting in a statement like this:

java.lang.System.getProperty(…);

If you leave out the packagename, the engine does not know which class to use and throws the error, that it cannot resolve the identifier.

So maybe you should try adding the packagename to your statement. I am not hundred percent sure, if this can only be used in a JavaScript or in your expression as well. Otherwise there is also the option to use a script as an input parameter.

Hope this helps

Regards
Michael

1 Like