September 2017
Beginner to intermediate
360 pages
8h 13m
English
We have created the pattern, and applied it on the data stream - now how do we get the matched events? This can be done by using the following code snippet:
class MyPatternSelectFunction<IN, OUT> implements PatternSelectFunction<IN, OUT> {@Override public OUT select(Map<String, List<IN>> pattern) { IN startEvent = pattern.get("start").get(0); IN endEvent = pattern.get("end").get(0); return new OUT(startEvent, endEvent); }}
In is the class on which the event pattern is applied. The Out class is the form of output as an action on matched events.
Read now
Unlock full access