The number of &quot;<u><i>pairs </i></u>of events A, B in the last 5 seconds&quot; (according<br>to your first post)  is not what you have formulated in  your rule &quot;Raise alarm&quot;.<br>This rule (if it were possible to write in this way) appears to count EventAs, <br>
where there is a (== at least one) matching (same id) EventB in the next 5<br>seconds, without any limit into the past. <br><br>If you are sure that after an EventA there is at most one matching EventB,<br>it might simplify matters.<br>
<br>Anyway, make sure to get the requirements right, otherwise it&#39;s just <br>groping in the dark.<br><br>-W<br><br><br><div class="gmail_quote">On 3 October 2012 19:31, gboro54 <span dir="ltr">&lt;<a href="mailto:gboro54@gmail.com" target="_blank">gboro54@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I thought it was? Perhaps I worded it wrong. I need to do something similar<br>
to what I stated but the accumulate doesn&#39;t want to take the syntax stated<br>
below. Perhaps this is not possible or I am doing something wrong?<br>
<br>
<br>
laune wrote<br>
&gt; On 03/10/2012, gboro54 &amp;lt;<br>
<br>
&gt; gboro54@<br>
<br>
&gt; &amp;gt; wrote:<br>
&gt;&gt; Doesn&#39;t accumulate have a count by itself? I guess I am trying to figure<br>
&gt;&gt; out<br>
&gt;&gt; if it is possible to do something like:<br>
&gt;<br>
&gt; Possibly, but that&#39;s not what you were asking for in your first post.<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; rule &quot;Raise alarm&quot;<br>
&gt;&gt; when<br>
&gt;&gt;    Number( intValue&gt; 5) from<br>
&gt;&gt;     accumulate(  $a:EventA( $id:id )<br>
&gt;&gt;                       EventB(eventAId=$id, this after [0s,5s] $a);<br>
&gt;&gt;                 count($a) )<br>
&gt;&gt; then<br>
&gt;&gt;     //do stuff<br>
&gt;&gt; end<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; laune wrote<br>
&gt;&gt;&gt; An accumulate with explicitly coded init/action/result lets you<br>
&gt;&gt;&gt; accumulate<br>
&gt;&gt;&gt; into<br>
&gt;&gt;&gt; a custom object that provides exactly the information you want: just<br>
&gt;&gt;&gt; that there is a matching number of As and Bs, the counts for As and<br>
&gt;&gt;&gt; Bs, two lists with As and Bs - anything.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; See the Expert doc - there&#39;s an example for this sort of thing.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; -W<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On 03/10/2012, gboro54 &amp;lt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; gboro54@<br>
&gt;&gt;<br>
&gt;&gt;&gt; &amp;gt; wrote:<br>
&gt;&gt;&gt;&gt; We are using expert and fusion to monitor connection events in our<br>
&gt;&gt;&gt;&gt; system.<br>
&gt;&gt;&gt;&gt; We<br>
&gt;&gt;&gt;&gt; would like to know the most efficient way to know that X number pair of<br>
&gt;&gt;&gt;&gt; events have happened in a certain example(i.e eventA and eventB<br>
&gt;&gt;&gt;&gt; occurred<br>
&gt;&gt;&gt;&gt; 4<br>
&gt;&gt;&gt;&gt; times each in the 5 seconds). What is the most efficient way to do<br>
&gt;&gt;&gt;&gt; this?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I<br>
&gt;&gt;&gt;&gt; don&#39;t believe an accumulate would allow a combination of objects but I<br>
&gt;&gt;&gt;&gt; may<br>
&gt;&gt;&gt;&gt; be wrong. Perhaps a live query invoked by a rule?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt; View this message in context:<br>
&gt;&gt;&gt;&gt; <a href="http://drools.46999.n3.nabble.com/Accumulate-a-on-event-combinations-tp4020104.html" target="_blank">http://drools.46999.n3.nabble.com/Accumulate-a-on-event-combinations-tp4020104.html</a><br>
&gt;&gt;&gt;&gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; rules-users mailing list<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; rules-users@.jboss<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; rules-users mailing list<br>
&gt;&gt;<br>
&gt;&gt;&gt; rules-users@.jboss<br>
&gt;&gt;<br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <a href="http://drools.46999.n3.nabble.com/Accumulate-a-on-event-combinations-tp4020104p4020107.html" target="_blank">http://drools.46999.n3.nabble.com/Accumulate-a-on-event-combinations-tp4020104p4020107.html</a><br>

&gt;&gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt;<br>
<br>
&gt; rules-users@.jboss<br>
<br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
<br>
&gt; rules-users@.jboss<br>
<br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Accumulate-a-on-event-combinations-tp4020104p4020114.html" target="_blank">http://drools.46999.n3.nabble.com/Accumulate-a-on-event-combinations-tp4020104p4020114.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>