Hi All,
I am trying to develop a service task in the palette/context pad that is pre-configured with a Rest API call.
I was able to pre-configure it with “Name and ID”. But I am trying to improve it for a Rest API call.
This is my Current Development, I need to improve this function for a Rest API call (http-connector)
const {
bpmnFactory,
create,
elementFactory,
translate
} = this;
function createTask( name, id) {
return function(event) {
const businessObject = bpmnFactory.create('bpmn:ServiceTask');
const shape = elementFactory.createShape({ type: 'bpmn:ServiceTask',businessObject: businessObject });
shape.businessObject.name= name;
shape.businessObject.id= id;
create.start(event, shape);
};}
What I am trying to achieve: (pre-configured service task should return this script.)
<bpmn:process id="outbound_payment_flow" name="outbound_payment_flow" isExecutable="true">
<bpmn:serviceTask id="funds_task" name="funds control">
<bpmn:extensionElements>
<camunda:connector>
<camunda:inputOutput>
<camunda:inputParameter name="payload">{"valueOne": "3000T"}</camunda:inputParameter>
<camunda:inputParameter name="headers">
<camunda:map>
<camunda:entry key="Content-Type">application/json</camunda:entry>
</camunda:map>
</camunda:inputParameter>
<camunda:inputParameter name="method">POST</camunda:inputParameter>
<camunda:inputParameter name="url">http://localhost:8085/inboundPayment/fc_sample</camunda:inputParameter>
<camunda:outputParameter name="funds_control_response">${response}</camunda:outputParameter>
</camunda:inputOutput>
<camunda:connectorId>http-connector</camunda:connectorId>
</camunda:connector>
</bpmn:extensionElements>
</bpmn:serviceTask>
</bpmn:process>
I used the below resources,
https://github.com/bpmn-io/bpmn-js-example-custom-elements
https://github.com/ingorichtsmeier/camunda-modeler-plugin-connected-elements
Any Suggestions?
Thanks for this platform.
Have a great day.!