[rules-users] Retrieve values from a Map

Wolfgang Laun wolfgang.laun at gmail.com
Wed Aug 11 05:16:42 EDT 2010


If you need the value on the RHS, you can use s.th. like
   lang.get("Japanese")
or
   $c.getLanguage().get("Japanese")

If you want to match the value in a subsequent pattern, you
could use an eval() or similar; since you don't show what you
need the value for, I'll not enumerate all possibilities.

-W


On 11 August 2010 06:09, Manav <manav7574 at yahoo.com> wrote:
> I am new to drools and currently using version 5.1 for my testing.
>
> I am facing an issue with retrieving a value from Map if a key is present
>
> In my drl if i do this
>
> $c : Client (language contains "Japanese" , lang : language ->
> (language.get("Japanese").equals("Expert")))
>
> it works ...but if i want to retrieve the value of the key i am not sure how to
> go about it . I tried various approaches but none of them worked
>
>
> i would like to do something like
>
> $c : Client (language contains "Japanese", $langValue :
> language.get("Japanese"))
>
>
> Can some one please guide me how to go about it .
>
> Regards,
> Manav
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>




More information about the rules-users mailing list