Hide Forgot
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.
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.
Fix verified in BRMS 5.3.0.DEV5.