Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-4533

BusinessCalendar ignores holiday

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • jBPM 6.2.0.Final
    • jBPM 6.2.0.CR3
    • Runtime Engine
    • None
    • Hide

      Just execute the code above

      Show
      Just execute the code above

    Description

      In this scenario the clock is set at Thu Jan 08 11:38:30 CET 2015. I want to calculateBusinessTimeAsDate adding 4 days, so the expected result should be Wed Jan 14 11:38:30 CET 2015. It does work. If I set the property "business.holidays" to "13-01-2015", the result should be Thu Jan 15 11:38:30 CET 2015 (1 day later), but it remains in Wed Jan 14 11:38:30 CET 2015. The holiday is ignored. Seen also in v5.4.x

      Test.java
      public class Test {
      
      	public static void main(String[] args) {
      
      		final Properties props = new Properties();
      		props.put("business.holidays", "13-01-2015");
      
      		final Long fechaLong = 1420713510198L; // Thu Jan 08 11:38:30 CET 2015
      
      		BusinessCalendarImpl businessCalendarImpl = new BusinessCalendarImpl(props, new org.kie.api.time.SessionClock() {
      			@Override
      			public long getCurrentTime() {
      				return fechaLong;
      			}
      		});
      
      		Date calculateBusinessTimeAsDate = businessCalendarImpl.calculateBusinessTimeAsDate("4D");
      		System.out.println("NOW: " + new Date(fechaLong));
      		System.out.println("THEN: " + calculateBusinessTimeAsDate);
      	}
      }
      

      Attachments

        Activity

          People

            swiderski.maciej Maciej Swiderski (Inactive)
            sergiocg_jira Sergio Collantes (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: