[rules-users] Accumulate a on event combinations

Wolfgang Laun wolfgang.laun at gmail.com
Wed Oct 3 13:46:48 EDT 2012


The number of "*pairs *of events A, B in the last 5 seconds" (according
to your first post)  is not what you have formulated in  your rule "Raise
alarm".
This rule (if it were possible to write in this way) appears to count
EventAs,
where there is a (== at least one) matching (same id) EventB in the next 5
seconds, without any limit into the past.

If you are sure that after an EventA there is at most one matching EventB,
it might simplify matters.

Anyway, make sure to get the requirements right, otherwise it's just
groping in the dark.

-W


On 3 October 2012 19:31, gboro54 <gboro54 at gmail.com> wrote:

> I thought it was? Perhaps I worded it wrong. I need to do something similar
> to what I stated but the accumulate doesn't want to take the syntax stated
> below. Perhaps this is not possible or I am doing something wrong?
>
>
> laune wrote
> > On 03/10/2012, gboro54 &lt;
>
> > gboro54@
>
> > &gt; wrote:
> >> Doesn't accumulate have a count by itself? I guess I am trying to figure
> >> out
> >> if it is possible to do something like:
> >
> > Possibly, but that's not what you were asking for in your first post.
> >
> >>
> >> rule "Raise alarm"
> >> when
> >>    Number( intValue> 5) from
> >>     accumulate(  $a:EventA( $id:id )
> >>                       EventB(eventAId=$id, this after [0s,5s] $a);
> >>                 count($a) )
> >> then
> >>     //do stuff
> >> end
> >>
> >>
> >> laune wrote
> >>> An accumulate with explicitly coded init/action/result lets you
> >>> accumulate
> >>> into
> >>> a custom object that provides exactly the information you want: just
> >>> that there is a matching number of As and Bs, the counts for As and
> >>> Bs, two lists with As and Bs - anything.
> >>>
> >>> See the Expert doc - there's an example for this sort of thing.
> >>>
> >>> -W
> >>>
> >>> On 03/10/2012, gboro54 &lt;
> >>
> >>> gboro54@
> >>
> >>> &gt; wrote:
> >>>> We are using expert and fusion to monitor connection events in our
> >>>> system.
> >>>> We
> >>>> would like to know the most efficient way to know that X number pair
> of
> >>>> events have happened in a certain example(i.e eventA and eventB
> >>>> occurred
> >>>> 4
> >>>> times each in the 5 seconds). What is the most efficient way to do
> >>>> this?
> >>>>
> >>>> I
> >>>> don't believe an accumulate would allow a combination of objects but I
> >>>> may
> >>>> be wrong. Perhaps a live query invoked by a rule?
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> View this message in context:
> >>>>
> http://drools.46999.n3.nabble.com/Accumulate-a-on-event-combinations-tp4020104.html
> >>>> Sent from the Drools: User forum mailing list archive at Nabble.com.
> >>>> _______________________________________________
> >>>> rules-users mailing list
> >>>>
> >>
> >>> rules-users at .jboss
> >>
> >>>> https://lists.jboss.org/mailman/listinfo/rules-users
> >>>>
> >>> _______________________________________________
> >>> rules-users mailing list
> >>
> >>> rules-users at .jboss
> >>
> >>> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://drools.46999.n3.nabble.com/Accumulate-a-on-event-combinations-tp4020104p4020107.html
> >> Sent from the Drools: User forum mailing list archive at Nabble.com.
> >> _______________________________________________
> >> rules-users mailing list
> >>
>
> > rules-users at .jboss
>
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> > _______________________________________________
> > rules-users mailing list
>
> > rules-users at .jboss
>
> > https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Accumulate-a-on-event-combinations-tp4020104p4020114.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20121003/2bbef61c/attachment.html 


More information about the rules-users mailing list