[rules-users] how to invoke java method with variable arguments from drl file

Matteo Cusmai cusmaimatteo at gmail.com
Wed Mar 7 15:41:56 EST 2012


>From my experience, if you want call a method from then clause, it has to
be static method.
Bye bye,

Matteo Cusmai
Il giorno 07/mar/2012 18:10, "womuji" <cmregister at gmail.com> ha scritto:

> We are upgrading Drools from 5.1 to 5.3, and running into some issue when
> invoking a Java method with
> String variable arguments:
>
> methodA(String... params)
>
> how do we invoke this in a drl file? We used to call it in 5.1 as:
>
> objA.methodA({"string1"});
>
> and it works fine. Now in 5.3, it complains that
>
> "unable to resolve method using strict-mode:
> objA.methodA([Ljava.lang.Object;)]"
>
> If we tried objA.methodA(new String[]{"string1"});
> it complains that
> "unable to resolve method using strict-mode:
> objA.methodA([Ljava.lang.String;)]"
>
> It passes the rule loading if we change to :
>
> objA.methodA("string1");
>
> but when actually running the rule, we are getting error saying
> " unable to resolve method methodA(java.lang.String)"
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/how-to-invoke-java-method-with-variable-arguments-from-drl-file-tp3807314p3807314.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/20120307/bf21ba3e/attachment.html 


More information about the rules-users mailing list