<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Testo fumetto Carattere";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.StileMessaggioDiPostaElettronica17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.TestofumettoCarattere
        {mso-style-name:"Testo fumetto Carattere";
        mso-style-priority:99;
        mso-style-link:"Testo fumetto";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1027" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="IT" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Really, it&#8217;s not my code so I don&#8217;t know way :( and looking for $cm, I found it seems to be already an int!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Segoe UI&quot;,&quot;sans-serif&quot;">Da:</span></b><span style="font-size:10.0pt;font-family:&quot;Segoe UI&quot;,&quot;sans-serif&quot;"> rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org]
<b>Per conto di </b>Wolfgang Laun<br>
<b>Inviato:</b> marted́ 17 maggio 2011 11:43<br>
<b>A:</b> Rules Users List<br>
<b>Oggetto:</b> Re: [rules-users] Cast error message and DSL<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">It seems that $cm is of type &quot;int&quot;. And this just can'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>
<o:p></o:p></p>
<div>
<p class="MsoNormal">On 17 May 2011 10:42, Giorgio Spagnardi &lt;<a href="mailto:g.spagnardi@reply.it">g.spagnardi@reply.it</a>&gt; wrote:<o:p></o:p></p>
<p class="MsoNormal">Hi to all,<br>
I used the business rule guided editor to write a new rule. I'm verifying<br>
the wrtitten rule but Guvnor returns the error message:<br>
[MyRule] Unable to build expression for 'consequence': [Error: unable to<br>
cast type: int; to: class java.lang.Integer] [Near : {...<br>
tValue()));drools.update($sa); ....}] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^<br>
[Line: 1, Column: 67] ' &nbsp; &nbsp; &nbsp; &nbsp; $sa.setBonusEsclusivo(percentuale(25,<br>
((Integer)$cm).intValue()));update($sa);'<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't find a similiar error message....<br>
Thanks in advance,<br>
G.<br>
<span style="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></span><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">--<br>
The information transmitted is intended for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information
 by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.<br>
</font>
</body>
</html>