Drools rule for spikes in heart rate
<p>I only recently started with drools and I need to process heart rate data. I need to create a a rule in drools fusion that fires when there are 3 or more spikes in the heart rate data of 60 or more then the average over the last hour. The picture below is an example what I like to discover in the heart rate.</p>

<p><a href="https://i.stack.imgur.com/IPGJd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IPGJd.png" alt="enter image description here"></a></p>

<p>My HeartRate events have the following fields:</p>

<pre><code>int heartRate;
Date timeStamp;
String macAddress;
</code></pre>

<p>I know about the the sliding time window but you can only use basic functions like min, max, avg,... . Could someone explain me how I can create this rule?</p>