REST API - startProcessIncomingReceiveTask

The table summarizes the REST API - startProcessIncomingReceiveTask.

Request

Format
POST <baseurl>/process/start/<modulename>/<processname>/<version>
Path parameters
  • modulename: Name of the module to which the REST service belongs. This can be obtained from the REST Module Name field on the REST Service Details pane in TIBCO Business Studio when a process is published as a REST service.
  • processname: Name of the process for which an instance is being started. This can be obtained from the REST Service Name field on the REST Service Details pane in TIBCO Business Studio when a process is published as a REST service.
  • version: OSGi-style version number of the process template. (This version number is the same as that of the module.)

    The parameters listed above can be obtained from listServices . They can also be obtained from the process/REST service definition in TIBCO Business Studio.

Query parameters responsetype=string: Specifies the type of response data: XML or JSON (the default).
Body formalParams element (required if the process has formal parameters): Specifies the page data for the formal parameters associated with the process.

Note: You cannot determine the names of these formal parameters programmatically. Instead, you must obtain them by examining the process in TIBCO Business Studio.

Do not supply a Body element if the process has no formal parameters.

Response

JSON Returns a JSON representation of the contents of the payload element.
XML Returns the contents of the payload element.

Example 1 - XML payload and response

Headers:

  • Content-Type: application/xml
  • Accept: application/xml
Request
POST <baseurl>/process/start/%2FWelcomeUsersImplementSolution%2FProcess%20Packages%2FProcessPackage.xpdl/WelcomeUsers_StartEvent/1.0.0
Request body
<formalParams payloadMode="XML">
   <XmlPayload>
      <inputs array="false" name="PhoneNumber" optional="false" type="string">
        <simpleSpec>
           <value>378-823-2300</value>
        </simpleSpec>
      </inputs>
      <inputs array="false" name="UserName" optional="false" type="string">
         <simpleSpec>
            <value>Frankie Doodle</value>
         </simpleSpec>
      </inputs>
   </XmlPayload>
</formalParams>
Response
<?xml version="1.0" encoding="UTF-8"?>
    <xml-fragment payloadMode="JSON">
      <serializedPayload>{"items":[{"$param":"PhoneNumber","$value":["378-823-2300"],"type":"String","mode":"IN"},{"$param":"UserName","$value":["Frankie Doodle"],"type":"String","mode":"IN"}]}</serializedPayload>
    </xml-fragment>

Example 2 - JSON payload and response

  • Content-Type header = application/json
  • Accept header = application/json
  • responsetype=JSON
Request
POST <baseurl>/process/start/%2FWelcomeUsersImplementSolution%2FProcess%20Packages%2FProcessPackage.xpdl/WelcomeUsers_StartEvent/1.0.0
Request body
{"formalParams": {
	"@payloadMode": "JSON",
	"serializedPayload": "{\"items\":[{\"$param\":\"PhoneNumber\",\"$value\":[\"556-209-7789\"],\"type\":\"String\",\"mode\":\"IN\"},{\"$param\":\"UserName\",\"$value\":[\"Mike Blowers\"],\"type\":\"String\",\"mode\":\"IN\"}]}"
}}
Response
{
  "xml-fragment": {
    "@payloadMode": "JSON",
    "serializedPayload": "{\"items\":[{\"$param\":\"PhoneNumber\",\"$value\":[\"556-209-7789\"],\"type\":\"String\",\"mode\":\"IN\"},{\"$param\":\"UserName\",\"$value\":[\"Mike Blowers\"],\"type\":\"String\",\"mode\":\"IN\"}]}"
  }
}

For more payload format examples, see Valid Format for DataModel.