[rules-users] Very Strange Bug: Rule fails to fire
Wolfgang Laun
wolfgang.laun at gmail.com
Sat Sep 8 07:13:38 EDT 2012
Sorry for the duplication, but this very strange bug sure needs a subject.
On 8 September 2012 13:07, Wolfgang Laun <wolfgang.laun at gmail.com> wrote:
> 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
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120908/cb840d6a/attachment.html
More information about the rules-users
mailing list