<br>On 4 July 2011 15:53, esstrata <span dir="ltr">&lt;<a href="mailto:esstrata@yahoo.es">esstrata@yahoo.es</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
  I&#39;m using Drools 5.1.1 in a JavaSE 6 project.<br>
<br>
I can&#39;t get running a rule where a value obtained from WM is check for<br>
existence as a key of a global Map.<br>
<br>
I have a map of the type ProductTextCode -&gt; Product, where keys are String<br>
and values Product<br>
/global Map productMap/<br>
<br>
Then in a rule a I want a condition where each String in WM is tested<br>
against map keyset.<br>
/<br>
rule &quot;Product ID not in products map&quot;<br>
    dialect &quot;mvel&quot;<br>
    when<br>
        $pid : String()<br>
        =&gt; Here goes the condition &lt;=<br>
    then<br>
        System.out.println(&quot;Invalid product id: &quot; + $pid)<br>
        retract ($pid)<br>
    end<br>
/<br>
<br>
So far I&#39;ve tried with productMap.containsKey($pid)</blockquote><div><br>Did you enclose this in eval(...) ?<br>-W<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 but a get a MVEL error<br>
as it takes &#39;containsKey&#39; as a property.<br>
<br>
Please help. Thank you.<br>
<br></blockquote></div>