Rest API /v2/processinstances Method
search cancel

Rest API /v2/processinstances Method

book

Article ID: 222414

calendar_today

Updated On:

Products

CA Process Automation Base

Issue/Introduction

I'm looking for documentation or examples for using the filter parameter with the /v2/processinstances method.  Specifically I am looking to filter the results by where the RunState = Running, but any example would be beneficial.  I've tried variations of the following, but the filter param is either ignored or the API returns <Message>Not a valid filter operator in the expression 'runstate = running'</Message>

https://pamtest.mycompany.com/api/rest/v2/processinstances?filter='runstate = running'

Environment

Release : 4.3

Component :

Resolution

Here are examples showing filters for time, runstate and instanceName.

  • runstate: https://pamtest.mycompany.com/api/rest/v2/processinstances?filter=runstate==running
  • endtime: https://pamtest.mycompany.com/api/rest/v2/processinstances?filter=endTime >= 2022-09-06 02:58:28.007;runState==Completed
  • instanceName: https://pamtest.mycompany.com/api/rest/v2/processinstances?filter=instanceName=@db2_*
    In this case, db2_* is the name of the processes I am searching for. 

You can include multiple filters, acting as an AND operator, with the following:

https://pamtest.mycompany.com/api/rest/v2/processinstances?filter=endTime >= 2022-09-06 02:58:28.007;runState==Failed;instanceName=@ParentLoop*