[rules-users] Call a function from a function?

Shahad Ahmed shahad.ahmed2 at gmail.com
Mon May 19 09:57:23 EDT 2008


Hi Michael,

I had a similar problem, but found that if I declared func2 before func1
(i.e. func2 appears above func1 in a drl file) then you can call func2 in
func1. I'm not sure if this is a bug in drools or a limitation of the
parser.

Regards
Shahad

On Mon, May 19, 2008 at 1:58 PM, Michael Katai <mk.others at gmx.at> wrote:

> Hello!
>
> Is it possible to call a Function in a Function?
>
> For example:
>
>  rule
>    when
>    then
>      func1(data1, data2);
>  end
>
>  function void func1(MyClass1 data1, MyClass2 data2)
>  {
>    func2(data1, data2);
>  }
>
>  function void func2(MyClass1 data1, MyClass2 data2)
>  {
>  }
>
> When I do so, i get the error message:
>
> func1 : Function Compilation error
> func1 (line:x): The method func2(MyClass1, MyClass2) is undefined for the
> type Func1
>
> Any suggestions?
> michael
>
> _______________________________________________
> 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/20080519/9290dd17/attachment.html 


More information about the rules-users mailing list