-
1. Re: Spelling mistake in jbpm.business.calendar.properties fi
idyuce Feb 28, 2006 4:45 AM (in response to saviola)Hi,
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();
calendar.set(Calendar.YEAR, 2005);
calendar.set(Calendar.MONTH, Calendar.APRIL);
calendar.set(Calendar.DAY_OF_MONTH, 7);
calendar.set(Calendar.HOUR_OF_DAY, 11);
calendar.set(Calendar.MINUTE, 15);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
Date quarterPastTwelve = calendar.getTime();
System.out.println(quarterPastTwelve);
Date fiveBusinessHoursAfterQuarterPastTwelve =
businessCalendar.add(quarterPastTwelve, new Duration("2 business hours"));
System.out.println(fiveBusinessHoursAfterQuarterPastTwelve);
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? -
2. Re: Spelling mistake in jbpm.business.calendar.properties fi
idyuce Feb 28, 2006 4:52 AM (in response to saviola)sorry for variable names confusion, i got this snippet from test suite ,i change values of variables but didnt change variable names for Dates.
-
3. Re: Spelling mistake in jbpm.business.calendar.properties fi
saviola Feb 28, 2006 6:31 AM (in response to saviola)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 at2006-02-28 13:16:16.767
having duration of 7 business hours. And the end date was correctly calculated i.e.2006-03-01 11:16:00.000
After that I have another task that started at2006-02-28 13:18:14.327
but to my big surprise its end date was calculated to2006-03-06 13:18:00.000
which 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.
Regards,
Saviola -
4. Re: Spelling mistake in jbpm.business.calendar.properties fi
tom.baeyens Feb 28, 2006 8:28 AM (in response to saviola)i'm able to reproduce this problem and created http://jira.jboss.com/jira/browse/JBPM-571
regards, tom.