[rules-users] (no subject)

Wolfgang Laun wolfgang.laun at gmail.com
Sat Sep 8 07:07:57 EDT 2012


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120908/9e16a219/attachment.html 


More information about the rules-users mailing list