Bug 1039639 - GRE doesn't recognize MVEL inline lists when opening rule
Summary: GRE doesn't recognize MVEL inline lists when opening rule
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Business Central
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER 7
: 6.0.0
Assignee: Mario Fusco
QA Contact: Ivo Bek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-09 16:42 UTC by Jiri Locker
Modified: 2014-08-06 20:17 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:17:30 UTC
Type: Bug


Attachments (Terms of Use)

Description Jiri Locker 2013-12-09 16:42:01 UTC
Description of problem:
Using mvel dialect, it should be possible to have RHS with

$fact.setItems(["item1", "item2"]);

if fact type has "List<String> items;" field. I can input the value ["item1, "item2"] in the text input for field items and the rule validates successfully. When I save the rule, close it and reopen the text input is empty.


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

How reproducible:
-

Steps to Reproduce:
1. add java.util.List to Project Imports
2. in Data Modeler, create new object type MyFact with field items of type java.util.List, save the model
3. create new Guided Rule
4. add $fact : MyFact() to LHS
5. modify $fact in RHS, set items to ["item1", "item2"]
6. save the rule, check DRL source, validate it (ignore raw types warnings), close it
7. reopen the rule

Actual results:
The text input for items field of $fact is empty. DRL source is different from what has been saved, too.

Expected results:
After reopening, the rule should look exactly like it was saved before it was closed.

Additional info:
When fixing, please take maps and arrays into account too. http://mvel.codehaus.org/Inline+List,+Maps+and+Arrays

Comment 1 Toni Rikkola 2013-12-11 14:30:44 UTC
Unit test for this. 
https://github.com/droolsjbpm/drools/commit/c9d4924dc

Comment 3 Ivo Bek 2014-01-14 09:26:03 UTC
Verified in BPMS 6.0.0.ER7.

After reopen, free form drls are transfered into readable statements and the contents for List variables are filled. The source code remains the same.


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