Submit Start Form
Starts a process instance using a set of process variables and the business key. If the start event has Form Field Metadata defined, the process engine will perform backend validation for any form fields which have validators defined. See Documentation on Generated Task Forms.
Method
POST /process-definition/{id}/submit-form
POST /process-definition/key/{key}/submit-form
(starts the latest version of the process definition which belongs to no tenant)
POST /process-definition/key/{key}/tenant-id/{tenant-id}/submit-form
(starts the latest version of the process definition for tenant)
Parameters
Path Parameters
Name | Description |
---|---|
id | The id of the process definition to submit the form for. |
key | The key of the process definition (the latest version thereof) to be retrieved. |
tenant-id | The id of the tenant the process definition belongs to. |
Request Body
A JSON object with the following properties:
Name | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
variables | A JSON object containing the variables the process is to be initialized with. Each key corresponds to a variable name and each value to a variable value. A variable value is a JSON object with the following properties:
| ||||||||
business key | A JSON object containing the business key the process is to be initialized with. The business key uniquely identifies the process instance in the context of the given process definition. |
Result
A JSON object corresponding to the ProcessInstance
interface in the engine.
Its properties are as follows:
Name | Type | Description |
---|---|---|
id | String | The id of the process instance. |
definitionId | String | The id of the process definition. |
businessKey | String | The business key of the process instance. |
caseInstanceId | String | The case instance id of the process instance. |
tenantId | String | The tenant id of the process instance. |
ended | Boolean | A flag indicating whether the instance is still running or not. |
suspended | Boolean | A flag indicating whether the instance is suspended or not. |
links | Object | A JSON array containing links to interact with the instance. |
Response Codes
Code | Media type | Description |
---|---|---|
200 | Request successful. | |
400 | application/json | The variable value or type is invalid, for example if the value could not be parsed to an Integer value or the passed variable type is not supported. See the Introduction for the error response format. |
404 | application/json | Process definition with given key does not exist. See the Introduction for the error response format. |
500 | application/json | The instance could not be created successfully. See the Introduction for the error response format. |
Example
Request
POST /process-definition/aProcessDefinitionId/submit-form
POST /process-definition/key/aProcessDefinitionKey/submit-form
Request Body:
{
"variables": {
"aVariable" : {
"value" : "aStringValue",
"type": "String",
"valueInfo" : {
"transient" : true
}
},
"anotherVariable" : {
"value" : true,
"type": "Boolean"
}
},
"businessKey" : "myBusinessKey"
}
Response
{
"links":[
{
"method": "GET",
"href":"http://localhost:8080/rest-test/process-instance/anId",
"rel":"self"
}
],
"id": "anId",
"definitionId": "aProcessDefinitionId",
"caseInstanceId": null,
"businessKey": "myBusinessKey",
"ended": false,
"suspended": false,
"tenantId": null
}