Search code examples
bpmncamunda

Camunda: find process instance by variable value


Can I find a process instance by a process instance variable value via the Camunda REST API as described in this request: https://groups.google.com/forum/#!topic/camunda-bpm-dev/gJfXkbkY8fc (the question above is from 2014, maybe there is a standard way now?)


Solution

  • Looks like this is supported now:

    GET /process-instance

    variables: Only include process instances that have variables with certain values. Variable filtering expressions are comma-separated and are structured as follows: A valid parameter value has the form key_operator_value. key is the variable name, operator is the comparison operator to be used and value the variable value.

    There is also a POST endpoint which allows to express the filtering more cleanly:

    POST /process-instance

    variables: A JSON array to only include process instances that have variables with certain values. The array consists of objects with the three properties name, operator and value. name (String) is the variable name, operator (String) is the comparison operator to be used and value the variable value.