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

Business time substraction delivers unexpected results

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jBPM 3.2.10
    • jBPM 3.2.3
    • Runtime Engine
    • None

      When subtracting business time amounts from a date, the result is after the date and not - as one would expect - before this date.
      Examples:
      Sat Nov 01 00:00:00 CET 2008 + 2 business days -> Tue Nov 04 17:00:00 CET 2008 - OK
      Sat Nov 01 00:00:00 CET 2008 - 2 business days -> Sun Nov 02 18:00:00 CET 2008 - unexpected
      Sat Nov 01 00:00:00 CET 2008 + 2 business hours -> Mon Nov 03 11:00:00 CET 2008 - OK
      Sat Nov 01 00:00:00 CET 2008 -2 business hours -> Mon Nov 03 07:00:00 CET 2008 - unexpected

      Data was created by use of small test program:
      Date date=new SimpleDateFormat("dd.MM.yyyy").parse("01.11.2008");
      String[] durStrs=

      {"+ 2 business days", "- 2 business days", "+ 2 business hours", "-2 business hours"}

      ;
      BusinessCalendar calendar= new BusinessCalendar();
      for (String durStr: durStrs)

      { Duration duration= new Duration(durStr); Date d= calendar.add(date, duration); System.out.println(" "+date+" "+durStr+" -> "+d); }

              aguizar_jira Alejandro Guizar (Inactive)
              juergen_lampe Juergen Lampe (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: