Assembly: OptimaJet.Workflow.Core

Class BaseAggregatingProvider<T>

OptimaJet.Workflow.Core.Runtime.BaseAggregatingProvider<T>

Stores providers registered either globally or for specific schemes and exposes the applicable providers in registration order.

public abstract class BaseAggregatingProvider<T>

Type Hierarchy

Methods

protected IEnumerable<T> GetOrderedProviders(string schemeCode) #
Returns the global and scheme-specific providers applicable to a scheme, from the most recently registered provider to the earliest.

Parameters

Name
Type
Description
schemeCode
String
The scheme code used to include providers registered specifically for that scheme. If the value is null, empty, or has no specific registrations, only global providers are returned.

Returns

Type
Description
IEnumerable<T>
A merged sequence of applicable global and scheme-specific providers in reverse registration order. Scope does not affect priority: the last applicable provider registered is returned first.
protected IEnumerable<T> GetProviders(string schemeCode) #
Returns the global and scheme-specific providers applicable to a scheme, from the earliest registered provider to the most recently registered.

Parameters

Name
Type
Description
schemeCode
String
The scheme code used to include providers registered specifically for that scheme. If the value is null, empty, or has no specific registrations, only global providers are returned.

Returns

Type
Description
IEnumerable<T>
A merged sequence of applicable global and scheme-specific providers in registration order. Scope does not affect priority: the earliest applicable provider registered is returned first.
public void RegisterProvider(T provider, List<string> schemes = null) #
Registers a provider for a specific set of schemes, or for all schemes when no list is supplied.

Parameters

Name
Type
Description
provider
{T}
Provider instance to register.
schemes
List<String>
Scheme codes where the provider should be used. If null or empty, the provider is registered as a global provider.

Remarks

Each call receives one position in the registration sequence. When several scheme codes are supplied, the provider has the same position for every listed scheme. Global and scheme-specific registrations are compared using this shared sequence.
public void Clear() #
Removes all providers from this aggregator.

Remarks

Global and scheme-specific providers share a single registration sequence. Neither scope has an inherent priority: a provider registered later is considered newer regardless of whether it is global or scheme-specific.

When providers are requested for a scheme, all global providers and only the providers registered specifically for that scheme are selected. The selected providers are then sorted solely by registration time: BaseAggregatingProvider<T>.GetProviders(string) returns the earliest registration first, while BaseAggregatingProvider<T>.GetOrderedProviders(string) returns the most recent registration first.

Derived aggregators decide whether to use the first applicable provider or combine results from all of them. This class only determines which providers are applicable and their enumeration order.