<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=663431819-06042007><FONT face=Arial
color=#0000ff size=2>Edson,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=663431819-06042007><FONT face=Arial
color=#0000ff size=2>I am not trying with Trunk .. i am on 3.1.0 M1 .... If i
want to move to trunk what should i be doing ? Can you point me to some
documentation ? </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=663431819-06042007><FONT face=Arial
color=#0000ff size=2>thanks</FONT></SPAN></DIV>
<DIV><SPAN class=663431819-06042007></SPAN><FONT face=Arial><FONT
color=#0000ff><FONT size=2>Sanjay</FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=663431819-06042007></SPAN></FONT></FONT></FONT><BR> </DIV>
<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>Edson
Tirelli<BR><B>Sent:</B> Friday, April 06, 2007 1:50 PM<BR><B>To:</B> Rules Users
List<BR><B>Subject:</B> Re: [rules-users] LHS Dao Calls<BR></FONT><BR></DIV>
<DIV></DIV><BR> Sanjay, <BR><BR> Are you trying with
trunk? there was an issue using globals inside predicates that was fixed after
M1... <BR> Let me know...<BR><BR> []s<BR>
Edson<BR><BR>
<DIV><SPAN class=gmail_quote>2007/4/6, Sanjay Singh - s0singh < <A
href="mailto:Sanjay.Singh@wal-mart.com">Sanjay.Singh@wal-mart.com</A>>:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV dir=ltr align=left>
<P><SPAN><FONT face=Arial color=#0000ff size=2>Thanks Edson .. i tried with
these syntaxes but does not work .. any other clues ? just to let you
know that itemValidationDao is declared global and itemvo is asserted
</FONT></SPAN></P>
<P><FONT face=Arial size=2><STRONG>when</STRONG></FONT></P>
<P><FONT face=Arial size=2><STRONG>item : ItemVo(itemStatusCode !=
ItemVo.STATUS_ACTIVE ,
(itemValidationDao.isValidItemStatus(itemStatusCode)))</STRONG></FONT></P><FONT
color=#0000ff><FONT color=#0000ff>
<P><FONT face=Arial size=2>Caused by: org.drools.rule.InvalidRulePackage:
unknown:15:70 Unexpected token '('</FONT></P>
<P><FONT face=Arial size=2>unknown:16:1 mismatched token:
[@160,673:676='then',<33>,16:1]; expecting type ')'</FONT></P>
<P><FONT face=Arial size=2>unknown:17:29 Unexpected token
'"itemStatusCode"'</FONT></P>
<P><FONT face=Arial size=2>unknown:18:22 Unexpected token '"Item is cross ref
prime"'</FONT></P>
<P><STRONG><FONT face=Arial color=#000000 size=2>when</FONT></STRONG></P>
<P><STRONG><FONT face=Arial color=#000000 size=2>item : ItemVo(statusCode :
itemStatusCode != ItemVo.STATUS_ACTIVE ,
itemValidationDao.isValidItemStatus(statusCode))</FONT></STRONG></P><FONT
color=#0000ff>
<P><FONT face=Arial size=2>Caused by: org.drools.rule.InvalidRulePackage:
unknown:15:70 Unexpected token 'itemValidationDao'</FONT></P>
<P><FONT face=Arial size=2>unknown:16:1 mismatched token:
[@158,671:674='then',<33>,16:1]; expecting type ')'</FONT></P>
<P><FONT face=Arial size=2>unknown:17:29 Unexpected token
'"itemStatusCode"'</FONT></P>
<P><FONT face=Arial size=2>unknown:18:22 Unexpected token '"Item is cross ref
prime"'</FONT></P></FONT></FONT></FONT></DIV>
<DIV><SPAN></SPAN><FONT face=Arial><FONT color=#0000ff><FONT
size=2></FONT></FONT></FONT> </DIV>
<DIV><FONT size=+0><FONT size=+0><FONT face=Arial><FONT color=#0000ff><FONT
size=2>This also does not seem to work <SPAN>--
i have 3.1.0 M1 version .. </SPAN></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT size=+0><FONT size=+0>item : ItemVo ( itemStatusCode ==
ItemVo.STATUS_ACTIVE | == ItemVo.STATUS_DELETE
)<BR></FONT></FONT><SPAN></SPAN><FONT face=Arial><FONT color=#0000ff><FONT
size=2>w<SPAN>hile this still works :</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN><FONT
face="Times New Roman" color=#000000 size=3>item : ItemVo(itemStatusCode ==
ItemVo.STATUS_INACTIVE) or ItemVo(itemStatusCode ==
ItemVo.STATUS_DELETE)</FONT><BR></SPAN></FONT></FONT></FONT><BR></DIV>
<DIV lang=en-us dir=ltr align=left>
<HR>
<FONT face=Tahoma size=2><B>From:</B> <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-users-bounces@lists.jboss.org"
target=_blank>rules-users-bounces@lists.jboss.org</A> [mailto:<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-users-bounces@lists.jboss.org"
target=_blank>rules-users-bounces@lists.jboss.org</A>] <B>On Behalf Of
</B>Edson Tirelli<BR><B>Sent:</B> Friday, April 06, 2007 10:22
AM<BR><B>To:</B> Rules Users List<BR><B>Subject:</B> Re: [rules-users] LHS Dao
Calls<BR></FONT><BR></DIV>
<DIV><SPAN class=e id=q_111c7c16ac7b037e_1>
<DIV></DIV><BR> Sunjay,<BR><BR> Methods called by
using the "from" CE are expected to return a collection of VO's, not boolean
results. For your case, probably what you want is something like:<BR><BR><FONT
face=Arial size=2>ItemVo( statusCode : itemStatusCode != null, (</FONT><FONT
color=#ff0000><FONT face=Arial><FONT
size=2><STRONG>itemValidationDao.isValidItemStatus
(statusCode)</STRONG></FONT></FONT></FONT><FONT face=Arial size=2>)
)</FONT><BR><BR> A predicate allow you to call a method returning
a boolean value and use it as a constraint. <BR><BR>
[]s<BR> Edson<BR><BR>
<DIV><SPAN class=gmail_quote>2007/4/5, Sanjay Singh - s0singh <<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Sanjay.Singh@wal-mart.com"
target=_blank>Sanjay.Singh@wal-mart.com</A>>:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>Here is
a quick test i was trying to do for calling the dao in LHS but it fails ...
what am i missing .. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff><FONT face=Arial
size=2></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff><FONT face=Arial
size=2>global com.itemfile.item.dao.ItemValidationDao
itemValidationDao;</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left>
<P><FONT face=Arial size=2>global com.itemfile.rules.ValidationErrorMap
errors;</FONT></P>
<P><FONT face=Arial size=2>rule "Item should have a valid status"</FONT></P>
<P><FONT face=Arial size=2>when</FONT></P>
<P><FONT face=Arial size=2>ItemVo( statusCode : itemStatusCode !=
null)</FONT></P>
<P><FONT color=#ff0000><FONT face=Arial><FONT size=2><STRONG><FONT
color=#00ff00>ItemVo( statusCode<SPAN> == true</SPAN> )</FONT> from
itemValidationDao.isValidItemStatus(statusCode)</STRONG></FONT></FONT></FONT></P>
<P><FONT face=Arial size=2>then</FONT></P>
<P><FONT face=Arial
size=2>errors.addValidationError("nullItemStatusCode","Item Status Code is
null");</FONT></P>
<P><FONT face=Arial size=2>System.out.println("Item Base Defaults Called" +
itemValidationDao.isValidItemStatus(statusCode));</FONT></P>
<P><FONT face=Arial size=2>System.out.println("Item Status Code is
null");</FONT></P>
<P><FONT face=Arial size=2>end</FONT></P>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#800000 size=2>
<P>Caused by: org.drools.rule.InvalidRulePackage: unknown:32:28 Unexpected
token 'itemValidationDao'</P></FONT></SPAN></DIV>
<P><SPAN><FONT face=Arial><FONT color=#000000><FONT
size=2>isValidItemStatus<SPAN><FONT
color=#0000ff> () </FONT></SPAN> method returns a boolean and i
need to check if thats true than go to the RHS side ..... <SPAN><FONT
color=#0000ff> somehow </FONT></SPAN>it does not recognize
itemValidationDao in LHS side .. RHS same call works .... <SPAN><FONT
color=#0000ff> </FONT></SPAN></FONT></FONT></FONT></SPAN></P>
<P><SPAN><FONT face=Arial><FONT size=+0><FONT
size=2><SPAN></SPAN></FONT></FONT></FONT></SPAN><BR><FONT face=Arial
size=2><SPAN><SPAN>Can anybody suggest how to call database in LHS
... </SPAN></SPAN></FONT></P>
<P><SPAN><FONT face=Arial><FONT
size=2><SPAN>thanks</SPAN></FONT></FONT></SPAN></P></DIV></DIV>
<DIV>
<P></P>
<HR SIZE=1>
<P></P><BR>
<P><STRONG><BR>*******************************************************************<BR>***
This email and any files transmitted with it are confidential<BR>and
intended solely for the individual or entity to whom they are<BR>addressed.
If you have received this email in error destroy it<BR>immediately.
******************************************************<BR>****************
Wal-Mart Confidential
****************************<BR>******************************************<BR></STRONG></P></DIV><BR>_______________________________________________<BR>rules-users
mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-users@lists.jboss.org"
target=_blank>rules-users@lists.jboss.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="https://lists.jboss.org/mailman/listinfo/rules-users"
target=_blank>https://lists.jboss.org/mailman/listinfo/rules-users</A><BR><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR> Edson Tirelli<BR> Software
Engineer - JBoss Rules Core Developer<BR> Office: +55 11
3124-6000<BR> Mobile: +55 11 9218-4151 <BR> JBoss, a
division of Red Hat @ <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://www.jboss.com" target=_blank>www.jboss.com</A>
</SPAN></DIV></DIV>
<DIV><SPAN class=e id=q_111c7c16ac7b037e_3>
<DIV>
<P></P>
<HR SIZE=1>
<P></P><BR>
<P><STRONG><BR>*******************************************************************<BR>***
This email and any files transmitted with it are confidential<BR>and intended
solely for the individual or entity to whom they are<BR>addressed. If you have
received this email in error destroy it<BR>immediately.
******************************************************<BR>****************
Wal-Mart Confidential
****************************<BR>******************************************<BR></STRONG></P></DIV></SPAN></DIV><BR>_______________________________________________<BR>rules-users
mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org
</A><BR><A onclick="return top.js.OpenExtLink(window,event,this)"
href="https://lists.jboss.org/mailman/listinfo/rules-users"
target=_blank>https://lists.jboss.org/mailman/listinfo/rules-users</A><BR><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR> Edson Tirelli<BR> Software Engineer
- JBoss Rules Core Developer<BR> Office: +55 11
3124-6000<BR> Mobile: +55 11 9218-4151<BR> JBoss, a
division of Red Hat @ <A href="http://www.jboss.com">www.jboss.com</A>
</BODY></HTML>
<HTML><BODY><P><hr size=1></P><br>
<P><STRONG><br>
*******************************************************************<br>
*** This email and any files transmitted with it are confidential<br>
and intended solely for the individual or entity to whom they are<br>
addressed. If you have received this email in error destroy it<br>
immediately. ******************************************************<br>
**************** Wal-Mart Confidential ****************************<br>
******************************************<br>
</STRONG></P></BODY></HTML>