<br>&nbsp;&nbsp; The problem is not the &quot;hashmap&quot;. Just read the error message:<br><br>[9,0]: unknown:9:0 mismatched token: [@122,385:388=&#39;then&#39;,&lt;61&gt;,9:0]; expecting type RIGHT_PAREN<br>
<br>&nbsp;&nbsp; You are missing a ) in your last condition, before the &quot;then&quot;.<br><br>&nbsp;&nbsp; Having said that, your rule seems wrong to me:<br><br>* you should use a top level eval in the second condition<br>* you could benefit from the MVEL syntax to simplify your condition syntax<br>
* there is no &quot;eval&quot; in the consequence. Just write plain code there.<br><br>rule xyz<br>dialect &quot;mvel&quot;<br>when<br>
 &nbsp; &nbsp; &nbsp; &nbsp; $a : RuleAttributes()<br>
 &nbsp; &nbsp; &nbsp; &nbsp; eval( ($a.values[&quot;AdultFare&quot;] - $a.values[&quot;InfantFare&quot;]) &lt; ($a.values[&quot;ChildFare&quot;] + $a.values[&quot;InfantFare&quot;] ) )<br>then<br>&nbsp; &nbsp; &nbsp; &nbsp; $a.values[&quot;GrossFare&quot;] = 500;<br>
end<br>
<br>&nbsp;&nbsp; I did not tested, but should work fine.<br>&nbsp;<br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson &nbsp; <br><br><br><div class="gmail_quote">2008/11/6 Nikhil_dev <span dir="ltr">&lt;<a href="mailto:k.nikhil@verchaska.com">k.nikhil@verchaska.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Below is the drl file<br>
<br>
package com.vtech.ruleengine.module.rulemanagermodule<br>
import com.vtech.ruleengine.module.rulemanagermodule.RuleAttributes;<br>
import java.util.Map;<br>
rule &nbsp;&quot;Rule_dec_1&quot;<br>
dialect &quot;mvel&quot;<br>
when<br>
 &nbsp; &nbsp; &nbsp; &nbsp; $a : RuleAttributes()<br>
 &nbsp; &nbsp; &nbsp; &nbsp; m : &nbsp;RuleAttributes ( eval( ($a.getValues().get(&quot;AdultFare&quot;) -<br>
$a.getValues().get(&quot;InfantFare&quot;)) &lt; ($a.getValues().get(&quot;ChildFare&quot;) +<br>
$a.getValues().get(&quot;InfantFare&quot;) ) )<br>
then<br>
 &nbsp; &nbsp; &nbsp; &nbsp; eval($a.getValues().put(&quot;GrossFare&quot;, 500))<br>
end<br>
<br>
<br>
Follwing is the way i am using drrols<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;final StatefulSession ruleStateSession =<br>
ruleBase.newStatefulSession();<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ruleStateSession.addEventListener( new DebugAgendaEventListener()<br>
);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ruleStateSession.addEventListener( new<br>
DebugWorkingMemoryEventListener() );<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RuleAttributes objRuleattri = new<br>
RuleAttributes((HashMap&lt;String, Object&gt;)_hmListBean);<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ruleStateSession.insert(objRuleattri);<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ruleStateSession.fireAllRules();<br>
<br>
Note : RuleAttributes is a class where i set getter and setter for hashmap<br>
<br>
Below is the error message that i get :<br>
<br>
[9,0]: unknown:9:0 mismatched token: [@122,385:388=&#39;then&#39;,&lt;61&gt;,9:0];<br>
expecting type RIGHT_PAREN<br>
ERROR 1 ::getCause::: null<br>
ERROR 2 ::getLocalizedMessage::: Unable to compile drl<br>
ERROR 3 ::getMessage::: Unable to compile drl<br>
ERROR 4 ::toString::: java.lang.RuntimeException: Unable to compile drl<br>
Gross VAlue ::::: 0<br>
java.lang.RuntimeException: Unable to compile drl<br>
<br>
It will be very helpful is anyone of you rectify my mistake or tell me any<br>
other way to use Hashmap in drl file.<br>
I am using hashmap, since variable in my application varies hence cannot<br>
define fixed Bean structure.<br>
<br>
<br>
<br>
-----<br>
Regards,<br>
:working:Nikhil<br>
<font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/Using-Hashmap-in-drl-files......-tp20355904p20355904.html" target="_blank">http://www.nabble.com/Using-Hashmap-in-drl-files......-tp20355904p20355904.html</a><br>

Sent from the drools - user mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br> &nbsp;Edson Tirelli<br> &nbsp;JBoss Drools Core Development<br> &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>