It seems that $cm is of type &quot;int&quot;. And this just can&#39;t be cast to java.lang.Integer.<br><br>There are several ways for creating an Integer from an int, but why do you do the cast at all?<br><br>-W<br><br><br>
<div class="gmail_quote">On 17 May 2011 10:42, Giorgio Spagnardi <span dir="ltr">&lt;<a href="mailto:g.spagnardi@reply.it">g.spagnardi@reply.it</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi to all,<br>
I used the business rule guided editor to write a new rule. I&#39;m verifying<br>
the wrtitten rule but Guvnor returns the error message:<br>
[MyRule] Unable to build expression for &#39;consequence&#39;: [Error: unable to<br>
cast type: int; to: class java.lang.Integer] [Near : {...<br>
tValue()));drools.update($sa); ....}]                      ^<br>
[Line: 1, Column: 67] &#39;         $sa.setBonusEsclusivo(percentuale(25,<br>
((Integer)$cm).intValue()));update($sa);&#39;<br>
<br>
In DSL there is: [consequence][] Assign customer bonus of {num} percent=<br>
$sa.setBonusEsclusivo(percentuale({num},<br>
((Integer)$cm).intValue()));update($sa);<br>
<br>
I didn&#39;t find a similiar error message....<br>
Thanks in advance,<br>
G.<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Cast-error-message-and-DSL-tp2951642p2951642.html" target="_blank">http://drools.46999.n3.nabble.com/Cast-error-message-and-DSL-tp2951642p2951642.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<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>