Counting process instances
You can use the Process Admin Console or a REST API call to count the number of
process instances that match specified criteria before you decide whether to delete
them.
You can only perform this operation if your user ID is a member of the
administrator group.
Remember: If you want to specify particular
process instance states, the states
running, finished,
and stopped correspond to the states active, completed,
and failed in wsadmin and Process Inspector.Using the Process Admin Console
- Click .
- Select the command Count Processes.
- Specify values for the command's parameters.
- Click Submit.
- If there is an error, you will see the error message.
- If there is no error, you see how many instances in the system match the criteria.
Using a REST API call
Call the operations REST API GET
https://host:port/ops/std/bpm/processes/count.
Remember: For IBM® BPM on
Cloud,
the operations REST APIs have the following URL,
https://hostname.bpm.ibmcloud.com/bpm/environment/ops/std/bpm/processes/count,
where environment has the value dev for
the development system, test for the test system,
or run for the production (runtime) system.The following examples illustrate how to use the API.
- To count all process instances that are in the states
finishedorterminated:GET https://host:port/ops/std/bpm/processes/count?states=finished,terminated - To count all process instances that are in the states
finishedorterminatedthat ended before2016-07-16T19:20:30-06:00:GET https://host:port/ops/std/bpm/processes/count?states=finished,terminated &ended_before=2016-07-16T19:20:30-06:00Remember: If you need to specify a time zone that is ahead of UTC, you must encode the+symbol as%2B. For example, for the Central European Time zone+01:00, you must use%2B01:00in your URL. Alternatively, you can specify a UTC date, for exampleended_after=2016-01-01T01:00:00Z. - To count all process instances of snapshots
V2andV3of the process application that has the acronymXYZand are in the statestopped:GET https://host:port/ops/std/bpm/processes/count?container=XYZ &versions=V2,V3&states=stopped
Important: All calls to the Operations REST API require that the HTTP header
BPMCSRFToken is set with every request. For information about how to obtain a
token, see Preventing cross site request forgery.Tip: For more details about the operations REST APIs and to try invoking them from a
browser, use the Swagger interface. The Swagger interface is available at the URL
https://server:port/ops/explorer
Where server is the host name of your workflow server and port
is the port number that is used by the workflow server. For example,
https://localhost:9443/ops/explorer