Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-693

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

XMLWordPrintable

    • 0
    • CR1
    • 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
    • 2018 Week 33-35

      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

              karreiro_ Guilherme Gomes (Inactive)
              rhn-support-agiertli Anton Giertli
              Jozef Marko Jozef Marko (Inactive)
              Jozef Marko Jozef Marko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: