Bug 724804 (BRMS-645) - Date isn't saved when using Japanese Env. (BRMS)
Summary: Date isn't saved when using Japanese Env. (BRMS)
Keywords:
Status: VERIFIED
Alias: BRMS-645
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: Internationalization
Version: 5.1.0 GA
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ER9
: BRMS 5.3.0.GA
Assignee: Mark Proctor
QA Contact: Sona Mala
URL: http://jira.jboss.org/jira/browse/BRM...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-20 13:59 UTC by Rick Wagner
Modified: 2021-04-09 12:48 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
When viewing the BRMS web console in Japanese, if a date was changed the change could be lost. To workaround this issue set the following properties in jboss-brms.war/WEB-INF/classes/preference.properties: drools.defaultlanguage=ja drools.defaultcountry=JP.
Clone Of:
Environment:
Viewed from BRMS (not Guvnor) 5.1.0
Last Closed:
Type: Bug


Attachments (Terms of Use)
repository_export.xml (1.63 MB, text/xml)
2011-07-20 14:03 UTC, Rick Wagner
no flags Details
Japaniese version with properties (139.12 KB, image/png)
2012-05-16 07:08 UTC, Sona Mala
no flags Details
English version with properties (125.96 KB, image/png)
2012-05-16 07:09 UTC, Sona Mala
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker BRMS-645 0 Major Closed Date isn't saved when using Japanese Env. (BRMS) 2013-04-19 10:26:38 UTC
Red Hat Issue Tracker GUVNOR-1555 0 Critical Resolved Date isn't saved when using Japanese Env. 2013-04-19 10:26:38 UTC

Description Rick Wagner 2011-07-20 13:59:01 UTC
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A0000007pRBx&sfdc.override=1
Steps to Reproduce: 1. Import repository attached to the Help Desk Ticket (also attached to BRMS JIRA).
2. Login to JBoss BRMS using Japanese Env. (URL is http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/Guvnor.html?locale=ja_JP)
3. Open the "JTest" package on the web browser
4. Open the "BIZ" drl rule.
5. Change the date in the rule, ex. "birthday less than 31-12-2011".
6. Save Changes.
7. Sign Out JBoss BRMS.
8. Login to JBoss BRMS using English Env. 
9. Open the "JTest" package.
10. Open the "BIZ" rule.
11. look at a date you changed. In my env, date is set to "today".

A repository holds a rule that uses a date as a discriminator.  When viewed in the default(English) view, the rule can be changed and the change is persistent.  (i.e. 'birthday LESS THAN 20-July-2011' is changed to 'birthday LESS THAN 10-January-2011').  

When a similar change is attempted through the Japanese view, the change is lost after saving.  (The date will default to today's date.)  Note that a different change to the rule (i.e. going from 'LESS THAN' to 'GREATER THAN') will persist, where the date change will not.

Comment 1 Rick Wagner 2011-07-20 13:59:02 UTC
Link: Added: This issue Cloned from GUVNOR-1555


Comment 2 Rick Wagner 2011-07-20 14:01:10 UTC
Link: Added: This issue depends GUVNOR-1555


Comment 3 Rick Wagner 2011-07-20 14:03:48 UTC
Sample repository for viewing the problem.

Comment 4 Rick Wagner 2011-07-20 14:03:48 UTC
Attachment: Added: repository_export.xml


Comment 5 Rick Wagner 2011-07-20 14:04:21 UTC
Security: Removed: Public Added: JBoss Internal


Comment 6 Tihomir Surdilovic 2011-08-16 21:16:59 UTC
You can set in Guvnor's 
preference.properties:

drools.dateformat=yyyy/MM/dd
drools.defaultlanguage=ja
drools.defaultcountry=JA

This gets rid of the issue.
Can you please explain what is needed to be fixed given that a "workaround" for getting this work exists ?

Thanks.

Comment 7 lcarlon 2011-08-19 05:57:06 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Bug marked as private - no release note

Comment 8 lcarlon 2011-08-19 06:17:52 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-Bug marked as private - no release note+Bug marked as private, but this has a help desk ticket so  really should have a release note.

Comment 9 lcarlon 2011-08-19 06:18:39 UTC
I'm not sure of the workflow for removing the private status from this bug, but suggest private be removed to allow for a release note to be generated for this one.

Comment 10 Tihomir Surdilovic 2011-08-24 22:25:59 UTC
In me previous comment it should have read:

drools.defaultlanguage=ja
drools.defaultcountry=JP

I don't think there is any coding fix necessary as this affects any language and country settings. The properties provide means to work with dates for different locales.

Comment 11 Rick Wagner 2011-08-25 19:20:09 UTC
GSS prioritizes 'medium'.

Comment 12 lcarlon 2011-09-13 05:11:06 UTC
Is it necessary for the customer to perform this step manually?

If so I will add the information to the release notes. (Also, this bug is marked private, can that be changed? I can't release note it as long as it is considered private).

Thanks
Lee

Comment 13 lcarlon 2011-09-13 05:14:29 UTC
Deleted Technical Notes Contents.

Old Contents:
Bug marked as private, but this has a help desk ticket so  really should have a release note.

Comment 14 lcarlon 2011-09-15 05:21:30 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When viewing the BRMS web console in Japanese, if a date is changed the change is lost. To workaround this issue set the following properties in preference.properties: drools.defaultlanguage=ja drools.defaultcountry=JP.

Comment 15 lcarlon 2011-09-30 03:06:46 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1,2 @@
-When viewing the BRMS web console in Japanese, if a date is changed the change is lost. To workaround this issue set the following properties in preference.properties: drools.defaultlanguage=ja drools.defaultcountry=JP.+When viewing the BRMS web console in Japanese, if a date is changed the change can be lost. To workaround this issue set the following properties in preference.properties: 
+drools.defaultlanguage=ja drools.defaultcountry=JP.

Comment 16 Jervis Liu 2011-11-23 08:27:27 UTC
Work around exists. Sent to QA.

Comment 19 lcarlon 2012-04-02 01:03:02 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,2 +1,2 @@
-When viewing the BRMS web console in Japanese, if a date is changed the change can be lost. To workaround this issue set the following properties in preference.properties: 
+When viewing the BRMS web console in Japanese, if a date was changed the change could be lost. To workaround this issue set the following properties in jboss-brms.war/WEB-INF/classes/preference.properties: 
 drools.defaultlanguage=ja drools.defaultcountry=JP.

Comment 20 Sona Mala 2012-05-02 11:32:42 UTC
Please, check my use case to verify this issue:

1. Set defaultlanguage=ja, defaultcountry=JP in WEB-INF/classes/preferences.properties
2. Run server standalone
3. Go to http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/Guvnor.html?locale=ja_JP
4. Import repository
5. Change date in rule JTest/BIZ.drl
6. Sign out
7. Sign in http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/Guvnor.html
8. Check date in rule


After this steps I find wrong date in EN location (today's date).

When I change either dateformat in properties: dates in JP and EN are same. Problem is that, after finish import of repository all dates are set to today's date.

Comment 21 Sona Mala 2012-05-14 12:55:24 UTC
I tried also set deafultlanguage=en and defaultcountry=US between steps 6 and 7, but problem does not disappear. Please can you give me more information about this use case? I have not got permissions to Red Hat Customer Portal Tracker.

Comment 22 Jervis Liu 2012-05-15 09:32:00 UTC
Hi if you import the repository, all assets' "Created on" attribute will be reset to the time when the repository is imported. This is expected behavior.  

What you need to verify is the "Last modified" attribute. Did you see this date has been set correctly?

Comment 23 Sona Mala 2012-05-15 12:41:02 UTC
I am not sure if we talk about same thing. "Created on:" and "Last modified:" are attributes of asset. But date which I wrote about is content of Rule (condition "birthday less than 31-12-2011"). 

If I change this condition to "birthday less than 30-12-2011" in Japanese version and open same asset in English version I can see: "birthday less than 15-05-2012". 

I think that this is not correct.

Comment 24 Sona Mala 2012-05-15 13:16:26 UTC
I have exported repository from english version. In the repository, format of date is: 30-12月-2011
English version expects: 30-Dec-2011

That is the problem.
If I set date format to yyyy/MM/dd, I must set all dates in repository again but date format is same for Jap and Eng version.


  -

Comment 25 Sona Mala 2012-05-15 13:20:00 UTC
Not sure about existence of date's converter or just put this into administrator's documentation.

Comment 26 Jervis Liu 2012-05-16 06:41:01 UTC
Hi, setting WEB-INF/classes/preferences.properties with defaultlanguage=ja, defaultcountry=JP should have the problem fixed. The reason why you saw wrong date (current date) when you changed back to English is you've already set env to jp, in this case, English version can not render the date value correctly. 

If you set preferences.properties to jp, you should always use ?localz=ja_JP to view the repository.

Comment 27 Sona Mala 2012-05-16 07:08:34 UTC
Created attachment 584877 [details]
Japaniese version with properties

Comment 28 Sona Mala 2012-05-16 07:09:14 UTC
Created attachment 584878 [details]
English version with properties

Comment 29 Sona Mala 2012-05-16 07:15:47 UTC
I have added attachments. There are screenshots from Japanese version and English version together with actual preferencies.properties. Steps:
1. set preferencies
2. run server BRMS 5.3.0 ER7 Standalone
3. open Japanese version of Guvnor
4. import repository
5. take screenshot "Japanese version ..."
6. shut down server
7. set preferencies
8. run server BRMS 5.3.0 ER7 Standalone
9. open English version of Guvnor
10. take screenshot "English version ..."

Comment 30 Jervis Liu 2012-05-16 08:25:25 UTC
Hi Sona, thanks for the help. I am now able to reproduce the problem: 

1. Set defaultlanguage=ja, defaultcountry=JP in WEB-INF/classes/preferences.properties
2. Use locale=ja_JP to change the date.
3. Export the repository.
4. Set preferences.properties back to the standard English env.
5. import the repository that was exported from jp env
6 .View the date. It is not correct, the date is the  current date. 

This bug makes it impossible to share the rules with colleagues using different local by sending the repository.

Comment 31 Jervis Liu 2012-05-16 09:08:36 UTC
The only way to store the date in an interchangable way is to store it as long. Such as fix will have high-impact on Guvnor. Rule Templates, dtables, brl are all affected. 

I suggest we approach this as a doc issue, ie: 

In order to interpret the date correctly among different intances of guvnor that are using different locals, those guvnor instances need to use same date format, which is drools.dateformat=yyyy/MM/dd

Comment 32 lcarlon 2012-05-16 22:47:51 UTC
Hi Jervis,

I can add a note to localization chapter of the admin guide instructing users to change drools.dateformat in preferences.properties.

Assign the bug to me if that's how we decide to resolve the issue.

Thanks
Lee

Comment 33 Jervis Liu 2012-05-17 07:26:26 UTC
Reassign to Lee.

Comment 34 lcarlon 2012-05-17 22:16:05 UTC
Hi Jervis,

I've add a fourth step to the procedure in the localization chapter as follows:

4. Change the Date Format
If multiple instances of the JBoss BRMS user interface are deployed with different languages specified, the format of the date must be changed so that each instance can correctly interpret the date.
Specify the date format in preferences.properties.
Change the date format from:

drools.dateformat=dd-MMM-yyyy

To:

drools.dateformat=yyyy-mm-dd

Comment 36 Sona Mala 2012-05-21 12:17:17 UTC
Please, before you publish documentation, check if different date format is save for another issues (like for bz 814865). I will create some test for ER8. We tested guvnor with default format.

Comment 37 Ryan Zhang 2012-06-13 09:32:24 UTC
This issue's fixes  have been picked by ER9. Please verify them on ER9.

Comment 38 Sona Mala 2012-06-14 08:58:59 UTC
In documentation, the date's format is wrong. There should be yyyy-MM-dd.
Small "m" is for minutes not for month.

Comment 39 Sona Mala 2012-06-14 09:14:28 UTC
Verified steps from comment #30 for the date format (yyyy-MM-dd).

Comment 40 lcarlon 2012-06-27 04:15:01 UTC
Documentation updated.


Note You need to log in before you can comment on or make changes to this bug.