There is an issue in Apache JIRA: https://issues.apache.org/jira/browse/FLINK-3703. It allows defining where the matching algorithm should continue after a matching sequence has been found and there are three types of behavior:
from first- continue keeping all events for future matches (that is the current behavior)after first- continue after the first element (remove first matching event and continue with the second event)after last- continue after the last element (effectively discarding all elements of the matching sequence)
For example, if we have a sequence of events: A, B, C and pattern first -> second we'll get next results:
from first-A -> B,A -> C,B -> Cafter first-A -> B,B -> Cafter last-A -> B
Now the issue is closed with a comment that all of that implemented in other tasks:
This was covered by other issues including the Quantifier implementation, the skip-till-next and some additional issues for continuity within looping patterns.
So, could somebody tell me how to implement defined kinds of behavior using current API of the Flink CEP library?