Hi Yassine,

First of all notNext(A) is not equal to next(not A). notNext should be 
considered as a “stopCondition” which tells if an event matching the A 
condition occurs the current partial match is discarded. The next(not A) on the 
other hand accepts every event that do not match the A condition.

So let’s analyze a sequence of events like “b c a1 a2 a3 d”. For the first 
version with next(not A) the output will be “c a1 a2 a3 d” which is what you 
expect, I think. In the other version with notNext(A) a partial match “c a1” 
will be discarded after “a2” as the notNext says that after the A’s there 
should be no A.

I hope this helps understanding how notNext works.

Regards,
Dawid

> On 22 Jul 2017, at 20:32, Yassine MARZOUGUI <y.marzou...@mindlytix.com> wrote:
> 
> Hi all,
> 
> I would like to match the maximal consecutive sequences of events of type A 
> in a stream.
> I'm using the following :
> Pattern.begin("start").where(event is not A)
> .next("middle").where(event is A).oneOrMore().consecutive()
> .next("not").where(event is not A)
> I This give the output I want. However if I use notNext("not").where(event is 
> A) instead of next("not").where(event is not A), the middle patterns contain 
> only sequences of single elements of type A.
> My understaning is that notNext() in this case is equivalent to 
> next(negation), so why is the output different?
> 
> Thank you in advance.
> 
> Best,
> Yassine

Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to