Click or drag to resize
MacroRuleMetadataContainer Class
Class for registering MacroRuleMetadata to the system. Use RegisterMetadata(MacroRuleMetadata) or RegisterMetadata(DictionaryString, MacroRuleMetadata, MacroRuleMetadata) to speed up recalculation of contact groups when registered macro rule is used in group condition.
Inheritance Hierarchy
SystemObject
  CMS.ContactManagementMacroRuleMetadataContainer

Namespace: CMS.ContactManagement
Assembly: CMS.ContactManagement (in CMS.ContactManagement.dll) Version: 13.0.131
Syntax
C#
public static class MacroRuleMetadataContainer

The MacroRuleMetadataContainer type exposes the following members.

Methods
  NameDescription
Public methodStatic memberIsTranslatorAvailable
Checks whether a translator is registered for given macro rule codename.
Public methodStatic memberRegisterMetadata
Registers metadata for a macro rule. Overrides already registered translators if the MacroRuleName collides.
Top
Remarks
Registering MacroRuleMetadata can have two profound effects on speed of recalculation. First is recalculating contacts in the database - normally, when a contact group is being rebuilt, system takes all contacts from database and runs the macro condition on each of those. By registering a translator to a rule, the computation can be inverted, that means at first, a database query will be constructed to select only those contacts that fit given macro condition. All of the macro rules must be able to translate themselves to database query to use this functionality. Second is recalculating the rule only when specified type of activity performs, for example when a PAGE_VISIT performs, there is no need to recalculate NEWSLETTER_OPEN macro rules. This can significantly reduce the count of contact groups that need rebuild on each request.
See Also