Search Results for

    Show / Hide Table of Contents

    Class RowActionTransformFactory

    Factory methods that create a RowActionTransform<TInputOutputError> or RowActionTransform<TInputError, TOutput> dataflow worker, which executes a callback on each row passing through the transform. The callback does not itself take rows from or send rows to the ports. If the callback throws an exception, the input row will be rejected to the ErrorOutput port.

    The input port uses the Default policy. Consider whether this is appropriate, or should be overridden, see BufferingMode for further details.

    Also see the RowActionTransform example.

    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>).

    Note that this worker does not support asynchronous row methods. If that is needed, consider using RowsActionTransform<TInputOutputError> or RowsTransformBase<TDerived, TInput, TOutput, TError> instead.

    To create a transform without any ErrorOutput, consider inheriting from RowsTransformBase<TDerived, TInput, TOutput>.

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

    Methods

    RowActionTransform1<TInputOutputError>(in DownstreamFactory<TInputOutputError>, String, Action<TInputOutputError>)

    Initializes a new instance of the RowActionTransform<TInputOutputError> dataflow worker, which executes a synchronous action on each row passing through the transform. The callback is passed the row as a parameter, to read and modify as needed before it's automatically passed to the downstream worker. The callback does not itself take rows from or send rows to the ports. This constructor does not allow discarding input rows. The Output will be automatically completed, if needed.

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

    Declaration
    public static RowActionTransform<TInputOutputError> RowActionTransform1<TInputOutputError>(this in DownstreamFactory<TInputOutputError> downstreamFactory, string workerName, Action<TInputOutputError> rowAction)
        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 "__".

    Action<TInputOutputError> rowAction

    The synchronous action that will get called to read and optionally modify each incoming row. It receives the row as a parameter, which is guaranteed to not be null. It can modify the row before it's automatically passed to the downstream worker.

    Returns
    Type Description
    RowActionTransform<TInputOutputError>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputOutputError

    The type of each Input, Output and ErrorOutput row.

    Exceptions
    Type Condition
    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?

    RowActionTransform1<TInputOutputError>(in DownstreamFactory<TInputOutputError>, String, Func<TInputOutputError, TransformRowTreatment>)

    Initializes a new instance of the RowActionTransform<TInputOutputError> dataflow worker, which executes a synchronous function on each row passing through the transform. The callback is passed the row as a parameter, to read and modify as needed before it's automatically passed to the downstream worker. The callback does not itself take rows from or send rows to the ports. This constructor does allow discarding input rows. The Output will be automatically completed, if needed.

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

    Declaration
    public static RowActionTransform<TInputOutputError> RowActionTransform1<TInputOutputError>(this in DownstreamFactory<TInputOutputError> downstreamFactory, string workerName, Func<TInputOutputError, TransformRowTreatment> rowFunc)
        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 "__".

    Func<TInputOutputError, TransformRowTreatment> rowFunc

    The synchronous function that will get called to read and optionally modify each incoming row. It receives the row as a parameter, which is guaranteed to not be null, and returns TransformRowTreatment which specifies if and how the input row should be passed to downstream workers.

    Returns
    Type Description
    RowActionTransform<TInputOutputError>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputOutputError

    The type of each Input, Output and ErrorOutput row.

    Exceptions
    Type Condition
    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?

    RowActionTransform1<TInputOutputError>(in DownstreamFactory<TInputOutputError>, String, Func<RowActionTransform<TInputOutputError>, Task<ProgressStatus>>, Action<TInputOutputError>, Func<RowActionTransform<TInputOutputError>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)

    Initializes a new instance of the RowActionTransform<TInputOutputError> dataflow worker, which executes a synchronous action on each row passing through the transform. The callback is passed the row as a parameter, to read and modify as needed before it's automatically passed to the downstream worker. The callback does not itself take rows from or send rows to the ports. This constructor does not allow discarding input rows.

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

    Declaration
    public static RowActionTransform<TInputOutputError> RowActionTransform1<TInputOutputError>(this in DownstreamFactory<TInputOutputError> downstreamFactory, string workerName, Func<RowActionTransform<TInputOutputError>, Task<ProgressStatus>> startingFuncAsync, Action<TInputOutputError> rowAction, Func<RowActionTransform<TInputOutputError>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync)
        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 "__".

    Func<RowActionTransform<TInputOutputError>, Task<ProgressStatus>> startingFuncAsync

    A function that will be called before the row processing starts, ignored if null. It receives the worker as a parameter, and should return:

    • NotCompleted to perform normal row processing.
    • Succeeded to skip normal by row processing by discarding any input rows, and successfully complete any output ports.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Action<TInputOutputError> rowAction

    The synchronous action that will get called to read and optionally modify each incoming row. It receives the row as a parameter, which is guaranteed to not be null. It can modify the row before it's automatically passed to the downstream worker.

    Func<RowActionTransform<TInputOutputError>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync

    A function that will be called after any startingFuncAsync and normal processing have completed. Receives the worker and the current OutcomeStatus as parameters. It should return:

    • Succeeded to complete the worker successfully. Note that if any ports have not been completed, or have failed, then the worker will still be failed.
    • Error or Fatal to fail the worker and any incomplete ports.
    Set to null to return the same OutcomeStatus that was passed in, after (if needed) completing the Output port according to the OutcomeStatus.

    Returns
    Type Description
    RowActionTransform<TInputOutputError>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputOutputError

    The type of each Input, Output and ErrorOutput row.

    Exceptions
    Type Condition
    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?

    RowActionTransform1<TInputOutputError>(in DownstreamFactory<TInputOutputError>, String, Func<RowActionTransform<TInputOutputError>, Task<ProgressStatus>>, Func<TInputOutputError, TransformRowTreatment>, Func<RowActionTransform<TInputOutputError>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)

    Initializes a new instance of the RowActionTransform<TInputOutputError> dataflow worker, which executes a synchronous function on each row passing through the transform. The callback is passed the row as a parameter, to read and modify as needed before it's automatically passed to the downstream worker. The callback does not itself take rows from or send rows to the ports. This constructor does allow discarding input rows.

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

    Declaration
    public static RowActionTransform<TInputOutputError> RowActionTransform1<TInputOutputError>(this in DownstreamFactory<TInputOutputError> downstreamFactory, string workerName, Func<RowActionTransform<TInputOutputError>, Task<ProgressStatus>> startingFuncAsync, Func<TInputOutputError, TransformRowTreatment> rowFunc, Func<RowActionTransform<TInputOutputError>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync)
        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 "__".

    Func<RowActionTransform<TInputOutputError>, Task<ProgressStatus>> startingFuncAsync

    A function that will be called before the row processing starts, ignored if null. It receives the worker as a parameter, and should return:

    • NotCompleted to perform normal row processing.
    • Succeeded to skip normal by row processing by discarding any input rows, and successfully complete any output ports.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Func<TInputOutputError, TransformRowTreatment> rowFunc

    The synchronous function that will get called to read and optionally modify each incoming row. It receives the row as a parameter, which is guaranteed to not be null, and returns TransformRowTreatment which specifies if and how the input row should be passed to downstream workers.

    Func<RowActionTransform<TInputOutputError>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync

    A function that will be called after any startingFuncAsync and normal processing have completed. Receives the worker and the current OutcomeStatus as parameters. It should return:

    • Succeeded to complete the worker successfully. Note that if any ports have not been completed, or have failed, then the worker will still be failed.
    • Error or Fatal to fail the worker and any incomplete ports.
    Set to null to return the same OutcomeStatus that was passed in, after (if needed) completing the Output port according to the OutcomeStatus.

    Returns
    Type Description
    RowActionTransform<TInputOutputError>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputOutputError

    The type of each Input, Output and ErrorOutput row.

    Exceptions
    Type Condition
    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?

    RowActionTransform2<TInputError, TOutput>(in DownstreamFactory<TInputError>, String, Func<TInputError, TOutput>)

    Initializes a new instance of the RowActionTransform<TInputError, TOutput> dataflow worker, which executes a synchronous function on each row passing through the transform. The callback is passed the row as a parameter, and the return value controls whether to send zero or one row (which can be of a different type) to the output, or to the error output. When outputting a row, the callback is responsible for either allocating a new output row, or if appropriate cast the input row to the output type, before passing it to the downstream worker. The Output will be automatically completed, if needed.

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

    Declaration
    public static RowActionTransform<TInputError, TOutput> RowActionTransform2<TInputError, TOutput>(this in DownstreamFactory<TInputError> downstreamFactory, string workerName, Func<TInputError, TOutput> rowFunc)
        where TInputError : class where TOutput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputError> 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 "__".

    Func<TInputError, TOutput> rowFunc

    The synchronous function that will get called for each incoming row. It receives the input row as a parameter, which is guaranteed to not be null, and returns the output row (or null to not output a row).

    Returns
    Type Description
    RowActionTransform<TInputError, TOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputError

    The type of each Input and ErrorOutput row.

    TOutput

    The type of each Output row.

    Exceptions
    Type Condition
    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?

    RowActionTransform2<TInputError, TOutput>(in DownstreamFactory<TInputError>, String, Func<TInputError, (TransformRowTreatment, TOutput)>)

    Initializes a new instance of the RowActionTransform<TInputError, TOutput> dataflow worker, which executes a synchronous function on each row passing through the transform. The callback is passed the row as a parameter, and the return value controls whether to send zero or one row (which can be of a different type) to the output, or to the error output. When outputting a row, the callback is responsible for either allocating a new output row, or if appropriate cast the input row to the output type, before passing it to the downstream worker.

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

    Declaration
    public static RowActionTransform<TInputError, TOutput> RowActionTransform2<TInputError, TOutput>(this in DownstreamFactory<TInputError> downstreamFactory, string workerName, Func<TInputError, (TransformRowTreatment, TOutput)> rowTupleFunc)
        where TInputError : class where TOutput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputError> 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 "__".

    Func<TInputError, (T1, T2)<TransformRowTreatment, TOutput>> rowTupleFunc

    The synchronous function that will get called for each incoming row. It receives the input row as a parameter, which is guaranteed to not be null, and returns a ValueTuple<T1,T2>, where TransformRowTreatment specifies if and how the returned row (the other member of the ValueTuple) should be passed to downstream workers. The returned row can be null if it's being discarded.

    Returns
    Type Description
    RowActionTransform<TInputError, TOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputError

    The type of each Input and ErrorOutput row.

    TOutput

    The type of each Output row.

    Exceptions
    Type Condition
    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?

    RowActionTransform2<TInputError, TOutput>(in DownstreamFactory<TInputError>, String, Func<RowActionTransform<TInputError, TOutput>, Task<ProgressStatus>>, Func<TInputError, TOutput>, Func<RowActionTransform<TInputError, TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)

    Initializes a new instance of the RowActionTransform<TInputError, TOutput> dataflow worker, which executes a synchronous function on each row passing through the transform. The callback is passed the row as a parameter, and the return value controls whether to send zero or one row (which can be of a different type) to the output, or to the error output. When outputting a row, the callback is responsible for either allocating a new output row, or if appropriate cast the input row to the output type, before passing it to the downstream worker.

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

    Declaration
    public static RowActionTransform<TInputError, TOutput> RowActionTransform2<TInputError, TOutput>(this in DownstreamFactory<TInputError> downstreamFactory, string workerName, Func<RowActionTransform<TInputError, TOutput>, Task<ProgressStatus>> startingFuncAsync, Func<TInputError, TOutput> rowFunc, Func<RowActionTransform<TInputError, TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync)
        where TInputError : class where TOutput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputError> 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 "__".

    Func<RowActionTransform<TInputError, TOutput>, Task<ProgressStatus>> startingFuncAsync

    A function that will be called before the row processing starts, ignored if null. It receives the worker as a parameter, and should return:

    • NotCompleted to perform normal row processing.
    • Succeeded to skip normal by row processing by discarding any input rows, and successfully complete any output ports.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Func<TInputError, TOutput> rowFunc

    The synchronous function that will get called for each incoming row. It receives the input row as a parameter, which is guaranteed to not be null, and returns the output row (or null to not output a row).

    Func<RowActionTransform<TInputError, TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync

    A function that will be called after any startingFuncAsync and normal processing have completed. Receives the worker and the current OutcomeStatus as parameters. It should return:

    • Succeeded to complete the worker successfully. Note that if any ports have not been completed, or have failed, then the worker will still be failed.
    • Error or Fatal to fail the worker and any incomplete ports.
    Set to null to return the same OutcomeStatus that was passed in, after (if needed) completing the Output port according to the OutcomeStatus.

    Returns
    Type Description
    RowActionTransform<TInputError, TOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputError

    The type of each Input and ErrorOutput row.

    TOutput

    The type of each Output row.

    Exceptions
    Type Condition
    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?

    RowActionTransform2<TInputError, TOutput>(in DownstreamFactory<TInputError>, String, Func<RowActionTransform<TInputError, TOutput>, Task<ProgressStatus>>, Func<TInputError, (TransformRowTreatment, TOutput)>, Func<RowActionTransform<TInputError, TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)

    Initializes a new instance of the RowActionTransform<TInputError, TOutput> dataflow worker, which executes a synchronous function on each row passing through the transform. The callback is passed the row as a parameter, and the return value controls whether to send zero or one row (which can be of a different type) to the output, or to the error output. When outputting a row, the callback is responsible for either allocating a new output row, or if appropriate cast the input row to the output type, before passing it to the downstream worker.

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

    Declaration
    public static RowActionTransform<TInputError, TOutput> RowActionTransform2<TInputError, TOutput>(this in DownstreamFactory<TInputError> downstreamFactory, string workerName, Func<RowActionTransform<TInputError, TOutput>, Task<ProgressStatus>> startingFuncAsync, Func<TInputError, (TransformRowTreatment, TOutput)> rowTupleFunc, Func<RowActionTransform<TInputError, TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync)
        where TInputError : class where TOutput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputError> 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 "__".

    Func<RowActionTransform<TInputError, TOutput>, Task<ProgressStatus>> startingFuncAsync

    A function that will be called before the row processing starts, ignored if null. It receives the worker as a parameter, and should return:

    • NotCompleted to perform normal row processing.
    • Succeeded to skip normal by row processing by discarding any input rows, and successfully complete any output ports.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Func<TInputError, (T1, T2)<TransformRowTreatment, TOutput>> rowTupleFunc

    The synchronous function that will get called for each incoming row. It receives the input row as a parameter, which is guaranteed to not be null, and returns a ValueTuple<T1,T2>, where TransformRowTreatment specifies if and how the returned row (the other member of the ValueTuple) should be passed to downstream workers. The returned row can be null if it's being discarded.

    Func<RowActionTransform<TInputError, TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync

    A function that will be called after any startingFuncAsync and normal processing have completed. Receives the worker and the current OutcomeStatus as parameters. It should return:

    • Succeeded to complete the worker successfully. Note that if any ports have not been completed, or have failed, then the worker will still be failed.
    • Error or Fatal to fail the worker and any incomplete ports.
    Set to null to return the same OutcomeStatus that was passed in, after (if needed) completing the Output port according to the OutcomeStatus.

    Returns
    Type Description
    RowActionTransform<TInputError, TOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputError

    The type of each Input and ErrorOutput row.

    TOutput

    The type of each Output row.

    Exceptions
    Type Condition
    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

    RowActionTransform<TInputOutputError>
    RowActionTransform<TInputError, TOutput>
    In This Article
    Back to top Copyright © 2023 Envobi Ltd