[rules-users] Cast error message and DSL

Wolfgang Laun wolfgang.laun at gmail.com
Tue May 17 05:42:54 EDT 2011


It seems that $cm is of type "int". And this just can't be cast to
java.lang.Integer.

There are several ways for creating an Integer from an int, but why do you
do the cast at all?

-W


On 17 May 2011 10:42, Giorgio Spagnardi <g.spagnardi at reply.it> wrote:

> Hi to all,
> I used the business rule guided editor to write a new rule. I'm verifying
> the wrtitten rule but Guvnor returns the error message:
> [MyRule] Unable to build expression for 'consequence': [Error: unable to
> cast type: int; to: class java.lang.Integer] [Near : {...
> tValue()));drools.update($sa); ....}]                      ^
> [Line: 1, Column: 67] '         $sa.setBonusEsclusivo(percentuale(25,
> ((Integer)$cm).intValue()));update($sa);'
>
> In DSL there is: [consequence][] Assign customer bonus of {num} percent=
> $sa.setBonusEsclusivo(percentuale({num},
> ((Integer)$cm).intValue()));update($sa);
>
> I didn't find a similiar error message....
> Thanks in advance,
> G.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Cast-error-message-and-DSL-tp2951642p2951642.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110517/f41595a4/attachment.html 


More information about the rules-users mailing list