BS-11333 : For the monitoring, need to get the number of open process instances by process definition

- Modify the fillCounters method of the APIProcess to fill the number of the open cases
- Add unit tests
- Fix the filters for the fillCounters for the number of the failed cases