<br>&nbsp;&nbsp; Sorry, it is not clear what you are trying to do. <br>&nbsp;&nbsp; There are a few clear mistakes in your rule:<br><br>1. You can&#39;t use the $totV variable inside the accumulate, since $totV is the &quot;result&quot; of the accumulate.
<br><br>2. You can&#39;t use variables bound inside accumulate outside of it, since accumulate is a scope delimiter ($ciNo, $ciLineNo).<br><br>3. If you want to sum values, use sum() function, but if you want to count occurrences, use the count() function.
<br><br>4. This expression is wrong: &quot;$totV &gt; 1&quot;. You must either compare something to a field or use an &quot;eval()&quot;&nbsp; (inlined or not) to evaluate arbitrary expressions.<br><br>5. I think it is simply a typo, but since the DRL is case sensitive, the java class Number must be written with capital N. &nbsp;  
<br><br>&nbsp;&nbsp; Maybe if you can explain with more common terms what rule you are trying to write, we can help more... the best I could imagine is:<br><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
rule &quot;00910 Pass XV sets&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; when</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp; $status : ValidationPassFailStatus()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; exists ValidationControl(validationNo == 910)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; CiLines( $ciNo : $ciNo, $ciLineNo : $ciLineNo, spiSecondary == &quot;X&quot; )</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp; Number( intValue &gt; 1 )</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from accumulate( $c : CiLines( ciNo == $ciNo, ciLineNo == $ciLineNo, </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&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; spiSecondary == &quot;V&quot; ), </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&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; count( $c ) )</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;then</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp; $status.pass(910);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">end</span><br style="font-family: courier new,monospace;"><br>&nbsp;&nbsp; Hope it helps.<br><br>&nbsp;&nbsp; Edson
<br><br><div><span class="gmail_quote">2007/7/27, Mike D &lt;<a href="mailto:mike.dalaker@kewill.com">mike.dalaker@kewill.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;">
<br>Newbie question again...<br><br>I&#39;m trying to get a count of V lines if I have an X.&nbsp;&nbsp;If more than 1 V line,<br>I pass...&nbsp;&nbsp;Obviously I can&#39;t have $totV on LHS, but you get my drift.&nbsp;&nbsp;What<br>is the correct syntax for this one?&nbsp;&nbsp;I&#39;ve been digging in the docs on accum,
<br>but can&#39;t find anything that fits what I&#39;m trying to do.<br><br>Thanks,<br>Mike<br><br>rule &quot;00910 Pass XV sets&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$status : ValidationPassFailStatus()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exists ValidationControl(validationNo == 910)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$totV&nbsp;&nbsp;: number()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from accumulate(CiLines($ciNo : $ciNo, $ciLineNo : ciLineNo, spiSecondary<br>== &quot;V&quot;), sum($totV))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CiLines(ciNo == $ciNo, ciLineNo == $ciLineNo, spiSecondary
<br>== &quot;X&quot;, $totV &gt; 1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$status.pass(910);<br>end<br><br><br>--<br>View this message in context: <a href="http://www.nabble.com/Accum-question-tf4157809.html#a11829193">http://www.nabble.com/Accum-question-tf4157809.html#a11829193
</a><br>Sent from the drools - user mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">
rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users">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 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>