Search Results for

    Show / Hide Table of Contents

    Class DictionaryLookupSplitTransformFactory

    Factory methods that create a DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue> or a DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue> dataflow worker, which performs a lookup of a key in an dictionary, and uses the dictionary values to modify the rows before sending them to one of the outputs.

    Note that by default on .NET Framework, maximum array size is 2GB, which in turn limits the Dictionary<TKey,TValue> size with a 64-bit application (using references as key and value) to a maximum of 47.9 million items. You can remove this limit by enabling support for larger arrays, as described in <gcAllowVeryLargeObjects> Element.

    .NET 6+ on the other hand supports >2GB arrays by default.

    The Input port is linked to (if available) the upstream output or error output port specified by the factory.

    Get the factory from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).

    Also see Dataflow Lookups.

    Inheritance
    Object
    DictionaryLookupSplitTransformFactory
    Namespace: actionETL
    Assembly: actionETL.dll
    Syntax
    public static class DictionaryLookupSplitTransformFactory

    Methods

    DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue>(in DownstreamFactory<TInputOutputError>, String, IReadOnlyDictionary<TKey, TValue>, Func<TInputOutputError, TKey>, Action<TInputOutputError, TKey, TValue>)

    Initializes a new instance of the DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue> dataflow worker, which performs a lookup of a key in an IReadOnlyDictionary<TKey,TValue>, and uses the dictionary values to optionally modify the rows before sending them to one of the outputs.

    The Input port is linked to (if available) the upstream output or error output port specified by the factory.

    Rows where the key is found are sent to FoundOutput, while rows where the key is not found are sent to NotFoundOutput.

    Declaration
    public static DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue> DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue>(this in DownstreamFactory<TInputOutputError> downstreamFactory, string workerName, IReadOnlyDictionary<TKey, TValue> dictionary, Func<TInputOutputError, TKey> selectRowKeyFunc, Action<TInputOutputError, TKey, TValue> foundKeyAction)
        where TInputOutputError : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputOutputError> downstreamFactory

    The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to.

    Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    IReadOnlyDictionary<TKey, TValue> dictionary

    The dictionary to lookup incoming rows against.

    A dictionary must be provided either here, or via Dictionary. The callback methods (normally notFoundKeyFunc) can optionally be used to populate the dictionary on the fly.

    Func<TInputOutputError, TKey> selectRowKeyFunc

    The select key function that takes the incoming row as a parameter, and returns the key to lookup in the dictionary.

    Action<TInputOutputError, TKey, TValue> foundKeyAction

    A method that gets called for each incoming row where the selectRowKeyFunc key is found in the dictionary. It takes the incoming row, the key, and the lookup value as parameters.

    This method is typically used to modify the incoming row using the lookup value, but can also take any other action using the incoming row and the dictionary key and value.

    Can be null, in which case matched rows are sent unmodified to FoundOutput.

    Returns
    Type Description
    DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue>

    The initialized (and optionally linked) transform.

    Type Parameters
    Name Description
    TInputOutputError

    The type of all input and output port rows.

    TKey

    The type of the lookup key.

    TValue

    The type of the lookup value.

    Exceptions
    Type Condition
    ArgumentNullException

    selectRowKeyFunc

    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue>(in DownstreamFactory<TInputOutputError>, String, IReadOnlyDictionary<TKey, TValue>, Func<TInputOutputError, TKey>, Action<TInputOutputError, TKey, TValue>, Func<TInputOutputError, TKey, DictionaryLookupRowTreatment>)

    Initializes a new instance of the DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue> dataflow worker, which performs a lookup of a key in an IReadOnlyDictionary<TKey,TValue>, and uses the dictionary values to optionally modify the rows before sending them to one of the outputs.

    The Input port is linked to (if available) the upstream output or error output port specified by the factory.

    Rows where the key is found are sent to FoundOutput, while rows where the key is not found can be sent to any output port.

    Declaration
    public static DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue> DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue>(this in DownstreamFactory<TInputOutputError> downstreamFactory, string workerName, IReadOnlyDictionary<TKey, TValue> dictionary, Func<TInputOutputError, TKey> selectRowKeyFunc, Action<TInputOutputError, TKey, TValue> foundKeyAction, Func<TInputOutputError, TKey, DictionaryLookupRowTreatment> notFoundKeyFunc)
        where TInputOutputError : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputOutputError> downstreamFactory

    The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to.

    Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    IReadOnlyDictionary<TKey, TValue> dictionary

    The dictionary to lookup incoming rows against.

    A dictionary must be provided either here, or via Dictionary. The callback methods (normally notFoundKeyFunc) can optionally be used to populate the dictionary on the fly.

    Func<TInputOutputError, TKey> selectRowKeyFunc

    The select key function that takes the incoming row as a parameter, and returns the key to lookup in the dictionary.

    Action<TInputOutputError, TKey, TValue> foundKeyAction

    A method that gets called for each incoming row where the selectRowKeyFunc key is found in the dictionary. It takes the incoming row, the key, and the lookup value as parameters.

    This method is typically used to modify the incoming row using the lookup value, but can also take any other action using the incoming row and the dictionary key and value.

    Can be null, in which case matched rows are sent unmodified to FoundOutput.

    Func<TInputOutputError, TKey, DictionaryLookupRowTreatment> notFoundKeyFunc

    A function that gets called for each incoming row where the selectRowKeyFunc key is not found in the dictionary. It takes the incoming row and the key as parameters, and returns an enum that specifies how the incoming row should be treated, e.g. send to NotFoundOutput, or send to ErrorOutput and fail the worker etc.

    Can be null, in which case the row is sent unmodified to NotFoundOutput.

    This function is typically used to modify the incoming row, e.g. filling in default values, but can also take any other action using the incoming row and the calculated (but not found) key.

    Can be null, in which case unmatched rows are sent unmodified to NotFoundOutput.

    Returns
    Type Description
    DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue>

    The initialized (and optionally linked) transform.

    Type Parameters
    Name Description
    TInputOutputError

    The type of all input and output port rows.

    TKey

    The type of the lookup key.

    TValue

    The type of the lookup value.

    Exceptions
    Type Condition
    ArgumentNullException

    selectRowKeyFunc

    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue>(in DownstreamFactory<TInputOutputError>, String, IReadOnlyDictionary<TKey, TValue>, Func<TInputOutputError, TKey>, Func<TInputOutputError, TKey, TValue, DictionaryLookupRowTreatment>, Func<TInputOutputError, TKey, DictionaryLookupRowTreatment>)

    Initializes a new instance of the DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue> dataflow worker, which performs a lookup of a key in an IReadOnlyDictionary<TKey,TValue>, and uses the dictionary values to optionally modify the rows before sending them to one of the outputs.

    The Input port is linked to (if available) the upstream output or error output port specified by the factory.

    This overload provides full control over which output port to send the rows to.

    Declaration
    public static DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue> DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue>(this in DownstreamFactory<TInputOutputError> downstreamFactory, string workerName, IReadOnlyDictionary<TKey, TValue> dictionary, Func<TInputOutputError, TKey> selectRowKeyFunc, Func<TInputOutputError, TKey, TValue, DictionaryLookupRowTreatment> foundKeyFunc, Func<TInputOutputError, TKey, DictionaryLookupRowTreatment> notFoundKeyFunc)
        where TInputOutputError : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputOutputError> downstreamFactory

    The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to.

    Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    IReadOnlyDictionary<TKey, TValue> dictionary

    The dictionary to lookup incoming rows against.

    A dictionary must be provided either here, or via Dictionary. The callback methods (normally notFoundKeyFunc) can optionally be used to populate the dictionary on the fly.

    Func<TInputOutputError, TKey> selectRowKeyFunc

    The select key function that takes the incoming row as a parameter, and returns the key to lookup in the dictionary.

    Func<TInputOutputError, TKey, TValue, DictionaryLookupRowTreatment> foundKeyFunc

    A function that gets called for each incoming row where the selectRowKeyFunc key is found in the dictionary. It takes the incoming row, the key, and the lookup value as parameters, and returns an enum that specifies how the incoming row should be treated, e.g. send to FoundOutput, or send to ErrorOutput and fail the worker etc.

    This function is typically used to modify the incoming row using the lookup value, but can also take any other action using the incoming row and the dictionary key and value.

    Can be null, in which case matched rows are sent unmodified to FoundOutput.

    Func<TInputOutputError, TKey, DictionaryLookupRowTreatment> notFoundKeyFunc

    A function that gets called for each incoming row where the selectRowKeyFunc key is not found in the dictionary. It takes the incoming row and the key as parameters, and returns an enum that specifies how the incoming row should be treated, e.g. send to NotFoundOutput, or send to ErrorOutput and fail the worker etc.

    This function is typically used to modify the incoming row, e.g. filling in default values, but can also take any other action using the incoming row and the calculated (but not found) key.

    Can be null, in which case unmatched rows are sent unmodified to NotFoundOutput.

    Returns
    Type Description
    DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue>

    The initialized (and optionally linked) transform.

    Type Parameters
    Name Description
    TInputOutputError

    The type of all input and output port rows.

    TKey

    The type of the lookup key.

    TValue

    The type of the lookup value.

    Exceptions
    Type Condition
    ArgumentNullException

    selectRowKeyFunc

    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue>(in DownstreamFactory<TInputOutputError>, String, OutputPortBase<TDictionaryInput>, Func<TDictionaryInput, KeyValuePair<TKey, TValue>>, Func<TInputOutputError, TKey>, Action<TInputOutputError, TKey, TValue>)

    Initializes a new instance of the DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue> dataflow worker. It first loads an IDictionary<TKey,TValue> from the DictionaryInput port rows, then performs a lookup in the dictionary for each Input row, optionally modifying the input rows, before sending them to the appropriate output port: FoundOutput, NotFoundOutput, or ErrorOutput.

    The Input port is linked to (if available) the upstream output or error output port specified by the factory.

    Rows where the key is found are sent to FoundOutput, while rows where the key is not found are sent to NotFoundOutput.

    Declaration
    public static DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue> DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue>(this in DownstreamFactory<TInputOutputError> downstreamFactory, string workerName, OutputPortBase<TDictionaryInput> dictionaryInputFrom, Func<TDictionaryInput, KeyValuePair<TKey, TValue>> selectDictionaryKeyValueFunc, Func<TInputOutputError, TKey> selectRowKeyFunc, Action<TInputOutputError, TKey, TValue> foundKeyAction)
        where TInputOutputError : class where TDictionaryInput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputOutputError> downstreamFactory

    The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to.

    Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    OutputPortBase<TDictionaryInput> dictionaryInputFrom

    The upstream output (or error output) port to link the DictionaryInput port from. Can be null, in which case the port must be linked before this worker or its siblings run.

    Func<TDictionaryInput, KeyValuePair<TKey, TValue>> selectDictionaryKeyValueFunc

    The function callback that takes the incoming dictionary row as a parameter, and returns the dictionary key and lookup value pair from the DictionaryInput rows, via columns or calculations, e.g.:

    dictRow => new KeyValuePair<TKey, TValue>(dictRow.MyKey, dictRow.MyValue + "MySuffix")
    Func<TInputOutputError, TKey> selectRowKeyFunc

    The select key function that takes the incoming Input row as a parameter, and returns the key to lookup in the dictionary.

    Action<TInputOutputError, TKey, TValue> foundKeyAction

    A method that gets called for each incoming row where the selectRowKeyFunc key is found in the dictionary. It takes the incoming row, the key, and the lookup value as parameters.

    This function is typically used to modify the incoming row using the lookup value, but can also take any other action using the incoming row and the dictionary key and value.

    Can be null, in which case matched rows are sent unmodified to FoundOutput.

    Returns
    Type Description
    DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue>
    Type Parameters
    Name Description
    TInputOutputError

    The type of all input and output port rows, except for DictionaryInput.

    TDictionaryInput

    The type of DictionaryInput port rows.

    TKey

    The type of the lookup key.

    TValue

    The type of the lookup value.

    Exceptions
    Type Condition
    ArgumentNullException
    • selectDictionaryKeyValueFunc
    • selectRowKeyFunc
    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue>(in DownstreamFactory<TInputOutputError>, String, OutputPortBase<TDictionaryInput>, Func<TDictionaryInput, KeyValuePair<TKey, TValue>>, Func<TInputOutputError, TKey>, Action<TInputOutputError, TKey, TValue>, Func<TInputOutputError, TKey, DictionaryLookupRowTreatment>)

    Initializes a new instance of the DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue> dataflow worker. It first loads an IDictionary<TKey,TValue> from the DictionaryInput port rows, then performs a lookup in the dictionary for each Input row, optionally modifying the input rows, before sending them to the appropriate output port: FoundOutput, NotFoundOutput, or ErrorOutput.

    The Input port is linked to (if available) the upstream output or error output port specified by the factory.

    Rows where the key is found are sent to FoundOutput, while rows where the key is not found can be sent to any output port.

    Declaration
    public static DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue> DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue>(this in DownstreamFactory<TInputOutputError> downstreamFactory, string workerName, OutputPortBase<TDictionaryInput> dictionaryInputFrom, Func<TDictionaryInput, KeyValuePair<TKey, TValue>> selectDictionaryKeyValueFunc, Func<TInputOutputError, TKey> selectRowKeyFunc, Action<TInputOutputError, TKey, TValue> foundKeyAction, Func<TInputOutputError, TKey, DictionaryLookupRowTreatment> notFoundKeyFunc)
        where TInputOutputError : class where TDictionaryInput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputOutputError> downstreamFactory

    The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to.

    Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    OutputPortBase<TDictionaryInput> dictionaryInputFrom

    The upstream output (or error output) port to link the DictionaryInput port from. Can be null, in which case the port must be linked before this worker or its siblings run.

    Func<TDictionaryInput, KeyValuePair<TKey, TValue>> selectDictionaryKeyValueFunc

    The function callback that takes the incoming dictionary row as a parameter, and returns the dictionary key and lookup value pair from the DictionaryInput rows, via columns or calculations, e.g.:

    dictRow => new KeyValuePair<TKey, TValue>(dictRow.MyKey, dictRow.MyValue + "MySuffix")
    Func<TInputOutputError, TKey> selectRowKeyFunc

    The select key function that takes the incoming Input row as a parameter, and returns the key to lookup in the dictionary.

    Action<TInputOutputError, TKey, TValue> foundKeyAction

    A method that gets called for each incoming row where the selectRowKeyFunc key is found in the dictionary. It takes the incoming row, the key, and the lookup value as parameters.

    This function is typically used to modify the incoming row using the lookup value, but can also take any other action using the incoming row and the dictionary key and value.

    Can be null, in which case matched rows are sent unmodified to FoundOutput.

    Func<TInputOutputError, TKey, DictionaryLookupRowTreatment> notFoundKeyFunc

    A function that gets called for each incoming row where the selectRowKeyFunc key is not found in the dictionary. It takes the incoming row and the key as parameters, and returns an enum that specifies how the incoming row should be treated, e.g. send to NotFoundOutput, or send to ErrorOutput and fail the worker etc.

    This function is typically used to modify the incoming row, e.g. filling in default values, but can also take any other action using the incoming row and the calculated (but not found) key.

    Can be null, in which case unmatched rows are sent unmodified to NotFoundOutput.

    Returns
    Type Description
    DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue>
    Type Parameters
    Name Description
    TInputOutputError

    The type of all input and output port rows, except for DictionaryInput.

    TDictionaryInput

    The type of DictionaryInput port rows.

    TKey

    The type of the lookup key.

    TValue

    The type of the lookup value.

    Exceptions
    Type Condition
    ArgumentNullException
    • selectDictionaryKeyValueFunc
    • selectRowKeyFunc
    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue>(in DownstreamFactory<TInputOutputError>, String, OutputPortBase<TDictionaryInput>, Func<TDictionaryInput, KeyValuePair<TKey, TValue>>, Func<TInputOutputError, TKey>, Func<TInputOutputError, TKey, TValue, DictionaryLookupRowTreatment>, Func<TInputOutputError, TKey, DictionaryLookupRowTreatment>)

    Initializes a new instance of the DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue> dataflow worker. It first loads an IDictionary<TKey,TValue> from the DictionaryInput port rows, then performs a lookup in the dictionary for each Input row, optionally modifying the input rows, before sending them to the appropriate output port: FoundOutput, NotFoundOutput, or ErrorOutput.

    The Input port is linked to (if available) the upstream output or error output port specified by the factory.

    This overload provides full control over which output port to send the rows to.

    Declaration
    public static DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue> DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue>(this in DownstreamFactory<TInputOutputError> downstreamFactory, string workerName, OutputPortBase<TDictionaryInput> dictionaryInputFrom, Func<TDictionaryInput, KeyValuePair<TKey, TValue>> selectDictionaryKeyValueFunc, Func<TInputOutputError, TKey> selectRowKeyFunc, Func<TInputOutputError, TKey, TValue, DictionaryLookupRowTreatment> foundKeyFunc, Func<TInputOutputError, TKey, DictionaryLookupRowTreatment> notFoundKeyFunc)
        where TInputOutputError : class where TDictionaryInput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputOutputError> downstreamFactory

    The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to.

    Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    OutputPortBase<TDictionaryInput> dictionaryInputFrom

    The upstream output (or error output) port to link the DictionaryInput port from. Can be null, in which case the port must be linked before this worker or its siblings run.

    Func<TDictionaryInput, KeyValuePair<TKey, TValue>> selectDictionaryKeyValueFunc

    The function callback that takes the incoming dictionary row as a parameter, and returns the dictionary key and lookup value pair from the DictionaryInput rows, via columns or calculations, e.g.:

    dictRow => new KeyValuePair<TKey, TValue>(dictRow.MyKey, dictRow.MyValue + "MySuffix")
    Func<TInputOutputError, TKey> selectRowKeyFunc

    The select key function that takes the incoming Input row as a parameter, and returns the key to lookup in the dictionary.

    Func<TInputOutputError, TKey, TValue, DictionaryLookupRowTreatment> foundKeyFunc

    A function that gets called for each incoming row where the selectRowKeyFunc key is found in the dictionary. It takes the incoming row, the key, and the lookup value as parameters, and returns an enum that specifies how the incoming row should be treated, e.g. send to FoundOutput, or send to ErrorOutput and fail the worker etc.

    This function is typically used to modify the incoming row using the lookup value, but can also take any other action using the incoming row and the dictionary key and value.

    Can be null, in which case matched rows are sent unmodified to FoundOutput.

    Func<TInputOutputError, TKey, DictionaryLookupRowTreatment> notFoundKeyFunc

    A function that gets called for each incoming row where the selectRowKeyFunc key is not found in the dictionary. It takes the incoming row and the key as parameters, and returns an enum that specifies how the incoming row should be treated, e.g. send to NotFoundOutput, or send to ErrorOutput and fail the worker etc.

    This function is typically used to modify the incoming row, e.g. filling in default values, but can also take any other action using the incoming row and the calculated (but not found) key.

    Can be null, in which case unmatched rows are sent unmodified to NotFoundOutput.

    Returns
    Type Description
    DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue>
    Type Parameters
    Name Description
    TInputOutputError

    The type of all input and output port rows, except for DictionaryInput.

    TDictionaryInput

    The type of DictionaryInput port rows.

    TKey

    The type of the lookup key.

    TValue

    The type of the lookup value.

    Exceptions
    Type Condition
    ArgumentNullException
    • selectDictionaryKeyValueFunc
    • selectRowKeyFunc
    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    See Also

    DictionaryLookupSplitTransform<TInputOutputError, TKey, TValue>
    DictionaryLookupSplitTransform<TInputOutputError, TDictionaryInput, TKey, TValue>
    DictionaryLookupRowTreatment
    DictionaryLookupTransform<TInputOutputError, TKey, TValue>
    DictionaryLookupTransform<TInputOutputError, TDictionaryInput, TKey, TValue>
    DictionaryTarget<TInput, TKey, TValue>
    In This Article
    Back to top Copyright © 2023 Envobi Ltd