And it works :)<br><br><div class="gmail_quote">On Sun, Jul 18, 2010 at 7:47 PM, Meeraj Kunnumpurath <span dir="ltr"><<a href="mailto:mkunnumpurath@googlemail.com">mkunnumpurath@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Thanks.<br><br>In fact, I found this in the documentation, trying to follow your advice on using DRL functions<br><br><quote><br><br><p><a>Alternatively, you could use a static method in a
helper class,
e.g., <code>Foo.hello()</code>. Drools supports the use
of
function imports, so all you would need to do is:</a></p><pre><a>import function my.package.Foo.hello</a></pre><br></quote><br><br>Regards<br><font color="#888888">Meeraj</font><div><div></div><div class="h5"><br>
<br><div class="gmail_quote">
On Sun, Jul 18, 2010 at 6:53 PM, Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Regretfully, no: import static is not implemented.<br>
<br>
Consider using a DRL function to wrap the call of the static method,<br>
to achieve a shorter call.<br>
<br>
-W<br>
<br>
2010/7/18 Meeraj Kunnumpurath <<a href="mailto:mkunnumpurath@googlemail.com" target="_blank">mkunnumpurath@googlemail.com</a>>:<br>
<div><div></div><div>> Hi,<br>
><br>
> Are static imports as shown below allowed in rule files? It is giving me a<br>
> parse exception.<br>
><br>
> package mypackage;<br>
><br>
> dialect "mvel"<br>
><br>
> import mypackage.CreditTransferTransactionInformation10;<br>
> import static mypackage.ValidationHelper.invalidate;<br>
><br>
> global java.util.Set accountNumbers;<br>
><br>
> rule "Check debtor account number is not null"<br>
> salience -1<br>
> when<br>
> $c : CreditTransferTransactionInformation10 ( eval(<br>
> dbtrAcct.?id.?othr.?id == null ) )<br>
> then<br>
> invalidate($c, "PG003", "Account number is absent");<br>
> drools.halt();<br>
> end<br>
><br>
> Ta<br>
> Meeraj<br>
><br>
</div></div>> _______________________________________________<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>
><br>
><br>
<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><br>
</div></div></blockquote></div><br>