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