Bug 724529 (BRMS-475) - Can not use dependent enumerations in a same DSL sentence
Summary: Can not use dependent enumerations in a same DSL sentence
Keywords:
Status: VERIFIED
Alias: BRMS-475
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRM (Guvnor)
Version: 5.0.2
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: BRMS 5.3.0.GA
Assignee: manstis
QA Contact:
URL: http://jira.jboss.org/jira/browse/BRM...
Whiteboard:
: 734788 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-30 13:42 UTC by Alessandro Lazarotti
Modified: 2023-05-15 19:53 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Using dependent enumerations in the same DSL sentence was triggering the java.lang.IndexOutOfBoundException exception. An overloaded method was created to handle dependent enumerations in the same DSL sentence, and this exception no longer occurs.
Clone Of:
: 1013693 (view as bug list)
Environment:
JBoss Enterprise BRMS 5.0.2, JDK 1.6 sun/oracle, Fedora 12
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
DSLandDependentEnum.png (171.04 KB, image/png)
2010-11-30 13:44 UTC, Alessandro Lazarotti
no flags Details
Exception.png (182.32 KB, image/png)
2010-11-30 13:44 UTC, Alessandro Lazarotti
no flags Details
repository_export.zip (57.54 KB, application/zip)
2010-11-30 13:44 UTC, Alessandro Lazarotti
no flags Details
ScreenshotDev2.png (169.57 KB, image/png)
2011-07-18 18:33 UTC, Len DiMaggio
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker BRMS-475 0 Major Closed Can not use dependent enumerations in a same DSL sentence 2014-02-21 21:04:14 UTC
Red Hat Issue Tracker GUVNOR-1106 0 Critical Resolved Guided Editor: Can not use dependent enumerations in a same DSL sentence 2014-02-21 21:04:23 UTC

Description Alessandro Lazarotti 2010-11-30 13:42:25 UTC
Steps to Reproduce: I attached here a export of my BRMS (5.0.2). The package for this case is: case00363310. Inside this package there are Enumeration and DSL configurations.
Try create a new Rule with this DSL, the result is the exception that I attached here (print screen)
securitylevel_name: Public

When is necessary build DSL sentences for business analyst, you can not use the functionality of dependent enumerations provided by BRMS (ref: http://docs.redhat.com/docs/en-US/JBoss_Enterprise_BRMS_Platform/5/html/BRMS_Userguide/ch04.html#id3108723 - topic 4.2.4.8 ).

The use of  enumerations in  same sentence causes java.lang.IndexOutOfBoundsException

Comment 1 Alessandro Lazarotti 2010-11-30 13:44:29 UTC
Attachment: Added: DSLandDependentEnum.png
Attachment: Added: Exception.png
Attachment: Added: repository_export.zip


Comment 3 Alessandro Lazarotti 2010-11-30 14:07:58 UTC
Link: Added: This issue related GUVNOR-1106


Comment 4 Len DiMaggio 2011-07-18 18:33:01 UTC
Seeing a somewhat different issue with the 5.2 Dev2 build - it is not possible to add the "when the vehicle engine..." condition defined in the imported to a rule.

No error is logged or reported to the user.

Comment 5 Len DiMaggio 2011-07-18 18:33:01 UTC
Attachment: Added: ScreenshotDev2.png


Comment 6 Anne-Louise Tangring 2011-08-01 15:51:11 UTC
Candidate.

Comment 7 manstis 2011-08-02 09:04:17 UTC
(In reply to comment #4)
> Seeing a somewhat different issue with the 5.2 Dev2 build - it is not possible
> to add the "when the vehicle engine..." condition defined in the imported to a
> rule.
> 
> No error is logged or reported to the user.

This new related bug has been fixed in 5.2.x (in project's "5.2.x" branch). The real issue of dependant enums not working in DSLs however remains unresolved. Please also note I suspect the DSL in the example repository should read:-

[when]When the vehicle engine is {$engine:ENUM:Vehicle.engineType} and the fuel is {$fuel:ENUM:Vehicle.fuel} = Vehicle(engine=="{$engine}",fuel=="{$fuel}")

The main difference being that the variables, $engine and $fuel need to be surrounded with "{" and "}" braces. I also added the quotation marks as DSL's are unaware of data-types and hence Strings should be escaped correctly too.

Comment 9 Rick Wagner 2011-08-25 13:26:16 UTC
gss_prioritized

Comment 10 Tihomir Surdilovic 2011-08-25 15:34:28 UTC
assigned to manstis

Comment 11 Rick Wagner 2011-08-25 18:51:04 UTC
GSS prioritizes 'medium'.  Customer isn't stuck, but it has been a long time.

Comment 12 lcarlon 2011-08-30 05:15:57 UTC
I'm trying to put the release notes together for this one.

Is this the same fix as https://bugzilla.redhat.com/show_bug.cgi?id=724802

If not, please let me know how this was fixed (bullet point is fine).

thanks 
Lee

Comment 13 manstis 2011-08-30 08:28:08 UTC
Hi Lee, it was the same problem as #724802 but on a different screen and requiring a different fix. The fix for this one was to change the code to use a different overload of SuggestionCompletionEngine.getEnums() with supporting changes (to use the different overload) in DSLSentenceWidget. Cheers, Mike

Comment 14 lcarlon 2011-08-30 22:30:59 UTC
Thanks Mike

Comment 15 lcarlon 2011-08-30 22:42:31 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=724529

Using dependent enumerations in the same DSL sentence was triggering the java.lang.IndexOutOfBoundException exception. An overloaded method was created to handle dependent enumerations in the same DSL sentence, and this exception no longer occurs.

Comment 16 Tihomir Surdilovic 2011-09-13 14:53:10 UTC
*** Bug 734788 has been marked as a duplicate of this bug. ***

Comment 17 lcarlon 2011-09-14 04:29:50 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=724529
-
 Using dependent enumerations in the same DSL sentence was triggering the java.lang.IndexOutOfBoundException exception. An overloaded method was created to handle dependent enumerations in the same DSL sentence, and this exception no longer occurs.

Comment 19 JBoss JIRA Server 2013-11-18 17:45:06 UTC
Raman Gupta <raman.gupta> made a comment on jira GUVNOR-1106

But For Database Query like

ENUMERATION ::

'Upc.bundleNames' : (new com.upc.ruleUtility.BundleConstraints()).getInactiveBundleList()
'Upc.Products[bundleNames]' : '(new com.upc.ruleUtility.UPCService()).getBundleAssociatedProductList("@{bundleNames}")'


And DSL::

Constraints {BundleList1:ENUM:Upc.bundleNames} and Associated Products {ProductList:ENUM:Upc.Products} = productSet.add("{ProductList}");

issues
1- Dependent drop-down is refreshing with every save and showing first value from the list even if i am selecting 3rd or 4th value.
2- View Source in showing blank for dependent drop down like productSet.add(" ");


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