There was a limitation on MVEL on using constants as keys. I know it was fixed, but not sure about the version. Which specific version of MVEL are you using? (1.3.xx)

    Edson

2010/1/30 @ndré <andre@bonkowski.net>

Hi all!

I'm writing a rule that contains the following statement:

$agreementOffer:AgreementOffer($logicalFixedNumber:configurationParameters["6410"])

This results of this is not surprisingly that both $agreementOffer and
$logicalFixedNumber get assigned a value.
Instead of using the "magic value" 6410, I want to use ParameterId constant
class, which implements the toString() to return the value.

I have tried several different ways to refer to the constant but without
luck. The errors says:

Unable to create Field Extractor for
'configurationParameters[ParameterId.LOGICAL_NUMBER_FIXED]
I have also tried to extract the value of the
ParameterId.LOGICAL_NUMBER_FIXED into a local variable, which I can see
prints the correct value, but the error says the same:

Unable to create Field Extractor for
'configurationParameters[$logicalNumberFixedConstant]

Do anyone understand what is happening here and what I do wrong?

I'm are still on the JKD 1.4, and uses MVEL 1.3

Thanks,

@ndré
--
View this message in context: http://n3.nabble.com/Trouble-using-constants-to-access-Maps-tp178720p178720.html
Sent from the Drools - Dev mailing list archive at Nabble.com.

_______________________________________________
rules-dev mailing list
rules-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev



--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com