[rules-users] Matching consecutive events

Wolfgang Laun wolfgang.laun at gmail.com
Thu Aug 2 17:22:33 EDT 2012


See below.

On 01/08/2012, jpullmann <jaroslav.pullmann at fit.fraunhofer.de> wrote:
> Dear contributors,
>
>   this rule is expected to match a sequence of 2 consecutive events:
>
> rule "test"		
>     when
>         // a)
>        	$ev1 : LocalizationEvent( type == TYPE.HINT,  $target : target  )
> from entry-point "events/localization"       	
>        	$ev2 : LocalizationEvent( type == TYPE.HINT, target == $target,
> this
> after $ev1 ) from entry-point "events/localization"
>        	// b)
>         // Ev1 directly followed by ev2: no other HINT in between
>        	not( LocalizationEvent( type == TYPE.HINT, target == $target, this
> after $ev1, this before $ev2 )  from entry-point "events/localization" )
>     then
>       do()
> end
>
>  The second event is interpreted as a "confirmation" of the first event (a).
>
>  No other (deviating) event is allowed between them (b). With this
> restriction
>  in place, the rule requires a sequence of 3 input events for activation,

Why do you think that three events are necessary? The "not" CE is the
negated existence quantifier - hence, there is no third event.

-W


> otherwise
>  2 events are sufficient (as expected). The events are ordered correctly
> and
> it is
>  not obvious, why a third event is needed since the interval between ev1
> and
> ev2 is
>  closed ? This leads to an unnecessary delay in rule activation.. How could
> this be
>  avoided and are there other approaches to match a concrete event sequence
> pattern ?
>
>  Many thanks
>    Jaro
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Matching-consecutive-events-tp4018980.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
>


More information about the rules-users mailing list