Dear Community,
in my project I would like to embed calling a remote REST-Service (implemented using Spring) into my Camunda process and pass some form-data to the remote service as well. The process definintion is as follows:
...
<bpmn2:process id="emotion-metadata" name="Emotion Metadata" isExecutable="true">
<bpmn2:startEvent id="StartEvent_1">
<bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
</bpmn2:startEvent>
<bpmn2:serviceTask id="ServiceTask_1" name="Some REST Call">
<bpmn2:extensionElements>
<camunda:connector>
<camunda:inputOutput>
<camunda:inputParameter name="url">http://localhost:8085/some-service/some-endpoint</camunda:inputParameter>
<camunda:inputParameter name="method">POST</camunda:inputParameter>
<camunda:inputParameter name="form-data">
<camunda:map>
<camunda:entry key="some-param-one">somevalue</camunda:entry>
<camunda:entry key="some-param-two">someothervalue</camunda:entry>
</camunda:map>
</camunda:inputParameter>
</camunda:inputOutput>
<camunda:connectorId>http-connector</camunda:connectorId>
</camunda:connector>
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_02afwp4</bpmn2:outgoing>
</bpmn2:serviceTask>
<bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="StartEvent_1" targetRef="ServiceTask_1" />
<bpmn2:endEvent id="EndEvent_2">
<bpmn2:incoming>SequenceFlow_02afwp4</bpmn2:incoming>
</bpmn2:endEvent>
<bpmn2:sequenceFlow id="SequenceFlow_02afwp4" sourceRef="ServiceTask_1" targetRef="EndEvent_2" />
</bpmn2:process>
...
If I check the execution with debugger, I can see that the form-data parameters are set in the request as a simple request parameter - but sadly this is not the way the remote service expects them.
I think, since Camunda’s HTTP connector is based on Apache HTTP Client (HTTP Connector | docs.camunda.org), these parameters should be mapped by for example by
org.apache.http.client.entity.UrlEncodedFormEntity
Is there a way to use a custom mapping so that the variables can be posted to the remote service as form-data? Should a custom configuration, a custom connector or just a custom mapping be used?
Thank you in advance!