i think there is a problem with business calendar or we missing some parts.
When i run the following code i got the following results respectively althoug i didnt make any change to jbpm.businness.calendar.properties file.
It doesnt care about day parts for afternoons (12:30-17:00) it assumes business day finishes after 12:00 i think. i didnt check the code but i think it works so,
Calendar calendar = BusinessCalendar.getCalendar();
Date quarterPastTwelve = calendar.getTime();
Date fiveBusinessHoursAfterQuarterPastTwelve =
businessCalendar.add(quarterPastTwelve, new Duration("2 business hours"));
Thu Apr 07 11:15:00 EEST 2005
Fri Apr 08 10:15:00 EEST 2005 (that was suppose to be Thu Apr 07 13:45:00) according to dayparts defined in properties file.
when i dont use 'business' for duration it works correctly.
is it a bug? or missing something?
sorry for variable names confusion, i got this snippet from test suite ,i change values of variables but didnt change variable names for Dates.
I think you are quite right. There is something wrong with the second daypart because when it comes to it things got messed.
But there is more than that. I've just created a task started at
2006-02-28 13:16:16.767having duration of 7 business hours. And the end date was correctly calculated i.e.
After that I have another task that started at
2006-02-28 13:18:14.327but to my big surprise its end date was calculated to
2006-03-06 13:18:00.000which is far, far away from the truth :( So when it comes to the afternoon day part something breaks. Unfotunatelly there is no any heuristic dependency between the wrong calculations that can help for defining the problem.
I've been writing posts for the wrong calculations of the durations a long time ago and as far as I remember the answer was that it would be fixed in the later versions. I am not sure if there is a jirra issue about this though :(
Otherwise if the word business is omitted everything goes smooth.