Bug 727006 - support enumeration value that contains '=' in key
Summary: support enumeration value that contains '=' in key
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: User Interface
Version: 5.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: BRMS 5.3.0.GA
Assignee: manstis
QA Contact: Jiri Locker
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-01 01:00 UTC by Jason Shepherd
Modified: 2018-11-14 11:30 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Enhancement


Attachments (Terms of Use)

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.


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