<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Use of a DAO in LHS</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3314" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=674315708-11082008><FONT face=Arial 
color=#0000ff size=2>Hi Jean-Baptiste,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=674315708-11082008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=674315708-11082008><FONT face=Arial 
color=#0000ff size=2>Here is a good (complete) example you can try 
following:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=674315708-11082008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=674315708-11082008><FONT face=Arial 
color=#0000ff size=2><A 
href="http://www.redhatmagazine.com/2008/07/11/jboss-drools-meets-hibernate/">http://www.redhatmagazine.com/2008/07/11/jboss-drools-meets-hibernate/</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=674315708-11082008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=674315708-11082008><FONT face=Arial 
color=#0000ff size=2>With kind regards,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=674315708-11082008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=674315708-11082008><FONT face=Arial 
color=#0000ff size=2>Mike</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> rules-users-bounces@lists.jboss.org 
  [mailto:rules-users-bounces@lists.jboss.org] <B>On Behalf Of </B>BINET 
  JEAN-BAPTISTE<BR><B>Sent:</B> 11 August 2008 08:06<BR><B>To:</B> Rules Users 
  List<BR><B>Subject:</B> RE: [rules-users] Use of a DAO in 
  LHS<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV dir=ltr align=left><SPAN class=079140007-11082008><FONT face=Arial 
  color=#0000ff size=2>On the contrary of what you said I read the 
  documentation. And there is&nbsp;this sentence :</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=079140007-11082008><FONT face=Arial 
  color=#0000ff size=2>"<FONT face="Times New Roman" color=#000000 size=3>The 
  next example shows how we can reason over the results of a hibernate query. 
  The Restaurant pattern will reason over and bind with each result in 
  turn:"</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=079140007-11082008><FONT color=#0000ff>but 
  after there is no example !!!!</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=079140007-11082008><FONT face=Arial 
  color=#0000ff size=2>I already tried to use the from keyword but I didn't 
  succeed in writting a good syntax. So, that's why I ask the 
  question.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=079140007-11082008><FONT face=Arial 
  color=#0000ff size=2>The only thing I succeed in is to write a function which 
  uses my dao to do SQL query.Then I call this function with "eval" in the 
  LHS.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=079140007-11082008><FONT face=Arial 
  color=#0000ff size=2>But how to use the "from" keyword ???</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=079140007-11082008><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=079140007-11082008><FONT face=Arial 
  color=#0000ff size=2>BR</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=079140007-11082008><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=079140007-11082008><FONT face=Arial 
  color=#0000ff size=2>Jean-Baptiste</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=079140007-11082008><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV class=OutlookMessageHeader lang=fr dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>De&nbsp;:</B> rules-users-bounces@lists.jboss.org 
  [mailto:rules-users-bounces@lists.jboss.org] <B>De la part de</B> Anstis, 
  Michael (M.)<BR><B>Envoyé&nbsp;:</B> vendredi 8 août 2008 
  17:36<BR><B>À&nbsp;:</B> Rules Users List<BR><B>Objet&nbsp;:</B> RE: 
  [rules-users] Use of a DAO in LHS<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV dir=ltr align=left><SPAN class=624033515-08082008><FONT face=Arial 
  color=#0000ff size=2>I suspect you may not have read the 
  documentation.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=624033515-08082008><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=624033515-08082008><FONT face=Arial 
  color=#0000ff size=2>Take a look at the "from" 
keyword.</FONT></SPAN></DIV><BR>
  <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
    <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
    <HR tabIndex=-1>
    <FONT face=Tahoma size=2><B>From:</B> rules-users-bounces@lists.jboss.org 
    [mailto:rules-users-bounces@lists.jboss.org] <B>On Behalf Of </B>BINET 
    JEAN-BAPTISTE<BR><B>Sent:</B> 08 August 2008 16:01<BR><B>To:</B> 
    rules-users@lists.jboss.org<BR><B>Subject:</B> [rules-users] Use of a DAO in 
    LHS<BR></FONT><BR></DIV>
    <DIV></DIV><!-- Converted from text/rtf format -->
    <P><FONT face=Arial size=2>Hello,</FONT> </P>
    <P><FONT face=Arial size=2>I have a DRL file in which I have a global 
    variable representing a DAO.</FONT> <BR><FONT face=Arial size=2>So, I 
    succeed in writting a rule which uses this DAO to run a SQL query</FONT> 
    <BR><FONT face=Arial size=2>on the database from the RHS part.</FONT> 
    <BR><FONT face=Arial size=2>But now, I would like to use my DAO in the LHS, 
    I mean I want to fire my</FONT> <BR><FONT face=Arial size=2>rule only if a 
    condition is ok on the result of my SQL query.</FONT> <BR><FONT face=Arial 
    size=2>Is it possible to call a method of my DAO in the LHS part ?</FONT> 
    <BR><FONT face=Arial size=2>I have not found an example.</FONT> </P>
    <P><FONT face=Arial size=2>Thanks.</FONT> </P>
    <P><FONT face=Arial size=2>Regards,</FONT> </P>
    <P><FONT face=Arial size=2>Jean-Baptiste</FONT> 
</P></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>