[rules-dev] Trouble using constants to access Maps
Edson Tirelli
ed.tirelli at gmail.com
Sat Jan 30 10:40:59 EST 2010
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 at 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 at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20100130/1b1317be/attachment.html
More information about the rules-dev
mailing list