Page 1 of 1

MVEL Expression Error, Bug ???

Posted: Thu Feb 07, 2013 7:44 am
by denis
Hi,

There is a problem, with BLC 2.2.1-SNAPSHOT (not tried with previous BLC version) when you create a customer rule on a page :
url : http://i.imgur.com/eVUAxPv.png
Image

Below the expression saved in database :

Image


When i try to access at the page, an exception is thrown :

Code: Select all

[ERROR] 13:25:48 AbstractPageRuleProcessor - [Error: unable to resolve method: java.lang.String.getType() [arglength=0]]
[Near : {... Unknown ....}]
             ^
[Line: 1, Column: 0]


The problem is due to the ".getType()" in the MVEL expression. If i replace : customer.type.getType()=="BUSINESS" BY
customer.type=="BUSINESS" it works perfectly.

Just for your information "CustomerType" is a BroadleafEnumeration. I tried with others BroadleafEnumerations and each time the MVEL expression contains ".getType()".

It's certainly a bug when you save a MVEL expression which contains a BroadleafEnumeration.

Thanks in advance

Re: MVEL Expression Error, Bug ???

Posted: Thu Feb 07, 2013 9:05 am
by phillipuniverse
Does the getter on Customer (getType) return a String or CustomerType? It should be returning CustomerType; I suspect that currently it returns the underlying string.

Re: MVEL Expression Error, Bug ???

Posted: Thu Feb 07, 2013 9:08 am
by denis
Yep I was going to write this suggestion. My getType() return a String. So this is my mistake :?