[rules-users] Design Question

Christie, Blair blair.christie at cgi.com
Thu Jan 24 12:21:59 EST 2008


Does anyone have any examples of using  the new 'from' element it is now
common to pass a Hibernate session as a global, to allow 'from' to pull
data from a named Hibernate query.

 

Would it be good design to store the values for a condition in a
database so they can be changed without having to go into the .drl file?


 

i.e.

So instead of ..

 

 Rule "free food"

    when

        Food( $food : name == "hamburger" )

        $: Person( favouriteFood == $food )

    then

        System.out.println( $person.getName() + " gets a hamburger" );

    End

 

You would have 

 

global Food food //where food is inserted as a global but populated from
a db. 

 

Rule "free food"

    when

       $food : food

        $person: Person( favouriteFood == $food )

    then

        System.out.println( $person.getName() + " gets a " +
$food.getName() );

    End

 

Cheers,

 

Blair 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080124/de966ab6/attachment.html 


More information about the rules-users mailing list