<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br></blockquote>&nbsp;&nbsp; Sanjay,<br><br>&nbsp;&nbsp; Those nested if/else blocks means someone already got your &quot;business rules&quot; and modelled into a &quot;procedural algorithm&quot;. What I mean is, for example, your first &quot;if&quot; (the external one) is a &quot;shared&quot; condition for all your rules and that is the reason the others are nested inside it. This is the way, in a procedural way, to &quot;code&quot; efficiently, as the external if will be executed only once.
<br><br>&nbsp;&nbsp; When using a declarative rules engine, you don&#39;t need to think like that. Go back one step, work with higher level rule specifications, and let the engine do the &quot;optimization&quot; magic for you. Don&#39;t be afraid of stating the same constraint in more than one rule... the engine will verify and optimize always possible.
<br><br>&nbsp;&nbsp; You will probably need to refactor your code a little to work in a more declarative fashion. Michael gave you good examples.<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><div><span class="gmail_quote">2007/3/26, Anstis, Michael (M.) &lt;
<a href="mailto:manstis1@ford.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">manstis1@ford.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><span class="e" id="q_1118f7b8fa579055_1">



<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Hi Sanjay,</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">To firstly answer your questions (in my 
opinion):</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">1. You can&#39;t do nested whens in the LHS&nbsp;but you can do 
nested if / else in the RHS (although you&#39;d fore go the&nbsp;benefits of a 
RETE-based inference engine; but possible if you&#39;ve got very few rules and 
facts...). I believe that there is work to have an &quot;otherwise&quot; statement for 
rule syntax, how progressed this is and how it will work I don&#39;t know - over to 
Mark and team?!?</font></span><span>&nbsp;</span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">2. Yes, take a look at the &quot;from&quot; statement (new for 
3.1-M1, see <a href="http://wiki.jboss.org/wiki/Wiki.jsp?page=3.1M1ReleaseNotes" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://wiki.jboss.org/wiki/Wiki.jsp?page=3.1M1ReleaseNotes</a>)</font>

</span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">3. Yes, take a look at rule-flow at <a href="http://labs.jboss.com/portal/index.html?ctrl:cmd=render&amp;ctrl:window=default.blog.PrjBlogPortletWindowDefaultBlog&amp;project=jbossrules&amp;from=1&amp;link=RuleFlow_%28Kris_Verlaenen%29#RuleFlow_%28Kris_Verlaenen%29" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

http://labs.jboss.com/portal/index.html?ctrl:cmd=render&amp;ctrl:window=default.blog.PrjBlogPortletWindowDefaultBlog&amp;project=jbossrules&amp;from=1&amp;link=RuleFlow_%28Kris_Verlaenen%29#RuleFlow_%28Kris_Verlaenen%29</a>

&nbsp;(although 
I don&#39;t know if this is complete if 3.1-M1 - I think it&#39;s not). Although I don&#39;t 
think your rules really need rule-flow; you just need to identify and isolate 
the patterns (IF&#39;s) that would cause each &quot;Do Something&quot; to be ran and create a 
rule for each - this has the benefit of separating each action into a separate 
rule making maintenance a whole bunch easier).</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Anyway, I&#39;d try some rules like the following examples (the 
rest are based upon these):-</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Rule &quot;Rule 1&quot;</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">when</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">&nbsp;&nbsp;&nbsp; NewItem ( itemStatusCode == null) 
</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">then</font></span></div>
<div dir="ltr" align="left"><span>&nbsp;&nbsp;&nbsp; <font color="#0000ff" face="Arial" size="2">//do something</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">end</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Rule &quot;Rule 2&quot;</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">when</font></span></div>
<div dir="ltr" align="left"><span>&nbsp;&nbsp;&nbsp; <font color="#0000ff" face="Arial" size="2">$u : User( )</font></span></div>
<div dir="ltr" align="left"><span>&nbsp;&nbsp;&nbsp; <font face="Arial"><font color="#0000ff" size="2">$ni : NewItem ( $isc : itemStatusCode != 
null )</font></font></span></div>
<div dir="ltr" align="left"><span>&nbsp;&nbsp;&nbsp; <font face="Arial"><font color="#0000ff" size="2">not Codes ( codes contains $isc ) from 
valDao.getValidItemStatusCodesForUser($u)</font></font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">then</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">&nbsp;&nbsp;&nbsp; //Do something</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">end</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Rule &quot;Rule 3&quot;</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">when</font></span></div>
<div dir="ltr" align="left"><span>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff" face="Arial" size="2">$u : User( )</font></span></div>
<div dir="ltr" align="left"><span>&nbsp;&nbsp;&nbsp;&nbsp;<font face="Arial"><font color="#0000ff" size="2">$ni : NewItem( itemStatusCode == ItemVO.DELETED 
)</font></font></span></div>
<div dir="ltr" align="left"><span>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff" face="Arial" size="2">Codes ( codes contains $isc ) 
from&nbsp;valDao.getValidCrossReferencePrimeCodesForUser($u)</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">then</font></span></div>
<div dir="ltr" align="left"><span>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff" face="Arial" size="2">//Do something</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">end</font></span></div>
<div dir="ltr" align="left"><span></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">I&#39;ve posted&nbsp;to the news group so everyone can 
contribute&nbsp; - don&#39;t be shy ;-)</font>&nbsp;&nbsp;&nbsp;</span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">With kind regards,</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Mike</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left">
<hr>
</div>
<div dir="ltr" align="left"><font face="Tahoma" size="2"><b>From:</b> Sanjay Singh - 
s0singh [mailto:<a href="mailto:Sanjay.Singh@wal-mart.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Sanjay.Singh@wal-mart.com</a>] <br><b>Sent:</b> 26 March 2007 
14:24<br><b>To:</b> Anstis, Michael (M.)<br><b>Subject:</b> 
Hi.<br></font><br></div>
<blockquote dir="ltr" style="margin-right: 0px;">
  <div></div>
  <p><font face="Courier New" size="2">Hey Mike ... I am sorry to bother you but 
  you seemed to be pretty good with rules and i just could not think of anyone 
  else to ask abt it ... I am sorry if i am taking much of your time .. Here is 
  my problem if you can have a quick look .. </font></p>
  <p><font face="Courier New" size="2">Look at this code once .. its very easy but 
  it involves tons of if else blocks conditions .. </font></p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New" size="2">if( 
  newItem.getItemStatusCode() == null){</font> 
  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New" size="2">//do something</font> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New" size="2">}</font> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New" size="2">else{</font> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b> <font color="#ff0000" face="Courier New" size="2">if( 
  !valDao.isValidItemStatus(newItem.getItemStatusCode(),user) ){</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#ff0000" face="Courier New" size="2">//do something</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#ff0000" face="Courier New" size="2">}</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#ff0000" face="Courier New" size="2">if( 
  newItem.getItemStatusCode().equals(ItemVo.DELETED)||getItemStatusCode().equals(ItemVo.INACTIVE) 
  ){</font></b></p>
  <p><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000ff" face="Courier New" size="2">if( 
  valDao.isCrossReferencePrime(newItem.getItemNbr(),user)){</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000ff" face="Courier New" size="2">//do something</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000ff" face="Courier New" size="2">}</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000ff" face="Courier New" size="2">else if( 
  valDao.isFutrCrossReferencePrimeOrSecond(newItem.getItemNbr(),user) 
  ){</font></b> <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000ff" face="Courier New" size="2">//do something</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000ff" face="Courier New" size="2">}</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000ff" face="Courier New" size="2">else if( 
  valDao.isComponentLink(newItem.getItemNbr(),user)){</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000ff" face="Courier New" size="2">//do something</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000ff" face="Courier New" size="2">}</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000ff" face="Courier New" size="2">else if( 
  valDao.hasWhseOnHandsOrOnOrders(newItem.getItemNbr(),user)&amp;&amp;CountryCode().equals(&quot;CA&quot;) 
  ){</font></b></p>
  <p><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000ff" face="Courier New" size="2">//do something</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000ff" face="Courier New" size="2">}</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#ff0000" face="Courier New" size="2">}</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#ff0000" face="Courier New" size="2">else{</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#800000" face="Courier New" size="2">if( 
  valDao.isUnlikeAsstParentWithNonActiveChildren(newItemNbr,user) ){</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#800000" face="Courier New" size="2">//do something;</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#800000" face="Courier New" size="2">}else if 
  (isLikeAssortmentBaby(newItemNbr,user)&amp;&amp;!alDao.isLikeAsstParentActive(newItemNbr, 
  user)){</font></b></p>
  <p><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#800000" face="Courier New" size="2">//do something&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  </font></b><br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#800000" face="Courier New" size="2">}else{</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#800000" face="Courier New" size="2">//do something</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#800000" face="Courier New" size="2">}</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#800000" face="Courier New" size="2">}</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#ff0000" face="Courier New" size="2">}</font></b> 
  <br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b> <font face="Courier New" size="2">}</font><b> </b></p><br><br>
  <p><font face="Courier New" size="2">What i am trying to understand is the right 
  way of putting it in drl files .. </font><br><font face="Courier New" size="2">1.What are the options for putting if else conditions ? Will i have to 
  write all the rules anyway and they will be called as well all the time 
  depending on the criteria ... or is there a way where when my first if check 
  which was if item number is null failed i should not go for any other rules .. 
  Is there a way where we could have like &quot;when&quot; inside &quot;when&quot; .. kinda looping 
  of conditions so if one does not meet you dont go to the next .. jsut like in 
  above blocks ? Whats the good way of doing it ?</font></p>
  <p><font face="Courier New" size="2">2.Is it possible to make database calls 
  like from my dao instance in LHS (condition) .. i know we can do it in RHS and 
  i have tested that as well but can we do it in LHS as sometimes we need to do 
  that ..like with null checks for the item status code we also want to check 
  something from the database like a boolean value and if that meets the 
  criteria we will run the rules ..as u can see above we have basic state check 
  with nulls etc plus we have some dao calls as well in the condition part and 
  then we //do something</font></p>
  <p><font face="Courier New" size="2">3.Can i call rules within other rules .. so 
  something like in rule1 i want to call rule2 .. is that possible ?</font> </p>
  <p><font face="Courier New" size="2">Can you suggest a decent way of doing these 
  if else blocks .. this is the core stuff which we do for our rules here .. if 
  i can handle this kind of conditions i guess i can handle anything out here 
  ... </font></p>
  <p><font face="Courier New" size="2">Thanks for all the help ..</font> </p>
  <p><font face="Courier New" size="2">Sanjay</font> </p><br><br><br><br>
  <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><p></p></blockquote></div></span></div>
<br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org
</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
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" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.jboss.com</a>
</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>