I dont seem to be able to get this to work, it always seems to report 0. Or maybe I'm missing something ?
This code :
HistoricProcessInstanceQuery piHistory = historyService.createHistoricProcessInstanceQuery();
System.out.println("Total Historic Processes = "+piHistory.count());
System.out.println("Processes in progress = "+piHistory.unfinished().count());
System.out.println("Processes completed = "+piHistory.finished().count());
Produces this output :
Total Historic Processes = 7
Processes in progress = 2
Processes completed = 0
The database looks like this :
SELECT * FROM ACT_HI_PROCINST;
ID_ PROC_INST_ID_ BUSINESS_KEY_ PROC_DEF_ID_ START_TIME_ END_TIME_ DURATION_ START_USER_ID_ START_ACT_ID_ END_ACT_ID_
3 3 null financialReport:1 2010-12-10 10:39:06.131 2010-12-10 10:39:12.4 6269 null theStart theEnd
8 8 null financialReport:1 2010-12-10 10:39:12.46 2010-12-10 10:39:24.577 12117 null theStart theEnd
13 13 null financialReport:1 2010-12-10 10:39:18.479 2010-12-10 10:39:24.667 6188 null theStart theEnd
18 18 null financialReport:1 2010-12-10 10:39:24.718 2010-12-10 10:39:36.885 12167 null theStart theEnd
23 23 null financialReport:1 2010-12-10 10:39:30.736 2010-12-10 10:39:36.945 6209 null theStart theEnd
28 28 null financialReport:1 2010-12-10 10:39:36.975 null null null theStart null
33 33 null financialReport:1 2010-12-10 10:39:43.004 null null null theStart null
(7 rows, 10 ms)