Query the indexed process collection.
Parameters
Name | Type | Description |
---|---|---|
useQueryService | Boolean | This should always be set to true. It is present for backwards compatibility and will be removed in a future release |
filter | Object | Return process instances matching the provided filter |
start | Number | (Optional) Where to start the result set from, defaults to 0 |
limit | Number | (Optional) How many results to return, defaults to 10 |
sortOrder | Array<Object> | (Optional) Enables multi-column ordering. For example |
Filter Keys
The following keys can be used when building filters to query indexed process instances.
Name | Type | Description |
---|---|---|
active | Boolean | Can only have the value Only one of |
completed | Boolean | Can only have the value Only one of |
assignee | String | Users assigned to any of the process's tasks |
candidate | String | Candidate users for any of the process's tasks (Groups are automatically resolved) |
startedBy | String | The user who started the process |
startedByProxy | String | the proxy user who started the process |
involvedUser | String | A user involved with the process |
processDefinitionKey | String | The definition key of the process |
processId | String | The process with the specific ID |
businessKey | String | The business key of the process |
description | String | The expanded description of the process |
startedDate | String (ISO8601) | The started date of the process |
completedDate | String (ISO8601) | The completed date of the process |
suspended | Boolean | Whether the process is suspended or not |
Example
See the Filters article for further examples.
Request
This example fetches all active "feedback review" processes started by timg.
function(params, credentials) {
let resp = this.callWorkerMethod("workflow", "getQueryProcesses", {
"useQueryService": true,
"filter": {
"AND": [{
"key": "startedBy",
"EQ": "timg"
}, {
"key": "processDefinitionKey",
"EQ": "feedbackreview"
},
{
"key":"active",
"EQ": true
}
],
}
});
return resp;
}
Response
Note that
{
"list": [{
"processVars": {
"form_FEEDBACK": "Here's some feedback",
"form_ISSUETYPE": "Error",
"form_URL": "https://docs.gossinteractive.com/article/7747/getQueryProcesses"
},
"id": "240001",
"processDescription": "Review comments from the feedback form",
"type": "WorkflowProcessInstance",
"businessKey": "5168-8848-3661-2384",
"processDefinitionName": "Feedback Review",
"processDefinitionKey": "feedbackreview",
"processDefinitionId": "feedbackreview:5:92504",
"startTime": "2022-02-18T15:08:40Z",
"endTime": null,
"tasks": [{
"id": "240026",
"taskDescription": "Review feedback for https://docs.gossinteractive.com/article/7747/getQueryProcesses",
"assignee": "timg",
"candidateGroups": ["staff"],
"candidateUsers": [],
"canUnclaim": true
}],
"messageDefinitions": {},
"startUserId": "anonymous",
"startProxyUserId": null,
"parentBusinessKey": null,
"parentProcessId": null,
"suspended": false
}],
"count": 1,
"time": 4,
"debug": null
}