<div dir="ltr">Variable e scope is the accumulate. You can&#39;t use it outside. But think about it for a second, when your rule is activated, variable e (if it would be possible to access it from the RHS) will have at least 6 different values. Which value do you want to use?<div>

One possible (of many) solution could be to &#39;collect&#39; all your events instead of counting them:</div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">rule &quot;Reset alarm&quot;</span><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">when</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">        a : Alarm()</span><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">        c : Set( size &gt; 5) from accumulate (</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">                e : Event( level &lt; 6) over window:time(10s) from entry-point &quot;queue&quot;,</span><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">                collectSet(e)</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">        )</span><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">then</span></div><div>        //All the Event objects matching the LHS are going to be in the set.<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">        channels[&quot;reset&quot;].send(&quot;Alarm resolved.&quot;);</span><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">end</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Regards,</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><br></div></div><div class="gmail_extra">

<br clear="all"><div><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a></div>
<br><br><div class="gmail_quote">On Tue, Nov 5, 2013 at 11:38 PM, webfrank <span dir="ltr">&lt;<a href="mailto:webfrank@tiscali.it" target="_blank">webfrank@tiscali.it</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi,<br>
   I have a rule with a &quot;from accumulate&quot; where I bind &quot;e&quot; variable to Event<br>
object. I would like to pass &quot;e&quot; to<br>
send method of channel like: channels[&quot;reset&quot;].send(e); but I got a Rule<br>
Compilation error with: &quot;e cannot be resolved&quot;. Why I cannot access variable<br>
&quot;e&quot; when defined inside from accumulate?<br>
<br>
<br>
rule &quot;Reset alarm&quot;<br>
when<br>
        a : Alarm()<br>
        c : Number( intValue &gt; 5) from accumulate (<br>
                e : Event( level &lt; 6) over window:time(10s) from entry-point &quot;queue&quot;,<br>
                count(e)<br>
        )<br>
then<br>
        channels[&quot;reset&quot;].send(&quot;Alarm resolved.&quot;);<br>
end<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/bound-variable-scope-tp4026652.html" target="_blank">http://drools.46999.n3.nabble.com/bound-variable-scope-tp4026652.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br></div>