BS-11338 : Sonar : Reduce complexity

- Refactor ProcessInstanceService and ActivityInstanceService to reduce the complexity
- Remove some try/catch not to have too many wrapping of the exceptions.