How to cache load a reference concept using its parent concept
book
Article ID: KB0083695
calendar_today
Updated On:
Products
Versions
TIBCO BusinessEvents Enterprise Edition
-
Description
Assume we have concept(A) and that one of it's properties is a concept reference to concept B. Let's say we cache load the concept function in a preprocessor to load concept A. If concept A exists in the cache and gets loaded, does concept B also get loaded? If not how do we load the reference concepts.
Environment
All Supported Environment
Resolution
When a parent concept is cache loaded, the referenced concept is returned as read-only reference data. Its value could be read and accessed using the following catalog functions:
Instance.PropertyAtom.getConceptReference() which returns the value of the PropertyAtomConceptReference Instance.PropertyArray.toArrayConcept() which returns a Concept[] containing all of the instances in a PropertyArrayConcept
The concept itself is not asserted into the rete network. If you have any rules dependent upon this concept, the rules will not be evaluated and triggered until the concept is loaded from cache and asserted into the rete network. To cache load the reference concept after you get the parent concept: assume "a" is the cacheloaded parent concept and its property refB is referred to Concept B:
long ct = DateTime.getTimeInMillis(DateTime.now());
Concept o = Instance.PropertyAtom.getConceptReference(a.refB, ct);
Cluster.DataGrid.CacheLoadConceptByExtId(o@extId, true);
Issue/Introduction
I have a concept(A) that has one of it's properties is a concept reference to concept B. Let's say that I always use a cache load concept function in a preprocessor to load concept A. If concept A exists in the cache and gets loaded, does concept B also get loaded?