[rules-users] [Fusion 5.4.0] Condition evaluation broken

Wolfgang Laun wolfgang.laun at gmail.com
Sat Sep 8 03:41:08 EDT 2012


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

The following rule should add the oldest AlertEvent that hasn't been
associated with an AlertCluster
to an AlertCluster and store the cluster reference in AlertEvent.cluster
and add an AlertEvent
reference to the cluster's list:

rule "extend AlertCluster"
when
    $alertEvent: AlertEvent( cluster == null ) from entry-point "Cluster
Stream"
    not( AlertEvent( cluster == null, this before $alertEvent ) from
entry-point "Cluster Stream" )
    $cluster: AlertCluster( eval( $cluster.closeEnough( $alertEvent ) ) )
then
    modify( $cluster ){
        addAlertEvent( $alertEvent ) // add AlertEvent to AlertCluster's
list
    }
    modify( $alertEvent ){
        setCluster( $cluster ) // store reference to containing AlertCluster
    }
end

In spite of the constraint "cluster == null" and using modify for updating
the AlertEvent, the rule
fires repeatedly. Even adding "no-loop true" does not avoid this. (A
redundant constraint
testing for the non-occurrence of the AlertEvent in the AlertCluster's List
alertEvent

The rule executes perfectly well with 5.3.0.

I'm aware of Edson's note indicating some synchronization bug in 5.4.0, but
it's hard to imagine
how a lack of synchronization can be responsible for a problem when inserts
occur at a very
low-rate.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120908/62973cab/attachment.html 


More information about the rules-users mailing list