23 Jun 2012 12:23
[rules-dev] Evil bug in 5.4.0: wrong fact selected by simple constraint due to window:length()
Wolfgang Laun <wolfgang.laun <at> gmail.com>
2012-06-23 10:23:48 GMT
2012-06-23 10:23:48 GMT
It should be pretty obvious that the rule should not fire after the
insertion of a single fact.
declare MyEvent
<at> role(event)
end
rule FaultsCoincide
when
f1 : MyEvent( key == "type1" ) over window:length( 1 )
f2 : MyEvent( key == "type2" ) over window:length( 1 )
then
System.out.println( ">>> f1=" + f1 + " f2=" + f2 );
if( f2.getKey().equals( "type1" ) ) System.out.println( "*** BUG ***" );
end
insert MyEvent<type1,ALARM>
>>> f1=MyEvent<type1,ALARM> f2=MyEvent<type1,ALARM>
*** BUG ***
insert MyEvent<type2,ALARM>
>>> f1=MyEvent<type2,ALARM> f2=MyEvent<type2,ALARM>
>>> f1=MyEvent<type2,ALARM> f2=MyEvent<type1,ALARM>
*** BUG ***
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev
RSS Feed