Grouping Processes by Variables

Hello,

I was wondering is there is a way to count process instances while grouping by a certain variable value.

For example query the number of process instances which contain the variable merchant_id and group this number by the value of merchant ID.

I would like to achieve that using the HistoricProcessInstanceQuery.

Thanks for your help.

I don’t think it’s possible. Your options are use the search API and implement the grouping in the code or directly query the DB.

@fml2 Thanks for your reply, I just wanna make sure that by “search API” you mean the run time Service or the historic Service. Or is there anything called “SearchAPI” on its own ?

Much appreciated for the help

No, I meant the history service with its query API.