How to find a process instance by variable value

Hi, i have my process instances running on multiple definitions, each instance stores a reference to my domain object.

Now, from my app i want to check if a process of particular definition is running for my domain object.

Correct me if im wrong, but to my understanding, since C8 is not longer based on relational DB, i have to retrieve all variables representing my domain object in the engine via operate api, and then fetch data about the corelated process instance by the processInstanceKey provided with the result of the variable search query and only then can i verify if a process instance for given process definition is indeed running.

This seems to me like a very complicated way of checking for this information, especially if i have a large number of processes running or my domain object.

Is there any other, easier way to somehow combine these filters in a single request?

I’m running 8.7

Hi @JohnArray - might this endpoint work?

It is an alpha endpoint in 8.7 - and needs to explicitly enabled - but it will be GA in the 8.8 release in October and is quite stable in 8.7. You can search for PI’s using a variable key+value pair.

2 Likes

yep, this would work for us, but we decided to wait and not use alpha features until its production ready

@JohnArray - gotcha, then the best way without using alpha endpoints currently is to search for PIs using variables here:

And then retrieve any additional details about the PI you might need:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.