[rules-users] Calling a method with varargs

Mark Proctor mproctor at codehaus.org
Tue Apr 12 22:41:50 EDT 2011


On 12/04/2011 18:36, janders wrote:
> Apologies, I solved my own problem after banging my head for a spell. 
> I just needed to surround the varargs portion of the method arguments 
> with curly braces { } to force the arguments into an array. The new 
> consequence clause looks like so:
> $explanation.addMessage(1, "%s Quantity = %,d", {$notice.dispositionCode, $notice.quantity});
> >From what I could tell reading MVEL's site, they don't seem to 
> support varargs but it will still work if the arguments are explicitly 
> wrapped in an array.
varargs is a limitation the MVEL author is aware of and working on.

Mark
>
> Cheers,
>
> Jason
>
> ------------------------------------------------------------------------
> View this message in context: Re: Calling a method with varargs 
> <http://drools.46999.n3.nabble.com/Calling-a-method-with-varargs-tp2812191p2812327.html>
> Sent from the Drools: User forum mailing list archive 
> <http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html> 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/20110413/e31d6d66/attachment.html 


More information about the rules-users mailing list