<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3132" name=GENERATOR>
<STYLE>@font-face {
        font-family: Wingdings;
}
@font-face {
        font-family: Verdana;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: blue; TEXT-DECORATION: underline
}
P {
        FONT-SIZE: 12pt; MARGIN-LEFT: 0in; MARGIN-RIGHT: 0in; FONT-FAMILY: "Times New Roman"; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
SPAN.EmailStyle21 {
        FONT-WEIGHT: normal; COLOR: blue; FONT-STYLE: normal; FONT-FAMILY: Verdana; TEXT-DECORATION: none; mso-style-type: personal-reply
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=blue link=blue>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=786440412-03102007>I forgot to mention, this assumes you want to maintain 
the relationships. If you're not interested in these but merely want to process 
all NameValue objects then a simple rule works fine:-</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=786440412-03102007></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff size=2><SPAN 
class=786440412-03102007>rule "don't worry about preserving 
relationships"</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff size=2><SPAN 
class=786440412-03102007>&nbsp;&nbsp;&nbsp; when</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff size=2><SPAN 
class=786440412-03102007>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $n : 
NameValue ( )</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff size=2><SPAN 
class=786440412-03102007>&nbsp;&nbsp;&nbsp; then</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff size=2><SPAN 
class=786440412-03102007>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
...</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff size=2><SPAN 
class=786440412-03102007>end</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=786440412-03102007></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=786440412-03102007>Simply assert all NameValue 
objects.</SPAN></FONT></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> Anstis, Michael (M.) <BR><B>Sent:</B> 03 
  October 2007 12:48<BR><B>To:</B> 'Rules Users List'<BR><B>Subject:</B> RE: 
  [rules-users] Arrays help<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT face=Arial 
  color=#0000ff size=2>There are a number of ways...</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT face=Arial 
  color=#0000ff size=2><STRONG><EM>Java&nbsp;dialect [requires LineItem, 
  Parameter and NameValue to be asserted into working 
  memory]</EM></STRONG></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New" color=#0000ff size=2>rule "a - requires object model change 
  for parent property"</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp; <FONT color=#0000ff 
  size=2>when</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  color=#0000ff size=2>$l : LineItem( )</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  color=#0000ff size=2>$p : Parameter ( parent == $l 
)</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  color=#0000ff size=2>$n : NameValue( parent == $p )</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp; <FONT color=#0000ff 
  size=2>then</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  color=#0000ff size=2>...</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New" color=#0000ff size=2>end</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New" color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New" color=#0000ff size=2>rule "b"</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp; <FONT color=#0000ff 
  size=2>when</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  color=#0000ff size=2>$n : NameValue(&nbsp;)</FONT></FONT></SPAN></DIV><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  color=#0000ff size=2>$p : Parameter (&nbsp;nameValues contains 
  $n&nbsp;)</FONT></FONT></SPAN></DIV><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  color=#0000ff size=2>$l : LineItem( parameters contains 
  $p&nbsp;)</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp; <FONT color=#0000ff 
  size=2>then</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  color=#0000ff size=2>...</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New" color=#0000ff size=2>end</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT face=Arial 
  color=#0000ff size=2><STRONG><EM>MVEL 
dialect</EM></STRONG></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New" color=#0000ff size=2>rule "c"</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp; <FONT color=#0000ff size=2>dialect 
  mvel</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp; <FONT color=#0000ff 
  size=2>when</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  color=#0000ff size=2>$n : 
  my-mvel-syntax-lets-me-down-but-I-know-you-can-traverse-object-graphs-using-it</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp; <FONT color=#0000ff 
  size=2>then</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  color=#0000ff size=2>...</FONT></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT 
  face="Courier New" color=#0000ff size=2>end</FONT></SPAN></DIV></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=852174311-03102007><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV><FONT face=Arial color=#0000ff 
  size=2></FONT><FONT face=Arial color=#0000ff size=2></FONT><FONT face=Arial 
  color=#0000ff size=2></FONT><BR>
  <BLOCKQUOTE 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>Bhattacharya, Sougata<BR><B>Sent:</B> 03 October 2007 
    12:37<BR><B>To:</B> Rules Users List<BR><B>Subject:</B> [rules-users] Arrays 
    help<BR></FONT><BR></DIV>
    <DIV></DIV>
    <DIV class=Section1>
    <P class=MsoNormal><FONT face=Verdana color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana">Hi 
    All,<o:p></o:p></SPAN></FONT></P>
    <P class=MsoNormal><FONT face=Verdana color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana">&nbsp; I have a 
    object graph like this<o:p></o:p></SPAN></FONT></P>
    <P class=MsoNormal><FONT face=Verdana color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana">LineItem has 
    array of Parameter and each Parameter has array of &nbsp;NameValue and 
    Namevalue object has name and value.<o:p></o:p></SPAN></FONT></P>
    <P class=MsoNormal><FONT face=Verdana color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana">Now I have 
    LineItem object in working memory, how to test the value of each value of 
    NameValue object.<o:p></o:p></SPAN></FONT></P>
    <P class=MsoNormal><FONT face=Verdana color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana"><o:p>&nbsp;</o:p></SPAN></FONT></P>
    <P class=MsoNormal><FONT face=Verdana color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana">LineItem</SPAN></FONT><FONT 
    face=Wingdings color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Wingdings">&agrave;</SPAN></FONT><FONT 
    face=Verdana color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana">getParameters() 
    returns Parameter[]<o:p></o:p></SPAN></FONT></P>
    <P class=MsoNormal><FONT face=Verdana color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana">Parameter-&gt;getNameValueArray() 
    return NameValue[]<o:p></o:p></SPAN></FONT></P>
    <P class=MsoNormal><FONT face=Verdana color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana">Each NameValue 
    has name and value attribute<o:p></o:p></SPAN></FONT></P>
    <P class=MsoNormal><FONT face=Verdana color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana">Any 
    help?<o:p></o:p></SPAN></FONT></P>
    <P class=MsoNormal><FONT face=Verdana color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana"><o:p>&nbsp;</o:p></SPAN></FONT></P>
    <P class=MsoNormal><FONT face=Verdana color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana">Ta<o:p></o:p></SPAN></FONT></P>
    <P class=MsoNormal><FONT face=Verdana color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana">Sougata<o:p></o:p></SPAN></FONT></P></DIV>
    <TABLE>
      <TBODY>
      <TR>
        <TD bgColor=#ffffff><FONT color=#000000>This message contains 
          information that may be privileged or confidential and is the property 
          of the Capgemini Group. It is intended only for the person to whom it 
          is addressed. If you are not the intended recipient, you are not 
          authorized to read, print, retain, copy, disseminate, distribute, or 
          use this message or any part thereof. If you receive this message in 
          error, please notify the sender immediately and delete all copies of 
          this 
message.<BR><BR></FONT></TD></TR></TBODY></TABLE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>