<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" 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><!--[if !mso]>
<STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
        font-family: Wingdings;
}
@font-face {
        font-family: Tahoma;
}
@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.EmailStyle18 {
        FONT-WEIGHT: normal; COLOR: blue; FONT-STYLE: normal; FONT-FAMILY: Verdana; TEXT-DECORATION: none; mso-style-type: personal
}
SPAN.EmailStyle19 {
        FONT-WEIGHT: normal; COLOR: blue; FONT-STYLE: normal; FONT-FAMILY: Verdana; TEXT-DECORATION: none; mso-style-type: personal
}
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><SPAN class=843333313-03102007><FONT face=Arial
color=#0000ff size=2>If you can't insert the NameValue objects at all because
you are using somebody else's code to setup the initial facts you can use
another rule to do this for you:-</FONT></SPAN><SPAN
class=843333313-03102007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT face="Courier New"
color=#0000ff size=2>rule "insert NameValues"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT
face="Courier New"> <FONT color=#0000ff size=2>salience
-100</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT
face="Courier New"> <FONT color=#0000ff
size=2>when</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT
face="Courier New"> <FONT
color=#0000ff size=2>$l : LineItem( )</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT
face="Courier New"> <FONT color=#0000ff
size=2>then</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT
face="Courier New"> <FONT
color=#0000ff size=2>for(int i = 0, NameValue[] nvs = $l.getNameValueArray(); i
< nvs.length; i++) {</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT
face="Courier New">
<FONT color=#0000ff size=2>insert(nvs[i]);</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT
face="Courier New"> <FONT
color=#0000ff size=2>}</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT
face="Courier New"><FONT color=#0000ff size=2>end</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT face="Courier New"
color=#0000ff size=2>rule "process NameValues"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT
face="Courier New"> <FONT color=#0000ff size=2>salience
-90</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT
face="Courier New"> <FONT color=#0000ff
size=2>when</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT
face="Courier New"><SPAN class=843333313-03102007><FONT
face="Courier New"> </FONT></SPAN><FONT
color=#0000ff size=2>$nv : NameValue( )</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT
face="Courier New"> <FONT color=#0000ff
size=2>then</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT face="Courier New"
color=#0000ff size=2>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT
face="Courier New"><SPAN class=843333313-03102007><FONT face="Courier New"><SPAN
class=843333313-03102007><FONT
face="Courier New">
</FONT></SPAN></FONT></SPAN><FONT color=#0000ff
size=2>...</FONT></FONT></SPAN></DIV></FONT></SPAN><SPAN
class=843333313-03102007><FONT face="Courier New"><FONT color=#0000ff
size=2>end</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT face=Arial
color=#0000ff size=2>Depending on what you want to do with NameValue (i.e.
simply count them or apply a function to a value) you could try looking at
"collect" or "accumulate" but I doubt this is what you are
after.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=843333313-03102007><FONT face=Arial
color=#0000ff size=2>Lastly you can always iterate over them in the RHS of a
rule - but without inserting them into working memory you'll never be able
to write rules to handle them.</FONT></SPAN></SPAN></DIV></DIV>
<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 14:26<BR><B>To:</B> Rules Users
List<BR><B>Subject:</B> RE: [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">Your assumption is
correct, but how do I iterate throw the array<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> </o:p></SPAN></FONT></P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <B><SPAN
style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Anstis, Michael
(M.)<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Wednesday, October
03, 2007 6:52 PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Rules
Users List<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE:
[rules-users] Arrays help</SPAN></FONT><o:p></o:p></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Do you mean you
cannot insert NameValue facts into working
memory?</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">If this is the case,
then you might have to use eval or MVEL dialect. Based upon your model below I
assumed you could insert NameValues:-</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <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</SPAN></FONT><FONT
face=Wingdings color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Wingdings">à</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->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>
<BLOCKQUOTE style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt; MARGIN-RIGHT: 0in">
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><B><FONT face=Tahoma
size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <B><SPAN
style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Bhattacharya,
Sougata<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> 03 October
2007 13:23<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Rules Users
List<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE:
[rules-users] Arrays help</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Verdana color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana">Yes that’s the
simple one, but I can’t send the NameValue, I will send only the
LineItem<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> </o:p></SPAN></FONT></P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <B><SPAN
style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Anstis, Michael
(M.)<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Wednesday,
October 03, 2007 5:36 PM<BR><B><SPAN
style="FONT-WEIGHT: bold">To:</SPAN></B> Rules Users List<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [rules-users] Arrays
help</SPAN></FONT><o:p></o:p></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">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><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">rule "don't
worry about preserving relationships"</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">
when</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">
$n : NameValue ( )</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">
then</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">
.....</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">end</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Simply assert all
NameValue objects.</SPAN></FONT><o:p></o:p></P>
<BLOCKQUOTE
style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt; MARGIN-RIGHT: 0in"><P
class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><B><FONT face=Tahoma
size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
Anstis, Michael (M.) <BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> 03 October 2007
12:48<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> 'Rules Users
List'<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE:
[rules-users] Arrays help</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">There are a
number of ways...</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><EM><B><I><FONT face=Arial color=blue size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Java dialect
[requires LineItem, Parameter and NameValue to be asserted into working
memory]</SPAN></FONT></I></B></EM><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">rule "a -
requires object model change for parent
property"</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">when</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">$l :
LineItem( )</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">$p :
Parameter ( parent == $l )</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">$n :
NameValue( parent == $p )</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">then</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">...</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">end</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">rule
"b"</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">when</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">$n :
NameValue( )</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">$p :
Parameter ( nameValues contains
$n )</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">$l :
LineItem( parameters contains $p )</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">then</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">...</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">end</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><EM><B><I><FONT face=Arial color=blue size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">MVEL
dialect</SPAN></FONT></I></B></EM><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">rule
"c"</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">dialect
mvel</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">when</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">$n :
my-mvel-syntax-lets-me-down-but-I-know-you-can-traverse-object-graphs-using-it</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">then</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">
</SPAN></FONT><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">...</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Courier New" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">end</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<BLOCKQUOTE
style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt; MARGIN-RIGHT: 0in">
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><B><FONT face=Tahoma
size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <B><SPAN
style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Bhattacharya,
Sougata<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> 03
October 2007 12:37<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B>
Rules Users List<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> [rules-users] Arrays
help</SPAN></FONT><o:p></o:p></P>
<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"> 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 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> </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">à</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->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> </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>
<TABLE class=MsoNormalTable cellPadding=0 border=0>
<TBODY>
<TR>
<TD
style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; BACKGROUND: white; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"
bgColor=white>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><FONT
face="Times New Roman" color=black size=3><SPAN
style="FONT-SIZE: 12pt; COLOR: black">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.</SPAN></FONT><o:p></o:p></P></TD></TR></TBODY></TABLE>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></BLOCKQUOTE></BLOCKQUOTE>
<TABLE class=MsoNormalTable cellPadding=0 border=0>
<TBODY>
<TR>
<TD
style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; BACKGROUND: white; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"
bgColor=white>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><FONT
face="Times New Roman" color=black size=3><SPAN
style="FONT-SIZE: 12pt; COLOR: black">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.</SPAN></FONT><o:p></o:p></P></TD></TR></TBODY></TABLE>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></BLOCKQUOTE></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></BODY></HTML>