I've been experimenting with this since we need it to. I currently seem to have something working, mostly based on existing libraries. It seems to be working, but I have to make test-cases for edge- cases (leap-year etc)
Current limitations:
- BusinessMonth = 1 real month, so not taking into account holidays, unless the 'end date' is on such a day
- BusinessYear = 1 real year, so not taking into account holidays, unless the 'end date' is on such a day
- Negative values not supported yet
- Same number of working working hours for each working day, which currently is fixed to mon-fri (start-end time will be configurable, lunch breaks do not exist)
- Holiday's not customizable yet, just talking the default holidays of a locale into account
- Not possible to add holiday's of individual users in cases where this user participates (illogical sla wize)
Would this be something that could already work?
One question though… how are we going to specify on a duration that it is a business duration? An additional attribute :
<timeDuration activiti:type="business">P10D</timeDuration>
with the attribute being absent defaulting to the current behaviour?