Component: /atg/commerce/catalog/custom/AncestorGeneratorService
The AncestorGeneratorService
component generates data for various category, product and SKU relationships.
The AncestorGeneratorService
, which is automatically executed after deployment, updates the following property values for each of the catalog item types. This service should be executed after making catalog updates in order for catalog navigation and search to work correctly.
Item Type | Property Names |
---|---|
Categories |
|
Products |
|
SKUs |
|
If you have extended the Core Commerce catalog schema, you can still use AncestorGeneratorService
to generate relationship data, provided that:
The catalog includes item types that represent categories, products and SKUs (regardless of the actual names of these item types).
The item types representing categories, products and SKUs have properties for storing each of the different relationship values. Note that if the relationship property column names for products or SKUs are different than the default schema, you will need to disable database-generated relationships using the
awaysWalkTree
property or modify the stored procedures. For information on configuring your environment using theawaysWalkTree
property, refer to the AncestorGeneratorService Properties section.
Available Functions
AGS_GENCATALOGS: generates the catalogs
properties
AGS_GENPARENTCATS: generates the parentCategoriesForCatalog
property
AGS_GENANCESTORS: generates the ancestorCategories
property
AGS_GENPROPERTIES: generates all properties for all items
AGS_GENPROPERTIES_FOR_CATEGORY: generates all properties for categories
AGS_GENPROPERTIES_FOR_PRODUCT: generates all properties for categories and products
Product and SKU Relationships
Product and SKU relationships are generated on demand by the database using tables that are installed and configured by CIM. Using stored procedures, the database not only determines product and SKU relationships, but also identifies ancestry relationships and dynamic relationships.
Note: You can disable database-generated relationships using the awaysWalkTree
property. This tells CMS to obtain relationships by referencing the catalog tree. Refer to the AncestorGeneratorService Properties section for additional information on this property.
Product relationships are generated when CMS functions include at least one of the following functions:
AGS_GENPROPERTIES_FOR_PRODUCT
AGS_GENPARENTCATS
AGS_GENCATALOGS
SKU relationships are generated when CMS functions include at least one of the AGS_GENPROPERTIES or AGS_GENCATALOGS functions.
Product and SKU relationships are generated under the following conditions:
The
computedCatalogs
relationships are only generated if theupdateCatalogsProperty
flag is set totrue
.The
ancestorCatagories
relationships are only generated if the service functions include at least one AGS_GENPROPERTIES_FOR_PRODUCT, AGS_GENPROPERTIES, AGS_GENPROPERTIES_FOR_CATEGORY or AGS_GENANCESTORS function.Site relationships are only generated if the
updateSitesProperty
is set totrue
.
Cache Invalidation
When a stored procedure makes a change to a product or a SKU relationship, it stores the ID of the changed product or SKU in a database table. The AncestorGeneratorService
then runs through all the IDs in the table to invalidate the items in the cache. Note that this process does not occur when catalog or category relationships are updated, and is specific only to product and SKU relationship changes.
When working with cache invalidation, you can specify the size of the threshold, which indicates the maximum number of items to invalidate before the entire cache is invalidated. To do this, configure the cacheInvalidationThreshold
property as described in the AncestorGeneratorService Properties section.
AncestorGeneratorService-Related Schema Details
When you install Core Commerce with CIM, the following tables are installed. For information on performing an installation using CIM, refer to the Platform Installation and Configuration Guide. The create_cms_procedure.xml
file creates the stored procedures that are used by your database.
Note: Stored procedures are invoked only when the alwaysWalkTree
flag in the AncestorGeneratorService
is set to false
. Refer to the AncestorGeneratorService Properties section for additional information.
Table | Description |
---|---|
| Used for cache invalidation, these tables store the list of product or SKU IDs whose relationships have been changed. The |
| Categories can have dynamic products, which are determined by evaluating content group rules. Dynamic product children for categories are stored in this table when the |
| Contains the list of product ancestor categories. A product can be related to a number of ancestor categories. If you have set the |
| Stores products relationships to catalogs. Products can be related to a number of catalogs. If you have set the |
| Identifies the product parent category for a catalog. A product is related to a single parent category for each parent catalog. This property allows you to specifically set the parent category for a catalog. If you have set the |
| Products can be associated with a number of sites. This table identifies the sites associated with a product. If you have set the |
| A SKU can be related to a number of catalogs. The relationships between SKUs and catalogs is stored in this table. If you have set the |
| This table stores the relationships between SKUs and sites. A SKU can be related to a number of sites. If you have set the |
AncestorGeneratorService Properties
The AncestorGeneratorService
uses the following properties:
Table | Description |
---|---|
| Boolean. If set to |
| The Note: If you are using selective cache invalidation for catalog repositories, it is best to set the |
| Gets the fixed child products for a category, not including the dynamic child products, from the |
| Gets both the fixed and dynamic child products for a category from the |
| Gets the child SKUs of fixed child products for a category, not including dynamic child products, from the |
| Gets the child SKU of both fixed and dynamic child products for a category from the |
| Boolean. If set to |
| Inserts dynamic child products for a category into the |
| Truncates the |
| Boolean. If set to |
| Updates the product ancestor categories relationship, |
| Generates the computed product catalogs relationships by calling the |
| Updates the product parent categories for catalog relationships by calling the |
| Calls the stored procedure that generates the product sites relationship, |
| Boolean. If set to |
| Updates the SKU catalog relationships by calling the |
| Updates the SKU sites relationships by calling the |