cancel
Showing results for 
Search instead for 
Did you mean: 

Count process instance (active process) by business key

minhquankq
Champ in-the-making
Champ in-the-making
- I want to group process instance by business key, do ProcessInstanceQuery support to group operation?
1 REPLY 1

motorina0
Confirmed Champ
Confirmed Champ
Hi,
   I do not think ProcessInstanceQuery supports grouping directly, but you can use the native queries to write your own SQL statements.
   For example:
<code>List<HistoricProcessInstance> processes = historyService.createNativeHistoricProcessInstanceQuery().sql("select * from ACT_HI_PROCINST…").list();</code>

    Also, for performance reasons, it is better to use the HistoryService, than the RuntimeService.

br,
Vlad