Response code is 200. I’ve tried using the process definition id, process definition key and even process instance id (although I’m pretty sure it’s the process definition id).
you will receive an empty JSON array even if the process definition id does not exist.
Are you sure that you used the right process definition id?
You can validate it by listing all deployed process definitions with the following REST API endpoint:
If you perform a request without any parameter you will only receive running activity instances.
To include activity instances which have already been finished, please see the query parameters section.
I’m afraid I get no data just an empty array in the body. I’ve used no query parameters and nothing. I would expect to see some results. Even if I programmatically execute the same query as the REST API I still get no results.
@aminmc
I’m facing the same issue, /process-definition/{id}/statistics this rest call returns an empty array but invoking /history/process-instance/aProcInstId gives proper result. What could be the possible reason ?
Were you able to fix this ??
By default, REST api /process-definition/{id}/statistics returns only running activity instances. This means if activity instance has completed its execution then it won’t be part of the result. Please check the state of Activity Instance for the provided process definition.
Where as REST api /history/process-instance/aProcInstId returns process instances irrespective of their state ( Active, Suspended, Completed, Terminated etc.). That’s the reason this API will always return non-empty result if process instance id exists and is valid.
You are right. It doesn’t lists completed instances but contains active instances instead.
My requirement is to get the list of Running, Suspended, Finished and Failed instances of a particular Process Definition. Is there any other way to achieve this ?