On HEFLO you can perform integrations using web services in many ways, such as starting processes, triggering an intermediate event, searching items in a field, etc. In this article, we show how to call a REST web service from another app using HEFLO’s Web Service Connector.
Before adding the element, make sure that the process has the automation enabled. To complete this task, just click on the gear icon on the top side of the process editor.
- Add the “Message” intermediate event, located in the BPMN toolbox on the left.
- Select the element, access the properties tab on the right side, and change the “Behavior” attribute to the “Throw” option. See that now the envelope is full.
- Select the “WebService” option in the “Connector” property.
- Click the button “Configure Web Service.”
- On the “General” tab:
- Give the desired “Name” for your web service configuration.
- Enter the “URL” of the web service that will be called.
- Set the “Authentication Type” and “Method” fields requested by the web service.
- On the “Sending Parameters” tab, click “Add Parameter”, and repeat this task for each parameter you want to send to the web service.
- Enter the “Param name” with the name of the property that the web service needs to receive.
- The “value” field can be switched between a work item field or a constant value.
- On the “Response Parameters” tab, click “Add Parameter,” and repeat this task for each field you want to receive from the web service.
- Enter the “Param name” provided by the web service.
- On the “Field to fill” select a field that will receive the content returned by the web service.
- You can now test your web service call setup by clicking “Test request.”
- When everything is ok, click “Confirm.”
- On the “General” tab:
Finally, complete your process and test it. During the tests, all messages will contain the prefix “Test” in the subject.
See also: