Table of Contents

Class ProductCompletenessPerRuleService

Namespace
Dynamicweb.Ecommerce.Products.CompletionRules
Assembly
Dynamicweb.Ecommerce.dll

Service for calculating per-rule product completeness values (completeness v2). Optimized for batch scenarios (e.g. index building) where multiple rules are evaluated for the same product, sharing expensive lookups across rules. Active when CompletenessFeature is enabled.

public abstract class ProductCompletenessPerRuleService
Inheritance
ProductCompletenessPerRuleService
Inherited Members

Methods

Calculate(string, IEnumerable<Group>, IList<CompletionRule>, string)

Calculates completeness for each rule individually, returning per-rule integer values. Shares expensive lookups (product existence, variant combinations, product keys, details, category fields) across all rules for the same product.

public abstract Dictionary<int, int> Calculate(string productId, IEnumerable<Group> groups, IList<CompletionRule> rules, string languageId)

Parameters

productId string

The product id

groups IEnumerable<Group>

The groups the product belongs to

rules IList<CompletionRule>

The completion rules to evaluate

languageId string

The language id for the calculation

Returns

Dictionary<int, int>

Dictionary mapping rule ID to completeness value (0-100, or -1 if not calculable).

To top