<!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=832233716-06042007><FONT face=Arial 
color=#0000ff size=2>This also fails </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=832233716-06042007><FONT color=#0000ff 
size=2><FONT size=2>
<P><FONT face=Arial>when</FONT></P>
<P><FONT face=Arial>itemMaint : ItemMaintWorkVo()</FONT></P>
<P><FONT face=Arial>oldItem : ItemVo( statusCode : itemStatusCode == "oldItem") 
from itemMaint.getCurrentItem()</FONT></P>
<P><FONT face=Arial>newItem : ItemVo( statusCode : itemStatusCode == "oldItem" ) 
from itemMaint.getNewItem()</FONT></P>
<P><FONT face=Arial>then</FONT></P>
<P><FONT face=Arial>System.out.println("This works");</FONT></P></FONT>
<P><FONT face=Arial>Caused by: org.drools.rule.InvalidRulePackage: unknown:15:69 
Unexpected token 'itemMaint'</FONT></P>
<P><FONT face=Arial>unknown:16:70 Unexpected token 
'itemMaint'</FONT></P></FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=832233716-06042007><FONT face=Arial color=#0000ff size=2>If i 
put only the first line </FONT></SPAN></DIV>
<DIV><SPAN class=832233716-06042007><FONT face=Arial><SPAN 
class=832233716-06042007><FONT color=#0000ff><FONT size=2>when</FONT></FONT>
<P><FONT color=#0000ff size=2>itemMaint : ItemMaintWorkVo()</FONT></P>
<P><SPAN class=832233716-06042007><FONT color=#0000ff size=2>it executes the RHS 
and works fine .. but if itry to call itemMaint in from clause it fails as above 
... </FONT></SPAN></P>
<P><SPAN class=832233716-06042007><FONT color=#0000ff size=2>Both item vo's are 
created and they have appropriate status codes in them .. But i did not assert 
them as facts ..i was asserting maintvo anyway .. </FONT></SPAN></P>
<P><SPAN class=832233716-06042007><FONT color=#0000ff 
size=2>thanks</FONT></SPAN></P></SPAN></FONT></SPAN></DIV>
<DIV><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 10:45 AM<BR><B>To:</B> Rules 
Users List<BR><B>Subject:</B> Re: [rules-users] LHS Dao Calls / Accessing Diff 
instances of sameclass in drl files<BR></FONT><BR></DIV>
<DIV></DIV>&nbsp; Sanjay <BR><BR>&nbsp; I already answered question number 1. 
Plz see my other e-mail.<BR><BR>&nbsp; For question number 2, try:<BR><BR><SPAN>
<P><FONT color=#ff0000><FONT face=Arial color=#000000 size=2>rule "Item status 
cannot be null"</FONT></FONT></P>
<P><FONT color=#ff0000><FONT face=Arial color=#000000 
size=2>when</FONT></FONT></P>
<P><FONT color=#ff0000><FONT face=Arial color=#000000 size=2>&nbsp;&nbsp;&nbsp; 
itemMaint : ItemMaintWorkVo()</FONT></FONT></P>
<P><FONT color=#ff0000><FONT face=Arial color=#000000 size=2>&nbsp;&nbsp;&nbsp; 
oldItem : ItemVo( &lt;constraints&gt;) from 
itemMaint.getCurrentItem()</FONT></FONT></P>
<P><FONT color=#ff0000><FONT face=Arial color=#000000 size=2>&nbsp;&nbsp;&nbsp; 
newItem : ItemVo( &lt;constraints&gt; ) from 
itemMaint.getNewItem()<BR></FONT></FONT></P>
<P><FONT color=#ff0000><FONT face=Arial color=#000000 
size=2>then</FONT></FONT></P>
<P><FONT color=#ff0000><FONT face=Arial color=#000000 size=2>end</FONT></FONT> 
</P></SPAN>
<DIV dir=ltr align=left><SPAN><BR>&nbsp;&nbsp; Let us know if above works. When 
the method called by "from" returns a single non-Collection object, the 
dataprovider automatically wrapps the result in a singleton list. 
<BR><BR>&nbsp;&nbsp; []s<BR>&nbsp;&nbsp; Edson<BR></SPAN></DIV><BR><BR>
<DIV><SPAN class=gmail_quote>2007/4/6, Sanjay Singh - s0singh &lt;<A 
href="mailto:Sanjay.Singh@wal-mart.com">Sanjay.Singh@wal-mart.com</A>&gt;:</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>Hello 
  everybody,</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>I still 
  have 2 of my questions pending and i would really appreciate if somebody could 
  get back to me and help me out.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>1.Calling 
  dao in LHS when the method calls does not return collection and returns lets 
  say a boolean .. Code is attached below for a quick look.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN>
  <DIV dir=ltr align=left><SPAN><FONT color=#0000ff>
  <P><FONT face=Arial size=2></FONT></P><FONT face=Arial size=2>rule "Item 
  should have a valid status"</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left>
  <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>&nbsp;)</FONT> from 
  itemValidationDao.isValidItemStatus(statusCode)</STRONG></FONT></FONT></FONT></P>
  <P><FONT face=Arial size=2>then</FONT></P>
  <P></P>
  <P><FONT face=Arial size=2></FONT></P><FONT face=Arial 
  size=2>System.out.println("Item Status Code 
  is&nbsp;<SPAN>valid</SPAN>");</FONT>
  <P></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>&nbsp;()&nbsp;</FONT></SPAN> 
  method returns a boolean and i need to check if thats true than go to the RHS 
  side ....&nbsp;<SPAN><FONT color=#0000ff>&nbsp;somehow </FONT></SPAN>it does 
  not recognize itemValidationDao in LHS side .. RHS same call works 
  ...&nbsp;<SPAN><FONT 
  color=#0000ff>&nbsp;</FONT></SPAN></FONT></FONT></FONT></SPAN><FONT face=Arial 
  size=2><SPAN><SPAN>Can anybody suggest how to call database in LHS 
  ..&nbsp;</SPAN></SPAN></FONT></P>
  <P></P></DIV></SPAN><SPAN><FONT face=Arial color=#0000ff size=2>2.If I have a 
  method with the signature </FONT></SPAN></DIV></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial size=2><STRONG>public 
  ValidationErrorMap validateItemOrdEffDateMaintain(ItemVo oldItem, ItemVo 
  newItem, ValidationErrorMap errors, UserVo user){ }</STRONG> 
  </FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial size=2>Is there a way that i 
  can assert two objects of same type in my working memory ?? Like oldItem and 
  newItem are same ItemVo's and they have exactly same fields .. How do i assert 
  two same type objects so that i can deal with them in drl differently ... I 
  have one ItemMaintVo which can give me oldItem and newItem and i can only 
  assert ItemMaintVo but again how do i refer to two same type objects ... Here 
  is the syntax ..</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><STRONG><FONT face=Arial color=#ff0000 
  size=2></FONT></STRONG></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN><FONT color=#ff0000></FONT>
  <P><FONT color=#ff0000><FONT face=Arial color=#000000 size=2>rule "Item status 
  cannot be null"</FONT></FONT></P>
  <P><FONT color=#ff0000><FONT face=Arial color=#000000 
  size=2>when</FONT></FONT></P>
  <P><FONT color=#ff0000><FONT face=Arial color=#000000 size=2>oldItemMaint : 
  ItemMaintWorkVo(oldItem : currentItem)</FONT></FONT></P>
  <P><FONT color=#ff0000><FONT face=Arial color=#000000 size=2>newItemMaint : 
  ItemMaintWorkVo(newItem : newItem)</FONT></FONT></P>
  <P><SPAN><FONT color=#ff0000><FONT face=Arial color=#000000 size=2>// I need 
  to reach to the ItemVo (from old and new item) .. how do i do it here 
  ?</FONT></FONT></SPAN></P>
  <P><FONT color=#ff0000><FONT face=Arial color=#000000 
  size=2>then</FONT></FONT></P>
  <P><FONT color=#ff0000><FONT face=Arial><FONT color=#000000><FONT 
  size=2><SPAN>S</SPAN>ystem.out.println( "Item Status Code is "&nbsp;<SPAN> + 
  old or new item <STRONG>. getItemStatuscode</STRONG>() 
  &nbsp;</SPAN>);</FONT></FONT></FONT></FONT></P>
  <P><FONT color=#ff0000><FONT face=Arial color=#000000 
  size=2>end</FONT></FONT></P></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>This does 
  not seem to work .. whats the way to&nbsp;operate on&nbsp;two different 
  instances of same class in DRL files ....</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV><FONT face=Arial color=#0000ff 
  size=2></FONT><BR>
  <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 8:53 AM<BR><B>To:</B> 
  Rules Users List<BR><B>Subject:</B> Re: [rules-users] Checking OR condition in 
  LHS<BR></FONT><BR></DIV>
  <DIV></DIV>&nbsp; Sanjay,<BR><BR>&nbsp; You almost got it right. If you are 
  using 3.1M1 or later, you can do:<BR><BR>item : ItemVo ( itemStatusCode == 
  ItemVo.STATUS_ACTIVE | == ItemVo.STATUS_DELETE )<BR><BR>&nbsp;&nbsp; field 
  connective constraints use a single "|" or "&amp;". <BR><BR>&nbsp;&nbsp; 
  []s<BR>&nbsp;&nbsp; Edson<BR><BR>
  <DIV><SPAN class=gmail_quote>2007/4/4, Sanjay Singh - s0singh &lt;<A 
  onclick="return top.js.OpenExtLink(window,event,this)" 
  href="mailto:Sanjay.Singh@wal-mart.com" 
  target=_blank>Sanjay.Singh@wal-mart.com</A>&gt;:</SPAN> 
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">While 
    this is 
    working<BR><BR>when<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item 
    : ItemVo(itemStatusCode == ItemVo.STATUS_INACTIVE) 
    or<BR>ItemVo(itemStatusCode == ItemVo.STATUS_DELETE)<BR><BR>Is this the 
    right way of doing it ?<BR><BR>thanks<BR><BR>-----Original Message----- 
    <BR>From: <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><BR>[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>] On Behalf Of Sanjay 
    Singh - <BR>s0singh<BR>Sent: Wednesday, April 04, 2007 2:12 PM<BR>To: Rules 
    Users List<BR>Subject: [rules-users] Checking OR condition in 
    LHS<BR><BR>when<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item : 
    ItemVo ( itemStatusCode == ItemVo.STATUS_ACTIVE ||<BR>ItemVo.STATUS_DELETE 
    )<BR>when<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item : ItemVo ( 
    itemStatusCode == ItemVo.STATUS_ACTIVE ||<BR>itemStatusCode == 
    ItemVo.STATUS_DELETE 
    )<BR>when<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item : ItemVo ( 
    (itemStatusCode == ItemVo.STATUS_ACTIVE ||<BR>itemStatusCode == 
    ItemVo.STATUS_DELETE) 
    )<BR>when<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item : ItemVo ( 
    itemStatusCode == ItemVo.STATUS_ACTIVE || ==<BR>ItemVo.STATUS_DELETE 
    )<BR>when<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item : ItemVo ( 
    ( itemStatusCode == ItemVo.STATUS_ACTIVE ) || (<BR>itemStatusCode == 
    ItemVo.STATUS_DELETE ) 
    )<BR>when<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item : ItemVo ( 
    itemStatusCode == ItemVo.STATUS_ACTIVE OR<BR>itemStatusCode == 
    ItemVo.STATUS_DELETE )<BR><BR>All of these when conditions fail for me ... 
    Can somebody send the syntax <BR>for two attributes check with OR condition 
    ..<BR><BR>thanks<BR><BR><BR>-----Original Message-----<BR>From: <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><BR>[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>] On Behalf Of Sanjay Singh 
    -<BR>s0singh<BR>Sent: Wednesday, April 04, 2007 8:13 AM<BR>To: Rules Users 
    List<BR>Subject: RE: [rules-users] NullPointer in LHS dao calls 
    ..<BR><BR>Thanks Rahul <BR>Yes i was setting it in working memory thats why 
    it was working in 
    RHS<BR>.....<BR><BR>workingMemory.setGlobal("itemValidationDao", 
    itemValidationDao);<BR>and then in the DRL<BR>global 
    com.walmart.itemfile.item.dao.ItemValidationDao 
    <BR>itemValidationDao;<BR><BR>I think i am missing something very basic 
    ..<BR><BR>thanks<BR><BR>-----Original Message-----<BR>From: <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><BR>[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>] On Behalf Of Rahul 
    Phadnis<BR>Sent: Tuesday, April 03, 2007 5:42 PM<BR>To: Rules Users 
    List<BR>Subject: Re: [rules-users] NullPointer in LHS dao calls .. 
    <BR><BR>Did you set the global in the WorkingMemory?<BR><BR>You can do that 
    using the API at<BR><BR><A 
    onclick="return top.js.OpenExtLink(window,event,this)" 
    href="http://labs.jboss.com/file-access/default/members/jbossrules/freezone/do" 
    target=_blank>http://labs.jboss.com/file-access/default/members/jbossrules/freezone/do 
    </A><BR>cs/3.0.5/apidocs/index.html<BR>and yes that is for 3.0.5. I am sure 
    there is an<BR>equivalent for the version that you are 
    using.<BR><BR>-Rahul<BR><BR><BR>--- Sanjay Singh - s0singh &lt;<A 
    onclick="return top.js.OpenExtLink(window,event,this)" 
    href="mailto:Sanjay.Singh@wal-mart.com" target=_blank> 
    Sanjay.Singh@wal-mart.com</A>&gt;<BR>wrote:<BR><BR>&gt; Since i could not 
    get the earlier code running i<BR>&gt; tried using eval in LHS<BR>&gt; side 
    for Dao calls but i keep on getting<BR>&gt; NullPointerException 
    ..<BR>&gt;<BR>&gt; rule "Item should have a valid status"<BR>&gt;<BR>&gt; 
    when<BR>&gt;<BR>&gt; ItemVo (statusCode : itemStatusCode != 
    null)<BR>&gt;<BR>&gt; eval(<BR>&gt; 
    !itemValidationDao.isValidItemStatus(statusCode) ) <BR>&gt;<BR>&gt; 
    then<BR>&gt;<BR>&gt;<BR>errors.addValidationError("invalidtemStatusCode","Item<BR>&gt; 
    Status Code is<BR>&gt; invalid ");<BR>&gt;<BR>&gt; end<BR>&gt;<BR>&gt; 
    Exception data: org.drools.RuntimeDroolsException :<BR>&gt; 
    java.lang.NullPointerException<BR>&gt;<BR>&gt; at 
    org.drools.rule.EvalCondition.isAllowed(Unknown<BR>&gt; 
    Source)<BR>&gt;<BR>&gt; 
    at<BR>&gt;<BR>org.drools.reteoo.EvalConditionNode.assertTuple(Unknown<BR>&gt; 
    Source) <BR>&gt;<BR>&gt; 
    at<BR>&gt;<BR>org.drools.reteoo.LeftInputAdapterNode.createAndAssertTuple(Unknown<BR>&gt; 
    Source)<BR>&gt;<BR>&gt; 
    at<BR>&gt;<BR>org.drools.reteoo.LeftInputAdapterNode.assertObject(Unknown<BR>&gt; 
    Source)<BR>&gt;<BR>&gt; 
    at<BR>&gt;<BR>org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown<BR>&gt; 
    Source)<BR>&gt;<BR>&gt; Can somebody please help .. thanks<BR>&gt;<BR>&gt; 
    ________________________________<BR>&gt;<BR>&gt; From: Sanjay Singh - 
    s0singh <BR>&gt; Sent: Tuesday, April 03, 2007 11:01 AM<BR>&gt; To: 'Anstis, 
    Michael (M.)'; Rules Users List<BR>&gt; Subject: RE: 
    Hi.<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Thanks for getting back to me Mike and 
    Edson and<BR>&gt; Sorry for the delayed <BR>&gt; response.<BR>&gt;<BR>&gt; I 
    looked at your examples Mike and i felt better as<BR>&gt; you said that we 
    can<BR>&gt; make dao calls in LHS .. And Edson suggested not to<BR>&gt; be 
    afraid of<BR>&gt; suggesting the same constraint for more than one <BR>&gt; 
    rule .. i guess i was<BR>&gt; looking at it more procedural way and dint 
    want any<BR>&gt; repetition of those<BR>&gt; conditions as the top level IF 
    block but looks like<BR>&gt; it won't hurt to<BR>&gt; mention these 
    constraints in all the rules related <BR>&gt; to this check ...so i<BR>&gt; 
    can include this check in all the rules .. hmm ..<BR>&gt;<BR>&gt; Here is a 
    quick test i was trying to do for calling<BR>&gt; the dao in LHS but<BR>&gt; 
    it fails ... what am i missing .. <BR>&gt;<BR>&gt; package 
    com.walmart.itemfile.item.rules<BR>&gt;<BR>&gt; import 
    com.walmart.itemfile.item.vo.ItemVo;<BR>&gt;<BR>&gt; import 
    com.walmart.itemfile.item.dao.ItemDao;<BR>&gt;<BR>&gt; import<BR>&gt; 
    com.walmart.itemfile.item.dao.ItemValidationDao ;<BR>&gt;<BR>&gt; import 
    java.lang.String;<BR>&gt;<BR>&gt; global<BR>&gt; 
    com.walmart.itemfile.item.dao.ItemValidationDao<BR>&gt; 
    itemValidationDao;<BR>&gt;<BR>&gt; global 
    com.walmart.itemfile.rules.ValidationErrorMap<BR>&gt; 
    errors;<BR>&gt;<BR>&gt; rule "Item should have a valid 
    status"<BR>&gt;<BR>&gt; when<BR>&gt;<BR>&gt; ItemVo( statusCode : 
    itemStatusCode != null)<BR>&gt;<BR>&gt; ItemVo( statusCode == true ) 
    from<BR>&gt; itemValidationDao.isValidItemStatus (statusCode) ...<BR>&gt; my 
    isValidItemStatus<BR>&gt; method returns a boolean (not collection of 
    codes)<BR>&gt; and i need to check<BR>&gt; if thats true than go to the RHS 
    side .. is the line<BR>&gt; in green even right<BR>&gt; ... in any case it 
    does not recognize<BR>&gt; itemValidationDao to begin with in<BR>&gt; LHS 
    side .. RHS same call works ..<BR>&gt;<BR>&gt; then<BR>&gt;<BR>&gt; 
    errors.addValidationError("nullItemStatusCode","Item <BR>&gt; Status Code 
    is<BR>&gt; null");<BR>&gt;<BR>&gt; System.out.println("Item Base Defaults 
    Called" +<BR>&gt; 
    itemValidationDao.isValidItemStatus(statusCode));<BR>&gt;<BR>&gt; 
    System.out.println("Item Status Code is null"); <BR>&gt;<BR>&gt; 
    end<BR>&gt;<BR>&gt; Caused by: org.drools.rule.InvalidRulePackage:<BR>&gt; 
    unknown:32:28 Unexpected<BR>&gt; token 
    'itemValidationDao'<BR>&gt;<BR>&gt;<BR>&gt; thanks for the help guys 
    ..<BR>&gt;<BR>&gt; Sanjay<BR>&gt;<BR>&gt; 
    ________________________________<BR>&gt;<BR>&gt; From: Anstis, Michael 
    (M.)<BR>&gt; [mailto:<A 
    onclick="return top.js.OpenExtLink(window,event,this)" 
    href="mailto:manstis1@ford.com" target=_blank>manstis1@ford.com</A>]<BR>&gt; 
    Sent: Monday, March 26, 2007 8:57 AM <BR>&gt; To: Rules Users List<BR>&gt; 
    Cc: Sanjay Singh - s0singh<BR>&gt; Subject: RE: Hi.<BR>&gt;<BR>&gt;<BR>&gt; 
    Hi Sanjay,<BR>&gt;<BR>&gt; To firstly answer your questions (in my 
    opinion):<BR>&gt; 1. You can't do nested whens in the LHS but you can 
    <BR>&gt; do nested if / else<BR>&gt; in the RHS (although you'd fore go the 
    benefits of a<BR>&gt; RETE-based<BR>&gt; inference engine; but possible if 
    you've got very<BR>&gt; few rules and<BR>&gt; facts...). I believe that 
    there is work to have an <BR>&gt; "otherwise" statement<BR>&gt; for rule 
    syntax, how progressed this is and how it<BR>&gt; will work I don't<BR>&gt; 
    know - over to Mark and team?!?<BR>&gt; 2. Yes, take a look at the "from" 
    statement (new for <BR>&gt; 3.1-M1, see<BR>&gt;<BR><A 
    onclick="return top.js.OpenExtLink(window,event,this)" 
    href="http://wiki.jboss.org/wiki/Wiki.jsp?page=3.1M1ReleaseNotes" 
    target=_blank>http://wiki.jboss.org/wiki/Wiki.jsp?page=3.1M1ReleaseNotes 
    </A>)<BR>&gt; 3. Yes, take a look at rule-flow at<BR>&gt;<BR><A 
    onclick="return top.js.OpenExtLink(window,event,this)" 
    href="http://labs.jboss.com/portal/index.html?ctrl:cmd=render&amp;ctrl:window=defa" 
    target=_blank>http://labs.jboss.com/portal/index.html?ctrl:cmd=render&amp;ctrl:window=defa 
    </A><BR>&gt;<BR>ult.blog.PrjBlogPortletWindowDefaultBlog&amp;project=jbossrules&amp;from=1&amp;link=<BR>&gt;<BR>RuleFlow_%28Kris_Verlaenen%29#RuleFlow_%28Kris_Verlaenen%29 
    <BR>&gt; (although I<BR>&gt; don't know if this is complete if 3.1-M1 - I 
    think<BR>&gt; it's not). Although I<BR>&gt; don't think your rules really 
    need rule-flow; you<BR>&gt; just need to identify<BR>&gt; and isolate the 
    patterns (IF's) that would cause <BR>&gt; each "Do Something" to<BR>&gt; be 
    ran and create a rule for each - this has the<BR>&gt; benefit of 
    separating<BR>&gt; each action into a separate rule making 
    maintenance<BR>&gt; a whole bunch<BR>&gt; easier). <BR>&gt;<BR>&gt; Anyway, 
    I'd try some rules like the following<BR>&gt; examples (the rest are<BR>&gt; 
    based upon these):-<BR>&gt;<BR>&gt; Rule "Rule 1"<BR>&gt; 
    when<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; NewItem ( itemStatusCode == null) 
    <BR>&gt; then<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; //do something<BR>&gt; 
    end<BR>&gt;<BR>&gt; Rule "Rule 2"<BR>&gt; 
    when<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; $u : User( 
    )<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; $ni : NewItem ( $isc : itemStatusCode != 
    null )<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; not Codes ( codes contains $isc ) 
    from <BR>&gt; valDao.getValidItemStatusCodesForUser($u)<BR>&gt; 
    then<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; //Do something<BR>&gt; 
    end<BR>&gt;<BR>&gt; Rule "Rule 3"<BR>&gt; when<BR>&gt;<BR>=== message 
    truncated ===&gt;<BR>_______________________________________________ 
    <BR>&gt; rules-users mailing list<BR>&gt; <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>&gt; <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>&gt;<BR><BR><BR><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>-----------------------------------------<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><BR><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>-----------------------------------------<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><BR><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>-----------------------------------------<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><BR><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></BLOCKQUOTE></DIV><BR><BR 
  clear=all><BR>-- <BR>&nbsp;&nbsp;Edson Tirelli<BR>&nbsp;&nbsp;Software 
  Engineer - JBoss Rules Core Developer<BR>&nbsp;&nbsp;Office: +55 11 
  3124-6000<BR>&nbsp;&nbsp;Mobile: +55 11 9218-4151 <BR>&nbsp;&nbsp;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> 
  <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">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>&nbsp;&nbsp;Edson Tirelli<BR>&nbsp;&nbsp;Software Engineer 
- JBoss Rules Core Developer<BR>&nbsp;&nbsp;Office: +55 11 
3124-6000<BR>&nbsp;&nbsp;Mobile: +55 11 9218-4151 <BR>&nbsp;&nbsp;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>