REST API - queryProcessInstances

The table summarizes the REST API - queryProcessInstances.

Request

Format
GET <baseurl>/process/query/instance/<query>/<pagesize>
Path parameters
  • query: Full (SQL syntax) query string. The "FROM process" clause should be included in the query.

    For information about valid SQL syntax, see Sorting and Filtering Lists of Process Templates and Instances.

  • pagesize: Page size to be used to return the list of process instances. One of the following values:
    • 0: Return the entire result set in a single, non-paged list. The result set when using this value is restricted to 500 entries.
    • -1: Return the result set in a paged list, using the default page size.
    • positive integer: return the result set in a paged list, with the specified number of items on each page.

      If you specify a paged result (pageSize = -1 or a number greater than 0), use the queryFirstPage, queryLastPage, queryNextPage, and queryPreviousPage operations to navigate the paged list, and queryDone to clear resources when you are finished with the paged list. (Note that the result limit for non-paginated queries (pageSize=0) is 500.)

Query parameters
  • name=string (0..n): Name of the template attribute.
  • type=string (0..n): Data type of the template attribute.

    If a user-defined attribute is used in the query of a paginated response, that attribute and its type should be included in the query parameters, otherwise a database query must be made to get the type of the user-defined attribute, making the request less efficient

  • statusmode: (Optional) Filters process instances returned according to their current status. The valid entries are ACTIVE, TERMINATED, or ACTIVE_AND_TERMINATED. Default = ACTIVE.

Response

JSON Returns a JSON representation of the content of the queryProcessInstancesOutput element.
XML Returns the content of the a queryProcessInstancesOutput element (from the ProcessManagement schema).

Example

Request
GET <baseurl>/process/query/instance/SELECT%20ContactName%20FROM%20process%20WHERE%20INSTANCE.PRIORITY%20%3E%201/0?statusmode=ACTIVE
Response
{
        "xml-fragment":
        {
            "processInstances":
            {
                "processInstance":
                [
                    {
                        "customAttributes":
                        {
                            "customAttribute":
                            {
                                "name": "ContactName",
                                "value": "Billy Smith"
                            }
                        }
                    },
                    {
                        "customAttributes":
                        {
                            "customAttribute":
                            {
                                "name": "ContactName",
                                "value": "Nancy Marshall"
                            }
                        }
                    },
                ]
            },
            "pagingID": 0
        }
    }