Scenario:
5.3.0, STREAM, fireUntilHalt() run in separate thread, AlertEvent events
inserted every 1 or two seconds.

The following rules should retract ClusterLink facts referencing the
AlertCluster that is
selected by the DissolveCluster fact. As soon as there is no such
ClusterLink any
more, the AlertCluster and the DissolveCluster facts are to be retracted:

rule "remove link to dissolved AlertCluster"
agenda-group "dissolve"
auto-focus true
when
    DissolveCluster( $cluster: cluster )
    AlertCluster( this == $cluster )
    $clusterLink: ClusterLink( $alertEvent: alertEvent, alertCluster ==
$cluster )
    AlertEvent( this == $alertEvent ) from entry-point "Cluster Stream"
then
    System.out.println( "Dissolving...!" );
    retract( $clusterLink );
end

rule "clean up after dissolving AlertCluster"
agenda-group "dissolve"
when
    $dissolveCluster: DissolveCluster( $cluster: cluster )
    $alertCluster: AlertCluster( this == $cluster )
    not ClusterLink( alertCluster == $cluster )
then
    System.out.println( "Dissolve finished." );
    retract( $alertCluster );
    retract( $dissolveCluster );
end

Does anybody see anything wrong with these rules?

The problem is that, after all ClusterLinks have been removed, the final
clean-up rule
is not executed.

Luckily, the last CE in the first rule isn't necessary. If "AlertEvent(...)
from ..."
is removed, both rules work correctly.
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to