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 

 

 

_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to