'Get count variable instances with variables using REST API
I have the below variables
when i count the number of variable instances with the variable conventionCode, the api returns count = 1
http://localhost:8282/engine-rest/variable-instance/count?processInstanceIdIn=b622ad4d-9a11-11ec-937b-0242ac11000a&variableValues=conventionCode_eq_01018
when i count the number of variable instances with the variable exerciceFrameworkId, the api returns count = 1
http://localhost:8282/engine-rest/variable-instance/count?processInstanceIdIn=b622ad4d-9a11-11ec-937b-0242ac11000a&variableValues=exerciceFrameworkId_eq_SA-FR-LAB-6969284
The problem is when i use the two variables conventionCode and exerciceFrameworkId, the api returns count = 0
http://localhost:8282/engine-rest/variable-instance/count?processInstanceIdIn=b622ad4d-9a11-11ec-937b-0242ac11000a&variableValues=conventionCode_eq_01018,exerciceFrameworkId_eq_SA-FR-LAB-6969284
Solution 1:[1]
The API is focused on variables. So it will check each variable if your filters match.
In your example you defined 2 filters:
conventionCode_eq_01018exerciceFrameworkId_eq_SA-FR-LAB-6969284
So for each variable with the name conventionCode and the value 01018 the first filter matches.
However, it is impossible that this matches to the 2. filter as its name is conventionCode and not exerciceFrameworkId.
So in the end you have no variables in your result.
That means it is a logical AND and not as you expected a logical OR.
See also the REST-API Reference
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | pme |

