CEP: Different consuming strategies within a pattern

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

CEP: Different consuming strategies within a pattern

Shailesh Jain
Hi,

I'm trying to detect a sequence like A followed by B, C, D.
i.e. there is no strict contiguity between A and B, but strict contiguity between B, C and D.


testStrictFollowedByRelaxedContiguity passes, but testRelaxedFollowedByStrictContiguity fails.

I'm not able to understand this behaviour. Am I missing something here?

Thanks,
Shailesh




Reply | Threaded
Open this post in threaded view
|

Re: CEP: Different consuming strategies within a pattern

Dawid Wysakowicz-2
Hi Shailesh,

It does not emit results because "followedBy" accepts only the first
occurrence of matching event. Therefore in your case it only tries to
construct pattern with start(id=2). Try removing this event and you will
see it matches the other one.
If you want to try to construct match with any subsequent start you can
use "followedByAny", but then remember to add the within clause, as
otherwise partial matches won't be cleared.

Cheers,
Dawid

On 25/06/18 08:11, Shailesh Jain wrote:

> Hi,
>
> I'm trying to detect a sequence like A followed by B, C, D.
> i.e. there is no strict contiguity between A and B, but strict
> contiguity between B, C and D.
>
> Sample test case:
> https://gist.github.com/jainshailesh/57832683fb5137bd306e4844abd9ef86
>
> testStrictFollowedByRelaxedContiguity passes, but
> testRelaxedFollowedByStrictContiguity fails.
>
> I'm not able to understand this behaviour. Am I missing something here?
>
> Thanks,
> Shailesh
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: CEP: Different consuming strategies within a pattern

Shailesh Jain
Thanks, Dawid.

On Mon, Jun 25, 2018 at 12:48 PM, Dawid Wysakowicz <[hidden email]> wrote:
Hi Shailesh,

It does not emit results because "followedBy" accepts only the first
occurrence of matching event. Therefore in your case it only tries to
construct pattern with start(id=2). Try removing this event and you will
see it matches the other one.
If you want to try to construct match with any subsequent start you can
use "followedByAny", but then remember to add the within clause, as
otherwise partial matches won't be cleared.

Cheers,
Dawid

On 25/06/18 08:11, Shailesh Jain wrote:
> Hi,
>
> I'm trying to detect a sequence like A followed by B, C, D.
> i.e. there is no strict contiguity between A and B, but strict
> contiguity between B, C and D.
>
> Sample test case:
> https://gist.github.com/jainshailesh/57832683fb5137bd306e4844abd9ef86
>
> testStrictFollowedByRelaxedContiguity passes, but
> testRelaxedFollowedByStrictContiguity fails.
>
> I'm not able to understand this behaviour. Am I missing something here?
>
> Thanks,
> Shailesh
>
>
>
>