Default rule to retract remaining facts in session memory ?

81 views
Skip to first unread message

snow crash

unread,
Feb 9, 2014, 5:04:18 AM2/9/14
to no...@googlegroups.com
Hello,

While playing with sessions, I saw that due to my poor rule design, a lot of facts remains in the session memory.

So I wonder how to design a cleaning rule that may retract any fact after having passed thru the other rules (if makes sense).

The only method I found if to define a cleaning rule with the lowest salience and an "always true" rule but looks crappy...

rule RemoveUseless {
    salience: 1;
    when {
        m : Measurement m.measurementId > 0;
    }
    then {
        retract(m);
    }    
}

 
Any good practice ?

Thanks !

matt
Reply all
Reply to author
Forward
0 new messages