Returns details of active or suspended process instances matching the specified criteria. Familiarise yourself with the Queries and Performance article before using this function.
getQueryProcesses, which uses the workflow search collection, is more performant than this function and has a range of Filters you can use to find tasks. getQueryProcesses should be your preferred choice over this function which, although still supported, primarily exists for backwards compatibility.
Parameters
Name | Type | Description |
---|---|---|
active | Boolean | Default: true. If true, only include process instances that are currently active. If false, include suspended instances |
excludeSubprocesses | Boolean | If this is true, only top-level processes will be returned |
firstResult | Number | The first result from the possible list of results to return (starting from 0); in conjunction with maxResults this can be used to implement paging |
includeCanUnclaim | Boolean | If true, include unclaimability of tasks in response |
includeCurrentTasks | Boolean | Include details of any active tasks for returned process instances |
includeTaskVariables | Boolean | Include task variables for active tasks |
includeTaskDescriptions | Boolean | Include expanded task descriptions for active tasks (documentation field) |
includeList | Boolean | If false, only a count of matching results will be returned; this property is true by default |
includeMessageListeners | Boolean | Include details of any active message listeners in the response. Currently only supports boundary messages |
includeProcessDefinition | Boolean | Include full details of the process definition uses to start the returned process instances |
includeProcessDescription | Boolean | Include the expanded process description (documentation field) in the response |
includeProcessVariables | Boolean | If true, process variables will be returned for each process in the result |
includeStarterDetails | Boolean | Include start time, start user ID, process definition ID |
involvedUser | String | Only return process instances which have the specified involved user |
maxResults | Number | The maximum number of results to return; in conjunction with firstResult this can be used to implement paging. Defaults to 5000 if not set |
orderByProcessDefinitionId | "asc" or "desc" | Order results by process definition ID |
orderByProcessDefinitionKey | "asc" or "desc" | Order results by process definition key |
orderByProcessInstanceId | "asc" or "desc" | Order results by process instance ID (note that the process instance ID is represented as a string so 77 will appear after 100) |
processDefinitionId | String | Only return processes with the specified process definition ID |
processDefinitionKey | String | Only return processes with the specified process definition key |
processDefinitionName | String | Only return processes with the specified process definition name |
processInstanceBusinessKey | String | Only return process instances which have the specified business key |
processInstanceId | String | Only return the process instances which has the specified ID |
processInstanceIds | Array<String> | Only return process instances which have one of the specified process instance IDs |
sortOrder | Array<Object> | Enables multi-column ordering using the "orderBy" parameters above. For example, ProcessDefinitionKey ProcessInstanceId |
subProcessInstanceId | String | Return only the process instance that is the immediate superprocess of the specified process instance ID |
superProcessInstanceId | String | Only return process instances which are subprocesses of the specified process ID |
suspended | Boolean | If true, only return processes which are currently suspended |
variableName | String | These parameters are used together to only return instances that have a variable with a value that meets the set condition, eg a variable called "name" with a value that equals "Tim". variableName specifies a process variable name |
variableValue | String/Number | |
variableCondition | String | |
All parameters are optional but note that as there are no filters by default a very large results set may be generated if there are no restrictions specified in the query |
Example Request
this.callWorkerMethod("workflow", "getProcessInstances",{
"active":true,
"includeStarterDetails":true
});
Response
{
"jsonrpc": "2.0",
"id": 134,
"result": {
"count": 1,
"list": [{
"businessKey": null,
"isSuspended": false,
"processVariables": {},
"processDefinition": {
"id": "anactiveprocess:1:2509",
"formProperties": {},
"category": "http://www.gossinteractive.com/processdef",
"diagramResourceName": "an active process-V-1.anactiveprocess.png",
"description": "Starts on a timer and last for a long time",
"isSuspended": false,
"name": "an active process",
"identityLinks": [],
"deploymentId": "2506",
"resourceName": "an active process-V-1.bpmn20.xml",
"key": "anactiveprocess",
"version": 1
},
"activityId": null,
"id": "2511",
"startTime": "2017-02-01T15:44:14Z",
"startUserId": null,
"parentId": null,
"isEnded": false,
"processInstanceId": "2511",
"rawFormData": {},
"processDefinitionId": "anactiveprocess:1:2509"
}]
}
}