Evaluate a Condition
Triggers evaluation of conditions for conditional start event(s).
Internally this maps to the engine’s condition evaluation builder method ConditionEvaluationBuilder#evaluateStartConditions()
.
For more information see the Conditional Start Events section of the BPMN 2.0 Implementation Reference.
Method
POST /condition
Parameters
Request Body
A JSON object with the following properties:
Name | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
variables | A map of variables which are used for evaluation of the conditions and are injected into the process instances which have been triggered.
Each key is a variable name and each value a JSON variable value object with the following properties.
| ||||||||
businessKey | Used for the process instances that have been triggered after the evaluation. | ||||||||
tenantId | Used to evaluate a condition for a tenant with the given id. Will only evaluate conditions of process definitions which belong to the tenant. | ||||||||
withoutTenantId | A Boolean value that indicates whether the conditions should only be evaluated of process definitions which belong to no tenant or not. Value may only be true , as false is the default behavior. |
||||||||
processDefinitionId | Used to evaluate conditions of the process definition with the given id. |
Result
A JSON array of process instance objects which have been triggered after the evaluation. The array will be empty in case, when no process instances were started. Each process instance object has the following properties:
Name | Value | Description |
---|---|---|
id | String | The id of the process instance. |
definitionId | String | The id of the process definition that this process instance belongs to. |
businessKey | String | The business key of the process instance. |
caseInstanceId | String | The id of the case instance associated with the process instance. |
ended | Boolean | A flag indicating whether the process instance has ended or not. Deprecated: will always be false! |
suspended | Boolean | A flag indicating whether the process instance is suspended or not. |
tenantId | String | The tenant id of the process instance. |
links | Object | A JSON array containing links to interact with the instance. |
Response Codes
Code | Media type | Description |
---|---|---|
200 | application/json | Request successful. |
400 | application/json | If both tenantId and withoutTenantId are supplied. See the Introduction for the error response format. |
403 | application/json | If the user is not allowed to start the process instance of the process definition, which start condition was evaluted to `true`. See the Introduction for the error response format. |
Example
Request
POST /condition
Request Body:
{
"variables" : {
"temperature" : {"value" : 24, "type": "Integer",
"valueInfo" : { "transient" : true } },
"city" : {"value" : "Parma", "type": "String"}
},
"businessKey" : "aBusinessKey",
"tenantId" : "aTenantId"
}
Response
[{
"links": [],
"id": "aProcInstId",
"definitionId": "aProcDefId",
"businessKey": "aBusinessKey",
"caseInstanceId": null,
"ended": false,
"suspended": false,
"tenantId": "aTenantId"
},
{
"links": [],
"id": "anotherId",
"definitionId": "aProcDefId",
"businessKey": "aBusinessKey",
"caseInstanceId": null,
"ended": false,
"suspended": false,
"tenantId": aTenantId
}]