[rules-users] functions

Andrew Waterman andrew.waterman at gmail.com
Thu Jun 18 20:14:43 EDT 2009


That's a great idea Edson. I just found Mark's posting on this from 2006:

http://markmail.org/message/pbs73eainajilmjm

Very helpful.

best wishes,

Andrew

2009/6/18 Chris Richmond <crichmond at referentia.com>

>  Edson,
>
>
>
> Thanks…and I am considering that option as well…but the nice thing about
> the functions in the drl file is the system remains much more fluid..in
> other words, if I can focus on doing what I want to do all within the DRL
> file, it proves the flexibility of the system more to me than having to
> have  developer recompile the application itself with new classes.  Does
> that make sense?   Also, I would just like to know that I can actually make
> functions work for future reference.
>
>
>
> Thanks,
>
>
>
> Chris
>
>
>  ------------------------------
>
> *From:* rules-users-bounces at lists.jboss.org [mailto:
> rules-users-bounces at lists.jboss.org] *On Behalf Of *Edson Tirelli
> *Sent:* Thursday, June 18, 2009 1:15 PM
> *To:* Rules Users List
> *Subject:* Re: [rules-users] functions
>
>
>
>
>    Chris,
>
>    If you are creating a function library, why don't you create it as
> static methods in a java class? easier to develop, to unit test and you can
> use "import function" in the DRL to import all of them.
>
>    []s
>    Edson
>
> 2009/6/18 Chris Richmond <crichmond at referentia.com>
>
> Ok…I am trying to build a function library in my .drl file and I added this
> one test function
>
>
>
> function String outputString(String sData){
>
>     return sData;
>
> }
>
>
>
> And no matter where I place this in my .drl file, I get an exception one
> way or the other with compiling when I try instaniate and fire my rules.
>  The .drl file works exactly as expected if I remove this function
> declaration, and when I **do** try to add it, I do not actually call it
> anywhere…but get those errors.
>
>
>
> So my question is, where exactly do I need to place function declarations..
>
>
>
>
>
> Thanks,
>
>
> Chris
>
>
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> --
>  Edson Tirelli
>  JBoss Drools Core Development
>  JBoss, a division of Red Hat @ www.jboss.com
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
+1 510 342 5693

PO Box 7775 #8750
San Francisco, California   94120-7775

"Warning:  following standard input indefinitely is ineffective"
- /bin/tail error message

"Against logic there is no armor like ignorance."
 - Laurence J. Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090618/1ce5d1a0/attachment.html 


More information about the rules-users mailing list