[rules-users] how to share functions between drl files ?

psentosa psentosa at yahoo.com
Mon Aug 18 10:43:34 EDT 2008


Write your function as a static function.
Both rules have to import this function just like importing class
By using BRMS you put your function as a function asset and any rule can
(from the same package) can use it

regards


Ady Bastian wrote:
> 
> I have same functions that is used on two rule files (.drl), is it
> possible to 
> share the functions without write it twice.. ?
> 
> Example :
> -------------------
> file: rule1.drl
> 
> rule "rule_on_file_1"
> when
> ....
>  call_function();
> end
> --------------------
> file: rule2.drl
> 
> rule "rule_on_file_2"
> when
> ....
>  call_function();
> end
> ---------------------
> 
> call_function is a drool function :
> 
> function call_function() {
> ....
> }
> 

-- 
View this message in context: http://www.nabble.com/how-to-share-functions-between-drl-files---tp18976445p19033212.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list