<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>We had similar use case. What we do is we
model the Schema elements, generate Java Beans (pojo), and write rules using
these Pojo. Now we have written a Service on top which takes Hibernate QL and
gets the database records as the same Pojos that Rules are defined on and fire
the Rules. Thus the service is generic and can be changed to take any Query.
The Rules can me modified and changed anytime and redeployed but business
objects in form of Pojos remain the same. Hope this helps<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>-Uday<o:p></o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <b><span style='font-weight:bold'>On
Behalf Of </span></b>Joe Chuby<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, March 09, 2007 3:53
AM<br>
<b><span style='font-weight:bold'>To:</span></b> rules-users@lists.jboss.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> [rules-users] Using rules
with database scenario</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Hi all, <br>
<br>
First time trying to learn JBoss Rules here. We have a pretty large database
(DBMS), we want to build some rules and retrieve data based on the rules. <br>
<br>
Could someone give a hint or an example of this usage scenario? I mean, how can
I use rules for database query, without writing my rules in SQL directly? We
are currently writing everything in HQL (Hibernate), but the rules change every
3 months on average, so that's not a way to maintain the system. Therefore, we
want to extract that portion of the business logic out of the code. The data
structure does not change, but the rules keep on changing. <br>
<br>
I'm reading the user's guide, running thru the examples, writing some of my
own, but still no clue how to make it work with database.<br>
<br>
If someone could give a sample, that would be greatly appreciated.<br>
<br>
Thanks a lot.<br>
<br>
<br>
<o:p></o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp; <o:p></o:p></span></font></p>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=1 width="100%" align=center>

</span></font></div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><a href="http://us.rd.yahoo.com/evt=49935/*http:/games.yahoo.com">Bored
stiff?</a> Loosen up...<br>
<a href="http://us.rd.yahoo.com/evt=49935/*http:/games.yahoo.com">Download and
play hundreds of games for free</a> on Yahoo! Games.<o:p></o:p></span></font></p>

</div>

</body>

</html>