2012/3/7 Matteo Cusmai <span dir="ltr"><<a href="mailto:cusmaimatteo@gmail.com">cusmaimatteo@gmail.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>From my experience, if you want call a method from then clause, it has to be static method.<br>
Bye bye,</p></blockquote><div><br></div><div>Surely you don't mean that only a "static method" can be called in a consequence?!</div><div><br></div><div>Also, using 5.3.0 and 5.4.0.Beta2,.I had no problems with a consequence </div>
<div><div> modify( $ms ){ add( "three", "four" ) }</div><div> insert( new MySet( "x", "y" ) );</div><div>where both method add and constructor MySet have the signature (String... strings)</div>
</div><div><br></div><div>But - as in many other situations - using </div><div> dialect "mvel"</div><div>is to be avoided.</div><div><br></div><div>-W</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>Matteo Cusmai</p>
<div class="gmail_quote">Il giorno 07/mar/2012 18:10, "womuji" <<a href="mailto:cmregister@gmail.com" target="_blank">cmregister@gmail.com</a>> ha scritto:<div><div class="h5"><br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
We are upgrading Drools from 5.1 to 5.3, and running into some issue when<br>
invoking a Java method with<br>
String variable arguments:<br>
<br>
methodA(String... params)<br>
<br>
how do we invoke this in a drl file? We used to call it in 5.1 as:<br>
<br>
objA.methodA({"string1"});<br>
<br>
and it works fine. Now in 5.3, it complains that<br>
<br>
"unable to resolve method using strict-mode:<br>
objA.methodA([Ljava.lang.Object;)]"<br>
<br>
If we tried objA.methodA(new String[]{"string1"});<br>
it complains that<br>
"unable to resolve method using strict-mode:<br>
objA.methodA([Ljava.lang.String;)]"<br>
<br>
It passes the rule loading if we change to :<br>
<br>
objA.methodA("string1");<br>
<br>
but when actually running the rule, we are getting error saying<br>
" unable to resolve method methodA(java.lang.String)"<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/how-to-invoke-java-method-with-variable-arguments-from-drl-file-tp3807314p3807314.html" target="_blank">http://drools.46999.n3.nabble.com/how-to-invoke-java-method-with-variable-arguments-from-drl-file-tp3807314p3807314.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" target="_blank">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>
</blockquote></div></div></div>
<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></blockquote></div><br>