Returns historic and current process information.
Note that query results will include currently running processes unless
Familiarise yourself with the Queries and Performance article before using this function.
Parameters
Name | Type | Description |
---|---|---|
excludeSubprocesses | Boolean | If this is true, only top-level processes will be returned |
finished | Boolean | If this is not specified, both active and completed processes will be returned, if false only active processes will be returned, if true only completed 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 |
finishedAfter | Date | If specified, only processes that completed after the supplied date will be returned |
finishedBefore | Date | If specified, only processes that completed before the supplied date will be returned |
includeList | Boolean | If false, only a count of matching results will be returned; this property is true by default |
includeCurrentTasks | Boolean | Include details of any active tasks for returned process instances |
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 used to start returned process instances |
includeProcessDescription | Boolean | Include the expanded process description (documentation field) in the response |
includeProcessVariables | Boolean | If true, all process variables will be returned for each process instance in the result. This is potentially a very expensive operation. If you know the names of the variables you require, set the variableList parameter instead (when using variableList, do not set this parameter) |
includeTaskDescriptions | Boolean | Include expanded task description (documentation field) |
includeTaskVariables | Boolean | Include task local variables |
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 |
orderByProcessInstanceBusinessKey | "asc" or "desc" | Order results by business key |
orderByProcessInstanceDuration | "asc" or "desc" | Order results by time since process was started |
orderByProcessInstanceEndTime | "asc" or "desc" | Order results by date/time process was completed |
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) |
orderByProcessInstanceStartTime | "asc" or "desc" | Order results by the date/time the process was started |
processDefinitionId | String | Only return processes with the specified process definition ID |
processDefinitionKey | String | Only return processes with the specified process definition key |
processDefinitionKeyIn | List<String> | Only return process instances that have a process definition key included in the supplied list |
processDefinitionKeyNotIn | Array<String> | Only return processes which do not have a process definition with one of the specified keys |
processInstanceBusinessKey | String | Only return process instances which have the specified business key |
processInstanceBusinessKeys | Array<String> | Only return process instances that have a business key in the supplied array |
processInstanceId | String | Only return the process instance which has the specified process instance 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, ProcessInstanceBusinessKey ProcessInstanceDuration ProcessInstanceEndTime ProcessInstanceId ProcessInstanceStartTime |
startedAfter | Date | Only return process instances which were started after the specified date |
startedBefore | Date | Only return process instances which were started before the specified date |
startedBy (startedByUser can also be used in 1.2.3 or later) | String | Only return process instances which were started by the specified user |
superProcessInstanceId | String | Only return process instances which are subprocesses of the specified process ID |
unfinished | Boolean | If true, only return processes that are unfinished, if false only return processes that are finished |
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 specifies a value variableCondition specifies a condition, valid values for variableCondition are "equals", "equalsIgnoreCase", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "like" and "notEquals" |
variableValue | String/Number | |
variableCondition | String | |
variableList | Array<string> | Only return the named process variables. We recommend using this parameter rather than includeProcessVariables (which returns all variables). Only include one of variableList or includeProcessVariables, setting both will return no results |
withoutVariableAll | Array<string> | The returned instances must not have one of these named variables. The more variables you name the broader your exclude list becomes, meaning fewer instances will be returned. An empty array returns all instances |
withoutVariableAny | Array<string> | The returned instances must not have these named variables. The more variables you name the more specific your exclude list becomes, meaning more instances will be returned. An empty array returns no instances |
withVariableAll | Array<string> | The returned instances must have all of these named variables. The more variables you name the more specific your filter becomes, meaning fewer instances are returned. An empty array returns all instances |
withVariableAny | Array<string> | The returned instances must have at least one of the named variables. The more variables you name the broader your filter becomes, meaning more instances will be returned. An empty array returns no instances |
withTaskAssignedUser | String<username> | Only return instances that have tasks assigned to the supplied user. This will only ever return active process instances |
withTaskCandidateUser | String<username> | Only return instances that have tasks that the supplied user can claim. This will only ever return active process instances. Once a task has been claimed the instance will not be returned by this query |
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 |
Examples
Requesting All Variables
this.callWorkerMethod("workflow", "getHistoricProcessInstances",{
"processInstanceBusinessKey":"3835-6145-6689-1424",
"includeProcessVariables": true
});
Response
{
"jsonrpc": "2.0",
"id": 53,
"result": {
"count": 1,
"list": [{
"startUserId": "anonymous",
"startTime": "2018-03-28T14:09:26Z",
"id": "66132",
"businessKey": "3835-6145-6689-1424",
"processDefinitionName": "labelc histories",
"processVariables": {
"DELETEDATE": "20181212",
"form_NOTES": "t",
"APICALLERROR": "",
"_startForm": "FORMTOSTARTASIMPLEPROCESS",
"_initiatorProxy": "",
"form_FILEUPLOAD": "file/6B6F8CB1-7B1A-4A0D-95B8-0A41C83B0219/thumbmaplepresleaf.png",
"_processDefinitionID": "labelchistories:21:66086",
"_startPageURL": "http://timssite/testform",
"_ReviewTask_claimed": {
"taskId": "66160",
"time": "2018-03-28T14:10:20Z",
"user": "timg",
"proxyUser": ""
},
"form_TEXT1": "test",
"_startDate": "2018-03-28T14:09:26Z",
"_ReviewTask_completed": {
"taskId": "66160",
"time": "2018-03-28T14:10:29Z",
"user": "timg",
"proxyUser": ""
},
"STARTDATE": "2018-03-28T14:09:26Z",
"initiator": "anonymous",
"_fileReferences": {
"form_FILEUPLOAD": [{
"id": "6B6F8CB1-7B1A-4A0D-95B8-0A41C83B0219",
"filename": "thumbmaplepresleaf.png"
}]
},
"form_RADIOGROUP": "Yes",
"_startDateString": "2018-03-28 15:09:26",
"_businessKey": "3835-6145-6689-1424",
"_summaryForm": "FORMTOSTARTASIMPLEPROCESS",
"_processDefinitionKey": "labelchistories",
"APICALLRESULT": {
"eventpos": 1,
"historyid": "428c8828-2fd7-4d83-af08-146b618b19dd",
"eventid": 2888
}
},
"endTime": "2018-03-28T14:10:29Z",
"processDefinitionId": "labelchistories:21:66086"
}]
}
}
Requesting Named Variables
this.callWorkerMethod("workflow", "getHistoricProcessInstances", {
"processInstanceBusinessKey": "3835-6145-6689-1424",
"variableList": ["form_TEXT1", "initiator"]
});
Response
{
"jsonrpc": "2.0",
"id": 54,
"result": {
"count": 1,
"list": [{
"startUserId": "anonymous",
"startTime": "2018-03-28T14:09:26Z",
"id": "66132",
"businessKey": "3835-6145-6689-1424",
"processDefinitionName": "labelc histories",
"processVariables": {
"form_TEXT1": "test",
"initiator": "anonymous"
},
"endTime": "2018-03-28T14:10:29Z",
"processDefinitionId": "labelchistories:21:66086"
}]
}
}