<br> My suggestion is that you try Drools 5.0.1 with MVEL 2.0.10. If you need to stay on Drools 4, then try replacing the mvel jar by MVEL 1.3.9.<br><br> []s<br> Edson<br><br><div class="gmail_quote">2009/6/15 VinuJay <span dir="ltr"><<a href="mailto:vinod.jayendra@wipro.com">vinod.jayendra@wipro.com</a>></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>
Hi Edson,<br>
<br>
Thanks for the reply.<br>
<br>
I am using Drools 4.0.7 and mvel 1.3.1-java1.4.jar<br>
<div><div></div><div class="h5"><br>
<br>
Edson Tirelli-3 wrote:<br>
><br>
> What versions of Drools and MVEL are you using?<br>
><br>
> []s<br>
> Edson<br>
><br>
> 2009/6/15 VinuJay <<a href="mailto:vinod.jayendra@wipro.com">vinod.jayendra@wipro.com</a>><br>
><br>
>><br>
>> Hi my fact object looks like this,<br>
>><br>
>> class ProcessRequest {<br>
>><br>
>> Long requestId;<br>
>><br>
>> String processType;<br>
>><br>
>> String assigneeUsers;<br>
>><br>
>> HashTable<String,Object> businessData;<br>
>><br>
>> //Getters and Setters<br>
>><br>
>> }<br>
>><br>
>> My businessdata can be of type Integer, String, Boolean, hence i have<br>
>> used<br>
>> generic Object for the business data value.<br>
>><br>
>> But if i use any mathematical operator in the rules (.drl) file like,<br>
>> rule "Assign"<br>
>> when<br>
>> p: ProcessRequest(processType == "LoanFlowPlus" &&<br>
>> businessData['LOANAMOUNT'] < 5000)<br>
>> then<br>
>> p.setAssigneeUsers("jcooper");<br>
>> end<br>
>><br>
>><br>
>> i get an error<br>
>> Exception in thread "main" org.drools.RuntimeDroolsException: Exception<br>
>> executing predicate eval( businessData['LOANAMOUNT'] < 5000 )<br>
>> Caused by: java.lang.ClassCastException: java.lang.Integer<br>
>><br>
>><br>
>> Shouldn't the drools API handle this class cast conversion internally ..?<br>
>> or<br>
>> how to specify the class casting in rules file<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> View this message in context:<br>
>> <a href="http://www.nabble.com/Class-Casting-in-a-Collection-data-tp24031803p24031803.html" target="_blank">http://www.nabble.com/Class-Casting-in-a-Collection-data-tp24031803p24031803.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>
>><br>
><br>
><br>
><br>
> --<br>
> Edson Tirelli<br>
> JBoss Drools Core Development<br>
> JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><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>
><br>
><br>
<br>
--<br>
</div></div>View this message in context: <a href="http://www.nabble.com/Class-Casting-in-a-Collection-data-tp24031803p24046788.html" target="_blank">http://www.nabble.com/Class-Casting-in-a-Collection-data-tp24031803p24046788.html</a><br>
<div><div></div><div class="h5">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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>