The number of "<u><i>pairs </i></u>of events A, B in the last 5 seconds" (according<br>to your first post) is not what you have formulated in your rule "Raise alarm".<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'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"><<a href="mailto:gboro54@gmail.com" target="_blank">gboro54@gmail.com</a>></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'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>
> On 03/10/2012, gboro54 &lt;<br>
<br>
> gboro54@<br>
<br>
> &gt; wrote:<br>
>> Doesn't accumulate have a count by itself? I guess I am trying to figure<br>
>> out<br>
>> if it is possible to do something like:<br>
><br>
> Possibly, but that's not what you were asking for in your first post.<br>
><br>
>><br>
>> rule "Raise alarm"<br>
>> when<br>
>> Number( intValue> 5) from<br>
>> accumulate( $a:EventA( $id:id )<br>
>> EventB(eventAId=$id, this after [0s,5s] $a);<br>
>> count($a) )<br>
>> then<br>
>> //do stuff<br>
>> end<br>
>><br>
>><br>
>> laune wrote<br>
>>> An accumulate with explicitly coded init/action/result lets you<br>
>>> accumulate<br>
>>> into<br>
>>> a custom object that provides exactly the information you want: just<br>
>>> that there is a matching number of As and Bs, the counts for As and<br>
>>> Bs, two lists with As and Bs - anything.<br>
>>><br>
>>> See the Expert doc - there's an example for this sort of thing.<br>
>>><br>
>>> -W<br>
>>><br>
>>> On 03/10/2012, gboro54 &lt;<br>
>><br>
>>> gboro54@<br>
>><br>
>>> &gt; wrote:<br>
>>>> We are using expert and fusion to monitor connection events in our<br>
>>>> system.<br>
>>>> We<br>
>>>> would like to know the most efficient way to know that X number pair of<br>
>>>> events have happened in a certain example(i.e eventA and eventB<br>
>>>> occurred<br>
>>>> 4<br>
>>>> times each in the 5 seconds). What is the most efficient way to do<br>
>>>> this?<br>
>>>><br>
>>>> I<br>
>>>> don't believe an accumulate would allow a combination of objects but I<br>
>>>> may<br>
>>>> be wrong. Perhaps a live query invoked by a rule?<br>
>>>><br>
>>>><br>
>>>><br>
>>>> --<br>
>>>> View this message in context:<br>
>>>> <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>
>>>> Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
>>>> _______________________________________________<br>
>>>> rules-users mailing list<br>
>>>><br>
>><br>
>>> rules-users@.jboss<br>
>><br>
>>>> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
>>>><br>
>>> _______________________________________________<br>
>>> rules-users mailing list<br>
>><br>
>>> rules-users@.jboss<br>
>><br>
>>> <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:<br>
>> <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>
>> Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
>> _______________________________________________<br>
>> rules-users mailing list<br>
>><br>
<br>
> rules-users@.jboss<br>
<br>
>> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
>><br>
> _______________________________________________<br>
> rules-users mailing list<br>
<br>
> rules-users@.jboss<br>
<br>
> <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>