Table of Contents

Interface IAggregatorFactory

Namespace
NRules.Aggregators
Assembly
NRules.dll

Base interface for aggregator factories. Aggregator factory constructs new instances of IAggregator of a given type, so that they can accumulate aggregation results. An IAggregatorFactory type must either be registered in AggregatorRegistry, or provided in the canonical rule model via CustomFactoryType. If both are provided, the aggregator factory at the AggregateElement level takes precedence.

public interface IAggregatorFactory

Methods

Compile(AggregateElement, IEnumerable<IAggregateExpression>)

Called by the rules engine to compile the aggregator factory before it is used for the first time.

void Compile(AggregateElement element, IEnumerable<IAggregateExpression> compiledExpressions)

Parameters

element AggregateElement

Corresponding aggregate element from the rule definition.

compiledExpressions IEnumerable<IAggregateExpression>

Aggregate expressions compiled to an executable form.

Create()

Creates a new aggregator instance. This method is called by the engine for each new combination of preceding partial matches, so that a new instance of the aggregator is created to accumulate the results.

IAggregator Create()

Returns

IAggregator

Aggregator instance.