Bug 1039639

Summary: GRE doesn't recognize MVEL inline lists when opening rule
Product: [Retired] JBoss BRMS Platform 6 Reporter: Jiri Locker <jlocker>
Component: Business CentralAssignee: Mario Fusco <mfusco>
Status: CLOSED CURRENTRELEASE QA Contact: Ivo Bek <ibek>
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: ibek, kverlaen, rzhang, trikkola
Target Milestone: ER 7   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:17:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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.