To Set up External Data Receiving as Trigger to Start A Process Automatically

A Workflow can be started by 'HTTP request' from external systems or external applications. POST method is recommended to start the process, but even with the GET method, when getting a request for a RESTful forms like "?key=ABCDEF&data[1].input=100…", it starts the process that stores the received data.

Mechanism to Start Process from External

Questetra BPM Suite provides a mechanism to automatically launch a process (start Workflow) when there is an external HTTP requests to a particular URL.

For example, when a RESTful HTTP request such as

https://s.questetra.net/********/System/Event/MessageStart?processModelInfoId=1&nodeNumber=1&key=ABCDFEF&data[1].input=100

Message-Start-diagram.png

arrives at particular Workflow definition (Process model), a process is launched automatically . By using this mechanism, processes of Questetra BPM Suite can be started automatically. It is also possible to pass 'business data' such as String type data or File data. (The part of ******** depends on your account.)

 

Settings on Workflow

message_start_event_small2.jpgFirst, the process model must be set so that the process is started in response to HTTP requests from outside.

Place 'Message Start Event' icon into the Workflow definition. 'Message Start Event' will be found in Advance tag in Process diagram of process Modeler. When placing the Item on the point where you want to start it, and activate it, one URL for starting will be issued.

The URL for starting will be a form of

https://s.questetra.net/********/System/Event/MessageStart/start

and specify the 'parameters' and the 'Values' of

  • processModelInfoId
  • nodeNumber
  • key
  • title

then the process will be started. For details of each parameters, see Process Model Connecting API: Specifications Data Receiving (HTTP)

How to check the URL for starting

The URL will be displayed at the bottom of the Process Detail page of the Workflow definition (Process model). Note that the URL can not be confirmed unless switched to the running version.

http-data.png

Checking The Operation of Process Start

Let's see how it starts by throwing request into Message Start Event. A new process will start by typing HTTP request as following directly into the browser's URL field. Note: For Linux wget command or curl command is also good.

$ wget https://s.questetra.net/********/System/Event/MessageStart/start?processModelInfoId=1&nodeNumber=1&key=********&title=test

If those parameters such as processModelInfoId, nodeNumber, key, etc. are correct, a process with the title of 'Test' will be started. For the sake of simplicity, I have used HTTP GET here though, HTTP POST is recommended more.

 

To Define 'Business Data' to be Passed to Process

Read / Write permission

In this example, the value was specified only in the title when starting the process, it is also possible to specify a value into other process data items. In that case, however, the Process Model need to be set as to specify value in each process data item by Message Start Event. 'Read / Write permission' is the setting for this.

When a Message Start Event is added to the Process Diagram, entries for Message Start Event appears on Read / Write Permission setting screen. Different from the entry of Task, only two type of choice are available, "Read / Write" or "-". "Read / Write" is the setting to accept value, "-" is the setting not to accept value. Select "Read / Write" on the Process Data items which HTTP request passes value to Message Start Event.

Set Values in Each Parameter Name, Transmit Business Data from Outside

When setting on Process Model is completed and is activated, Message Start Event can pass value to Process Data items other than 'Title'.

The Parameter will be the form of 'data [Process Data Item].Data type

e.g.: data[10].input' (data [Process Data Item].Data type)

Number part varies depending on Process Data Item. Check the parameters displayed on the same screen which you check on the URL of Message Start Event. Input part varies depending on Data type of Process Data Item. Some data types require two parameters.

 Process Model Connecting API: Specifications Data Receiving (HTTP)

 

Response

It returns a normal response 200 upon successful completion, but returns other response when an error occurred. And a notification will be sent to the administrator. See 'Response Code' in the following reference for the details of Response.

 Process Model Connecting API: Specifications Data Receiving (HTTP)