How to perform multiple variable filter on process instances in camunda 8.2

Basically need to filter out values on variables of all process instance.
I want to search multiple variables and their values of process instances and want to fetch out that process instances only.
I know there is variable search api in operate (v1/variables/search).
But this search for single variable only.How can i filter multiple variables and return process instances?in camunda 8.2

Hello @Neha1 ,

currently, this is not possible.

As I see it, there are actually 2 separate features you would require:

  • usage of multiple filters that can use an or-logic
  • go from variable values to process instances in one request.

While the first one sound quite interesting, the second could be a bit harder as by data model, a variable instance is not part of the process instance.

However, I think that the first feature would bring down the amount of requests required to 2 which is already some progress.

In fact, I am currently defining a feature request for the first feature, so please feel free to share your thoughts and requirements.

Sorry I cannot help you directly.

Jonathan

Thanks for response.

I can explain the sitatuion in better way for requirement :

Requirement 1 :I have UI with search options where user can search on multiple fields . These fields corresponds to instance variables in Camunada.

For Example : If user select Customername="Jonathan " and State=“NJ” in UI and click Search then it should fetch process instance details ( All variable values of matching process ) of those processes where value of Customername=“Jonathan” and State=“NJ”

The Approach we have working using Operate Rest API is below but it’s not desired

1)Get All process instancess using /instance/search api ( by passing process id)

2)Get process instance key of process instances

3)get all variable of process instance key

4)match the required variable value and then return that instance(CustomerName,State are variables for process instance)

Requiremernt 2 : Find all process instance for which a particular task is assigned to someone and also for which certain process instance variable values are provided .

For Example : Display process instance details where Document Review Task is assigned to Jonathan and State=“TX” and Customername=“Neha”

Approach we have working :

1.Using TaskList Rest API get details where assignee=“Jonathan” and TaskDefinitionId=“ID of Review Task” and State=“Active” this gives Process Instance key of all the process for which Document Review task is assigned to Jonthan

  1. Now the next step - out of all the process instances returned in step 1 how do we find which process instance have instance variable matching with Search Criteria ( State=“TX” and Customername=“Neha”) -

( we are getting variables for all instances and then comparing values of Customername and State for all the instances and if match ,then return details ofthat instances but this is not ideal)

for Abocve 2 Requirements :

1 . We need direct variables search.If we pass multiple variables then it should check for its name and values and then return that process instances only.

  1. if we have list of process instance keys , can we filter them based on multiple variable search criteria . ( Task API gives us the list of instance key with matching task condition and then we need to filter those instances based on matching instance variables criteria)

If you can open this as feature request that would help us a lot.

Also would like to know how much time it will take for feature to release as we are tight on timelines to deliver the requiremernt .

1 Like

Hello @Neha1 ,

as you are using the Operate REST API, are you a customer or planning to become one?

Jonathan