Base on diffrent enviroment, how could replace camunda connector url to current enviroment?

Hi all,

I’m camunda newbie, here is my question.
Because our company has diffrent enviroment like SIT, UAT, PROD.
Each enviroment has own url. (diffrent ip)
How could use the same BPMN to replace http-connector URL then deploy to diffrent enviroment.
Maybe via variable or properties?
Thanks in advance!

<camunda:connector>
          <camunda:inputOutput>
            <camunda:inputParameter name="url">
http://172.24.41.16:51080/bpm/decisionAutomation
</camunda:inputParameter>
            <camunda:inputParameter name="method">POST</camunda:inputParameter>
            <camunda:inputParameter name="headers" />
            <camunda:inputParameter name="payload"></camunda:inputParameter>
            <camunda:outputParameter name="response1">
              <camunda:script scriptFormat="JavaScript">print(response);</camunda:script>
            </camunda:outputParameter>
          </camunda:inputOutput>
          <camunda:connectorId>http-connector</camunda:connectorId>
        </camunda:connector>

Generally speaking I often try to tell people just to not use connectors, but if you’re already decided on using them you can use an expression that can be evaluated in runtime for the URL.

There’s an example of this in this project. Where an expression is used within the URL which would take variables from the current context and add them to create the full URL string.

2 Likes

Thanks for your reply!
How could I provide or setting current context?
Annother question, why did you say do not use connector?
Is there any shortcoming?

Hi @kai88

Connectors can be the right choice for a project but they probably should be your first choice.
The project i posted above has a detailed ReadMe file which discusses the pro’s and con’s of each possible option. I’d suggest going through and seeing which one best suites your project :slight_smile: