I'm attaching a small standalone java program to demonstrate this. The code
should be self explanatory. But in a nutshell, I'm feeding events into this
rule:
rule averageOverTime
when
$avg: Number() from accumulate (
MyEvent( key == 'someKey', $val : value ) over window:time( 200ms
),
average( $val ) )
then
System.out.println( "--- $avg in then clause is " + $avg );
end
I set up a loop to feed events in and I do see the rule fire and my averages
print out as I'd expect. I also set up a session listener to see if events
are automatically expired/retracted. And they are.
The trouble begins when I add this rule:
rule RetractionBreaker
when
$a : MyEvent( key == 'A' )
MyEvent( key == 'B', this after $a )
then
System.out.println( "--- just saw A followed by B" );
end
Whether or not I inject events with key 'A' or 'B', no events of any kind
are ever automatically retracted.
Why is that?
Thanks for helping me understand this!!
- Ladd
NoRetractionTest.java
<
http://drools.46999.n3.nabble.com/file/n4022716/NoRetractionTest.java>
--
View this message in context:
http://drools.46999.n3.nabble.com/Why-no-auto-retraction-after-adding-thi...
Sent from the Drools: User forum mailing list archive at
Nabble.com.