Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-2777

Guided Decision Table is changing date field value based on the timezone

    XMLWordPrintable

Details

    • 2018 Week 30-32, 2018 Week 33-35
    • 8
    • Hide

      Set timezone to Vilnius for example:

      $ sudo systemsetup -gettimezone
      Time Zone: Europe/Vilnius

      Model initial rule version:
      https://ctrlv.cz/shots/2018/07/23/8Z0O.png

      initial rule source:
      package com.citco.ongoingservices;

      //from row number: 1
      //anton-test
      rule "Row 1 MyTable"
      dialect "mvel"
      when
      m : Message( assignedPersonID == "Anton" )
      then
      java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("dd-MMM-yyyy");
      m.setInitialDate( sdf.parse("01-May-2018") );
      end

      At this point, change the server timezone:

      $ sudo systemsetup -gettimezone
      Time Zone: Europe/Prague

      and restart the server

      after restart rule:
      https://ctrlv.cz/shots/2018/07/23/PlSo.png

      after restart sources:
      package com.citco.ongoingservices;

      //from row number: 1
      //anton-test
      rule "Row 1 MyTable"
      dialect "mvel"
      when
      m : Message( assignedPersonID == "Anton" )
      then
      java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("dd-MMM-yyyy");
      m.setInitialDate( sdf.parse("30-Apr-2018") );
      end

      As you can see, the date was changed automatically from 1.5.2018 to 30.4.2018

      sample kjar is attached

      Show
      Set timezone to Vilnius for example: $ sudo systemsetup -gettimezone Time Zone: Europe/Vilnius Model initial rule version: https://ctrlv.cz/shots/2018/07/23/8Z0O.png initial rule source: package com.citco.ongoingservices; //from row number: 1 //anton-test rule "Row 1 MyTable" dialect "mvel" when m : Message( assignedPersonID == "Anton" ) then java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("dd-MMM-yyyy"); m.setInitialDate( sdf.parse("01-May-2018") ); end At this point, change the server timezone: $ sudo systemsetup -gettimezone Time Zone: Europe/Prague and restart the server after restart rule: https://ctrlv.cz/shots/2018/07/23/PlSo.png after restart sources: package com.citco.ongoingservices; //from row number: 1 //anton-test rule "Row 1 MyTable" dialect "mvel" when m : Message( assignedPersonID == "Anton" ) then java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("dd-MMM-yyyy"); m.setInitialDate( sdf.parse("30-Apr-2018") ); end As you can see, the date was changed automatically from 1.5.2018 to 30.4.2018 sample kjar is attached
    • NEW
    • NEW

    Description

      If I set a Date Field in Guided Decision Table, then change the timezone, restart the server, log in again, the Date Field has different value

      Expected: decision-central should never attempt to change the rules automatically without user's knowledge

      Acceptance test

      • Check opening of old asset, created before this change
      • Run server on linux machine (timezone a)
        • run host on win machine (timezone b) and create Assets
        • run host on win machine (timezone c) and check Assets

      Assets

      • guided template
      • guided rule
      • guided table simple column
      • guided table brl column

      Attachments

        Issue Links

          Activity

            People

              karreiro_ Guilherme Gomes (Inactive)
              manstis@redhat.com Michael Anstis
              Jozef Marko Jozef Marko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: