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.

Name Description
value The variable's value. For variables of type Object, the serialized value has to be submitted as a String value.

For variables of type File the value has to be submitted as Base64 encoded string.

type The value type of the variable.
valueInfo A JSON object containing additional, value-type-dependent properties.

For serialized variables of type Object, the following properties can be provided:

  • objectTypeName: A string representation of the object's type name.
  • serializationDataFormat: The serialization format used to store the variable.

For serialized variables of type File, the following properties can be provided:

  • filename: The name of the file. This is not the variable name but the name that will be used when downloading the file again.
  • mimetype: The MIME type of the file that is being uploaded.
  • encoding: The encoding of the file that is being uploaded.

The following property can be provided for all value types:

  • transient: Indicates whether the variable should be transient or not. See documentation for more informations.

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 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
}]

On this Page: