Map connector URL field to process variable

Good afternoon.

I have a BPMN process with Rest service task, supposed to do Rest calls. In my input parameters, I have an URL Text field. This isn’t an “expression” field, so how can I map a process variable value ?

The goal is to concatenate the url variable which can vary following my environnment (staging, prod…) with the path of the REST endpoint to reach.

Thanks !

Hi @pvermeil,

not sure I understood your question properly. You have to replace url based on the environment. So you probably have to pass list or URLs as variables and current type of environment to the process somehow, either on start of the process or set it after some custom delegate is executed, then Map it into {my_endpoint} variable and use that value for your REST call.

Does that help you?
Askar.

Thanks for your reply. I finally made a proxy call to my PHP application, which knows what is the environment and calls the correct URL for me. So my PHP part is charged of all data binding, formatting and REST call technical details while my workflow is more business oriented

But there is one question remaining : I don’t know if I can map process variable with its groovy expression inside a test input JSON parameter for my Rest task. Is it solved at runtime ?

Hi,

For your use case, I typically use the Camunda connector approach. Thus my url connector parameter can be a script. In my script I can dynamically build a url using script. Hence i can build the url via concatentation of process variables. I can resolve the host to call from environment variables from the runtime container via a number of mechanisms; system properties, JNDI, classpath etc.

regards

Rob