How to start processes using web services

You can start a process through a web service call, which is performed by another application. It’s possible using the HEFLO Web Services Connector.

Step 1 – Include a message initiator

Before adding the initiator, make sure that the process has the automation feature enabled. Click on the gear icon at the top side of the process editor.

Activation of business process automation

To instantiate the process include a initiator with the message trigger.

Web service initiator

  1. In the process editor, locate the “Start” element in the BPMN Toolbox
  2. Within the item “Start” drag the item called “Message” to the drawing area or process lane.
  3. Select the message initiator and go to the properties tab at the right side.
  4. In the “Connector” field, select “Web Service.”
  5. Complete the process modeling.

Step 2 – Configure parameter passing

Parameters are data provided by the third party program and are handled in your process. Here’s how to trigger the dialog that does this setup:

  1. Select the message initiator.
  2. In the properties tab on the right side, click on “Configure Web Service.”
  3. In the web service configuration dialog, we can configure the mapping of the parameters provided by the web service to a process field. If you want to display the content of these fields, just add a form and include them as read-only fields.

Configure web service connector

Repeat the procedure below for each parameter provided by the calling program.

  1. Click “Add Parameter.”
  2. Under “Parameter Name,” enter the name provided by the calling program in JSON content.
  3. In “Field” select an existing field in the process.

Once the parameter configuration is complete, click “Confirm.” In this way, the initiator properties tab is updated, and the web services test URL is shown. You can use this address to make test calls and generate test work items  without impact on the production database.

Step 3 – Generate an API key

The API key is generated on the Environment Management page. Follow the steps in the API key generation procedure or use an existing one.

Step 4 – Testing

To perform tests you can use a test version of the calling program or, in the absence of it, an application that posts HTTPS requests such as Postman.

Also, to facilitate the tests there is a button in the configuration dialog called “Generate Body JSON”, which copies to the clipboard a JSON content with the same structure as the parameter configuration.

After performing all the tests, select the initiator again and get the production URL in the properties tab. Update the definitive caller program with this URL and publish automating. The production URL is not valid at this time, but you can get it and update your program.

Step 5 – Publish automation

After completing all the tests, publish the process:

  1. Select the actions tab at the right side of the process editor.
  2. Click “Publish Automation.”

Once published, the process stops displaying the test URL and displays only the production URL.

Make sure that the calling program invokes the production URL, not the test URL!

See also:


Was this article helpful?

Related Articles