Hi,
I would like to query for cases with a specific businessStatus and certain variable values using the REST API.
I’ve noticed that with GET /cmmn-runtime/case-instances, I can filter by businessStatus, but not by variable content.
On the other hand, using POST /cmmn-api/cmmn-runtime/case-instances, I can filter by variables, but the businessStatus filter seems to be ignored, which feels a bit inconsistent.
Is there a way to achieve this kind of combined filtering using the API?
Thanks a lot!
Hey @antonio.pascual,
Which version of Flowable are you using?
If I look at our CMMN Swagger Docs, I see that we have businessStatus, businessStatusLike and businessStatisLikeIgnoreCase as available options.
If I look at the CaseInstanceCollectionResource, I can see that the businessStatus option was added in 6.8.0 (see Added state query option + added missing query options in CMMN case i… · flowable/flowable-engine@c543fed · GitHub) and the businessStatusLike and businessStatusLikeIgnoreCase options were added in 7.1.0 (see Add more query options with like and like ignore case for case and pr… · flowable/flowable-engine@57655c8 · GitHub)
Cheers,
Filip
Hi @filiphr,
Thanks for the response. I’m using version 7.1.0. Yes, you are right, in the GET /cmmn-runtime/case-instances I can filter by businessStatus and it works. What I’m trying to do is to filter by businessStatus using POST /cmmn-query/case-instances, that allows me to filter using variables at the same time.
Despite that the documentation says that I can use all possible filters available in list cases, or I’m missing something, or it is not working:
I have tried including the businessStatus, businessStatusLike, etc in the body or in the query string and they are ignored.
Thanks.
Sorry, I got confused a bit. For the GET you indeed can use businessStatus, businessStatusLike and businessStatusLikeIgnoreCase. For the POST you need to use caseInstanceBusinessStatus, caseInstanceBusinessStatusLike and caseInstanceBusinessStatusLikeIgnoreCase.
Cheers,
Filip