After each RTC, the data created in the agent is saved to the cache and removed from the Rete network. Before the next RTC, therefore, you must reload any data needed by any rules that will be triggered in the RTC. This is generally done using the event preprocessor rule function, as it is the presence of event data that triggers most rules.
What is a concept instance’s mode? Concepts can be set (globally or individually) as Memory Only, Cache Only, or Cache + Memory (cache plus memory). These modes refer to how the data is saved. Memory Only mode means the instances are not saved to the cache. See also
BusinessEvents Cache Fundamentals to understand more about cache mode.
The Coherence.C_CacheLoadConceptByExtId() function loads any matching items from the cache into the Rete network. In this case, it loads any concept whose
ExtId matches the
AccountId in the incoming event. The loading is done before the event is asserted, so the Rete network will contain any matching Account concepts. The
BadCreateAccount rule then fires and as in the
Project Design Tutorial, to prevent creation of duplicate accounts.
You have modified the basic FraudDetection project to load instances from the cache into the Rete network using an event preprocessor. This enables the project code to check for existing instances first, when creating new ones.