Camunda Modeler template with Connector Scope - Defining headers

Hi @carlos.silva and @Tanios_Chahine

If it is still of interest, it is possible to define headers using Camunda templates. Since a map is not supported as a template type, you can use a script to produce a header map.

To use a script here is may not the cleanest way and may have some performance side-effects.

However, you can define a camunda:Connector property:

{
  "label": "Headers",
  "type": "String",
  "value": "var header = new java.util.HashMap();\r\nheader.put(\"Content-Type\",\"application\/json\");\r\nheader;",
  "binding": {
    "type": "camunda:inputParameter",
    "name": "headers",
    "scriptFormat": "JavaScript"
  }
}

And an exemplary script could look as follows:

var header = new java.util.HashMap();
header.put("Content-Type","application/json");
header;
2 Likes