1

1) I have setup a small program inserting a event to my key session running in STREAM mode. I have created a timer rule causing halt() after 5 seconds. Running this program with fireUntilHalt() and printing kieSession.getFactCount() shows me that there are still 1 fact in the working memory.

2) Next i declare the event with @expires(4s) and run the program again this time there is no facts left in the working memory as expected.

3) Next i created a rule using the temporal condition that no other events has been inserted within 2 seconds causing the rule to retract the event. Again as expected there 0 facts in the working memory as expected.

4) Next i created a rule inserting an event 1 second after the first event. This time only one is retracted because the second event is within 2 seconds of the first one, but Memory Management apparently retracts the first event because it can no longer match any rule due to its temporal constraints. Again there are 0 facts left in the working memory.

One of the benefits of running the engine in STREAM mode is that the engine can detect when an event can no longer match any rule due to its temporal c onstraints. When that happens, the engine can safely delete the event from the session without side effects and release any resources used by that event.

Through out these 4 tests i added an eventListener(), reporting insertions and retractions and i also set up a logger for the audit view in eclipse.

My question is: Why does both the eventListener() and the Audit view not report when a fact is expired or handled by the Memory Management system.

1) In the first test obviously nothing was retracted thus the reports are concise.

2) The second test did not report any retraction, but 0 facts was left in working memory although one fact was inserted.

3) The third test reported a retraction, thus the report are concise.

4) The fourth test reported a retraction but 2 facts was actually "retracted" thus the report was in-concise.

Does another solution exist to report expired facts and memory management actions??

jastjoe
  • 11
  • 5

0 Answers0