<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Scenario: </span><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
5.3.0, STREAM, fireUntilHalt() run in separate thread, AlertEvent events inserted every 1 or two seconds.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">The following rules should retract ClusterLink facts referencing the AlertCluster that is</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
selected by the DissolveCluster fact. As soon as there is no such ClusterLink any</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">more, the AlertCluster and the DissolveCluster facts are to be retracted:</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="background-color:rgb(255,255,255)"><div><font color="#222222" face="arial, sans-serif">rule "remove link to dissolved AlertCluster"</font></div>
<div><font color="#222222" face="arial, sans-serif">agenda-group "dissolve"</font></div><div><font color="#222222" face="arial, sans-serif">auto-focus true</font></div><div><font color="#222222" face="arial, sans-serif">when</font></div>
<div><font color="#222222" face="arial, sans-serif"> DissolveCluster( $cluster: cluster )</font></div><div><font color="#222222" face="arial, sans-serif"> AlertCluster( this == $cluster )</font></div><div><font color="#222222" face="arial, sans-serif"> $clusterLink: ClusterLink( $alertEvent: alertEvent, alertCluster == $cluster )</font></div>
<div><font color="#222222" face="arial, sans-serif"> AlertEvent( this == $alertEvent ) from entry-point "Cluster Stream"</font></div><div><font color="#222222" face="arial, sans-serif">then</font></div><div><font color="#222222" face="arial, sans-serif"> System.out.println( "Dissolving...!" );</font></div>
<div><font color="#222222" face="arial, sans-serif"> retract( $clusterLink );</font></div><div><font color="#222222" face="arial, sans-serif">end</font></div><div><font color="#222222" face="arial, sans-serif"><br></font></div>
<div><font color="#222222" face="arial, sans-serif">rule "clean up after dissolving AlertCluster"</font></div><div><font color="#222222" face="arial, sans-serif">agenda-group "dissolve"</font></div><div>
<font color="#222222" face="arial, sans-serif">when</font></div><div><font color="#222222" face="arial, sans-serif"> $dissolveCluster: DissolveCluster( $cluster: cluster )</font></div><div><font color="#222222" face="arial, sans-serif"> $alertCluster: AlertCluster( this == $cluster )</font></div>
<div><font color="#222222" face="arial, sans-serif"> not ClusterLink( alertCluster == $cluster )</font></div><div><font color="#222222" face="arial, sans-serif">then</font></div><div><font color="#222222" face="arial, sans-serif"> System.out.println( "Dissolve finished." );</font></div>
<div><font color="#222222" face="arial, sans-serif"> retract( $alertCluster );</font></div><div><font color="#222222" face="arial, sans-serif"> retract( $dissolveCluster );</font></div><div><font color="#222222" face="arial, sans-serif">end</font></div>
</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Does anybody see anything wrong with these rules? </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
The problem is that, after all ClusterLinks have been removed, the final clean-up rule</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">is not executed.</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Luckily, the last CE in the first rule isn't necessary. If "AlertEvent(...) from ..."</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">is removed, both rules work correctly.</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div>