Re: [rules-users] Guvnor Declarative Model
How can you declare your facts (or rules) if you don't know beforehand the structure of the POJO to use ? ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Very Strange Bug: Rule fails to fire
Sorry for the duplication, but this very strange bug sure needs a subject. On 8 September 2012 13:07, Wolfgang Laun 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@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > > ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] (no subject)
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@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] [Fusion 5.4.0] Condition evaluation broken
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. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users