Bug 729273

Summary: Guided BRL editor: enum select box in DSL sentece reloads with a different option each time a change is made in the editor
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Jiri Locker <jlocker>
Component: User InterfaceAssignee: manstis
Status: VERIFIED --- QA Contact: Jiri Locker <jlocker>
Severity: medium Docs Contact:
Priority: medium    
Version: BRMS 5.2.0.GACC: manstis, trikkola
Target Milestone: ---   
Target Release: BRMS 5.2.0.GA   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
When adding a DSL sentence in the guided editor enumerations are selected from a dropdown box, however, when the editor refreshed after certain actions the selected enumerations changed to different values.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
CreditApproval.png none

Description Jiri Locker 2011-08-09 10:42:17 UTC
Created attachment 517378 [details]
CreditApproval.png

Description of problem:
When a DSL sentence is added in the guided editor for BRL rules, each parameter of the sentence has it's input element used to enter the value. Value for an enumerated parameter is entered using a drop-down select box. The editor needs to refresh after certain common actions (adding/removing condition/action). When such a refresh occurs, each select box in DSL sentence changes it's current value as a side effect. The user might not notice that and save a rule in a different state than it was intended.

Steps to Reproduce:
1. import sample mortgages repository
2. open CreditApproval rule
3. set the credit rating to 'Sub prime'
4. remove the only action 'Approve the loan' to make the editor refresh
5. notice the credit rating value has "decremented" to OK
6. each following operation decrements the value
  
Actual results:
the selected value gets "decremented" with each refresh

Expected results:
the selected value should not change when user is editing other parts of the rule

Additional info:
see attached screenshot(s)

Comment 1 manstis 2011-08-17 22:07:47 UTC
Confirmed still exists in 5.3.0;.Beta1 (project)

Comment 2 lcarlon 2011-08-18 04:50:45 UTC
Do we need to document this a known issue in the release notes? 

Thanks
- Lee

Comment 3 Toni Rikkola 2011-08-24 12:20:08 UTC
It is worse. The dropdown value can be changed, but if you do save and close you notice that it is not saved.

I'll ask Michael to take a look, the format that the DSL sentences has saved. Looks like it is not handling enums correctly.

Comment 4 Jiri Locker 2011-08-31 12:59:49 UTC
Fix verified in ER3.

Comment 5 lcarlon 2011-09-14 00:50:19 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:
https://bugzilla.redhat.com/show_bug.cgi?id=729273

When adding DSL sentence in the guided editor enumerations are selected from a dropdown box, however, when the editor refreshes after certain actions the selected enumerations changed to different values. This has been resolved and the enumerations no longer change when the editor refreshes.

Comment 6 lcarlon 2011-09-14 04:30:12 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,3 +1 @@
-https://bugzilla.redhat.com/show_bug.cgi?id=729273
-
 When adding DSL sentence in the guided editor enumerations are selected from a dropdown box, however, when the editor refreshes after certain actions the selected enumerations changed to different values. This has been resolved and the enumerations no longer change when the editor refreshes.

Comment 7 Jiri Locker 2011-09-21 11:00:36 UTC
The bug recurred in ER4, I'm changing the state back to ASSIGNED.

As described in comment 3, the selected value cannot be saved. Upon saving, selected values in all DSL drop-downs are reset to the first value in the list.

Comment 8 Jiri Locker 2011-09-21 11:59:46 UTC
Asking for blocker. Might be a serious issue for existing repositories migrated to BRMS 5.2.0. If the repo contains DSL configurations affected by this issue, it would be necessary to convert them to not use ENUM constraints and yet more difficult would be to fix guided editor rules using the affected DSL senteces.

Comment 9 lcarlon 2011-09-21 22:38:03 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 @@
-When adding DSL sentence in the guided editor enumerations are selected from a dropdown box, however, when the editor refreshes after certain actions the selected enumerations changed to different values. This has been resolved and the enumerations no longer change when the editor refreshes.+When adding DSL sentence in the guided editor enumerations are selected from a dropdown box, however, when the editor refreshes after certain actions the selected enumerations changed to different values.

Comment 10 manstis 2011-09-22 09:06:42 UTC
Regression was introduced with fix for BZ724529. Problem was that the selected value wasn't being set in the drop-down widget (the given example to recreate the problem was also showing "OK" as the credit rating whereas it should have been "OK"). Anyway, one line fix committed to 5.2.x branch.

Comment 11 lcarlon 2011-10-05 04:06:03 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 @@
-When adding DSL sentence in the guided editor enumerations are selected from a dropdown box, however, when the editor refreshes after certain actions the selected enumerations changed to different values.+When adding a DSL sentence in the guided editor enumerations are selected from a dropdown box, however, when the editor refreshed after certain actions the selected enumerations changed to different values.