I am trying to use Esper.
My question is about polymorphism between events.
Example (pseudocode):
I use two classes GPSEvent and PositionEvent as eventtypes. They may look like:
class GPSEvent{
double longitude
double latitude
}
and
class PositionEvent extends GPSEvent{
Date timeOfOccurence
}
If I use the Rule:
select * from GPSEvent.win:length_batch(5)
and following Events would be sent into the engine: GPSEvent g1, GPSEvent g2, GPSEvent g3, GPSEvent g4, PositionEvent p1
the rule would trigger.
My question is now how to prevent the triggering if subtype events are sent
or
how to trigger only if the eventtype is the supertype without any subtypes?
Are there any best practices without adding complexity to the rules oder use "overhead" inside of the eventtype classes?
Additional information:
I would like to route a PositionEvent into the engine out of a subscriber after detecting 5 GPSEvents