Rule Match deduplication

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Rule Match deduplication

michal.antolik
Hello,

 I have a temporal pattern like

*A after B*

and a stream as

*A1,B1,B2,B3,B4,B5,A2,B6*

and if I define a pattern simply as
$a: Event()
$b: Event(this after $a)

I'll get matches like (A1,B1),(A1,B2),(A1,B3),(A1,B4),...

However I care about first match only and then I want to reset the pattern so the next one would be (A2,B6).

Can you please advice how to achieve that? I don't want to do the deduplication by myself and most importantly I could achieve much better performance if I could expire partial matches (I cannot expire event since it might be used by other patterns)

Thanks a lot for help.
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Rule Match deduplication

laune
The condition for "some A and only the immediate successor of type B" must be written as
$a: EventA()
$b: EventB( this after $a )
not EventB( this after $a, this before $b )

-W

On 6 November 2012 01:58, michal.antolik <[hidden email]> wrote:
Hello,

 I have a temporal pattern like

*A after B*

and a stream as

*A1,B1,B2,B3,B4,B5,A2,B6*

and if I define a pattern simply as
$a: Event()
$b: Event(this after $a)

I'll get matches like (A1,B1),(A1,B2),(A1,B3),(A1,B4),...

However I care about first match only and then I want to reset the pattern
so the next one would be (A2,B6).

Can you please advice how to achieve that? I don't want to do the
deduplication by myself and most importantly I could achieve much better
performance if I could expire partial matches (I cannot expire event since
it might be used by other patterns)

Thanks a lot for help.



--
View this message in context: http://drools.46999.n3.nabble.com/Rule-Match-deduplication-tp4020717.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users


_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Rule Match deduplication

michal.antolik
Thanks laune, that helped.

michal