Bug 727006

Summary: support enumeration value that contains '=' in key
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Jason Shepherd <jshepherd>
Component: User InterfaceAssignee: manstis
Status: VERIFIED --- QA Contact: Jiri Locker <jlocker>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.1CC: atangrin, manstis
Target Milestone: ---   
Target Release: BRMS 5.3.0.GA   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Enhancement
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jason Shepherd 2011-08-01 01:00:19 UTC
Description of problem:
When left hand side of enumeration contains a '=' character, when using that enumeration in a business rule condition, the drop down does not allow you to select an enumeration value.

Version-Release number of selected component (if applicable):


How reproducible:

Create an enumeration in DSL, and then try to use it in a Business Rule condition.

Steps to Reproduce:
1) install a fresh BRMS
2) import sample repository 'mortgage' when first logging into the page
3) In package 'mortgage' 's Enumeration, add this line:
   'Board.equality' : [ '>=is greater than', '==equals', '<=is less than']
   validate it and save changes.
4) In dsl configuration under mortgage, add this line:
   [when]aaa {sign:ENUM:Board.equality} = applicant:Applicant(creditRating{sign})
   validate it and save changes.
5) In any business rule under the package, say "Bankruptcy history", add a new condition by using "aaa sign", you will see you cannot just add it due to some hidden error.
  .
  
Actual results:

You cannot add the condition, due to some hidden error.

Expected results:

When you change the Enumeration define to 
    'Board.equality' : [ '>=is greater than', 'x=equals', '<=is less than']
It works as expected, but does not fulfill the requirement for equal sign dsl translation.

Additional info:
I found in guvnor source org/drools/guvnor/client/modeldriven/ui/EnumDropDown.java, these codes do not deal with any escaping logic for '=' sign, =========================================================================== private void fillDropDown(final String currentValue, final String[] enumeratedValues) { ...... if (v.indexOf('=') > 0) { //using a mapping String[] splut = ConstraintValueEditorHelper.splitValue(v); String realValue = splut[0]; String display = splut[1]; val = realValue; addItem(display, realValue); ....... } ========================================================================== If we add some escaping logic for '=', the problem is settled I believe.

Comment 1 manstis 2011-10-21 13:11:04 UTC
As from BRMS5.2 you should be able to escape "=" symbols in the Enum definition:-

['\\==equals']

Have a look at ConstraintValueEditorHelper, if you're interested.

Comment 2 Jiri Locker 2011-11-28 11:33:26 UTC
Fix verified in BRMS 5.3.0.DEV5.