Search Results for

    Show / Hide Table of Contents

    Class RowActionTargetFactory

    Factory methods that create a RowActionTarget<TInput> dataflow worker, which executes a callback on each incoming row from the Input port. The callback is passed the row as a parameter, and does not itself take rows from the Input.

    Also see the RowActionTarget example.

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

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

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

    Methods

    RowActionTarget<TInput>(in DownstreamFactory<TInput>, String, Action<TInput>)

    Initializes a new instance of the RowActionTarget<TInput> dataflow worker, which executes a synchronous action on each incoming row.

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

    Declaration
    public static RowActionTarget<TInput> RowActionTarget<TInput>(this in DownstreamFactory<TInput> downstreamFactory, string workerName, Action<TInput> rowAction)
        where TInput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInput> 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<TInput> rowAction

    The synchronous action that will get called for each incoming row. It receives the row as a parameter, which is guaranteed to not be null.

    Returns
    Type Description
    RowActionTarget<TInput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInput

    The type of the input rows.

    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?

    RowActionTarget<TInput>(in DownstreamFactory<TInput>, String, Func<TInput, ProgressStatus>)

    Initializes a new instance of the RowActionTarget<TInput> dataflow worker, which executes a synchronous function on each incoming row.

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

    Declaration
    public static RowActionTarget<TInput> RowActionTarget<TInput>(this in DownstreamFactory<TInput> downstreamFactory, string workerName, Func<TInput, ProgressStatus> rowFunc)
        where TInput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInput> 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<TInput, ProgressStatus> rowFunc

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

    • NotCompleted to continue to be called when there are input rows available.
    • Succeeded to discard all additional incoming rows, and successfully finish row processing and the worker.
    • Error or Fatal to fail the worker.

    Returns
    Type Description
    RowActionTarget<TInput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInput

    The type of the input rows.

    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?

    RowActionTarget<TInput>(in DownstreamFactory<TInput>, String, Func<RowActionTarget<TInput>, Task<ProgressStatus>>, Action<TInput>, Func<RowActionTarget<TInput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)

    Initializes a new instance of the RowActionTarget<TInput> dataflow worker, which executes a synchronous action on each incoming row.

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

    Declaration
    public static RowActionTarget<TInput> RowActionTarget<TInput>(this in DownstreamFactory<TInput> downstreamFactory, string workerName, Func<RowActionTarget<TInput>, Task<ProgressStatus>> startingFuncAsync, Action<TInput> rowAction, Func<RowActionTarget<TInput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync)
        where TInput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInput> 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<RowActionTarget<TInput>, 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.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Action<TInput> rowAction

    The synchronous action that will get called for each incoming row. It receives the row as a parameter, which is guaranteed to not be null.

    Func<RowActionTarget<TInput>, 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.

    Returns
    Type Description
    RowActionTarget<TInput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInput

    The type of the input rows.

    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?

    RowActionTarget<TInput>(in DownstreamFactory<TInput>, String, Func<RowActionTarget<TInput>, Task<ProgressStatus>>, Func<TInput, ProgressStatus>, Func<RowActionTarget<TInput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)

    Initializes a new instance of the RowActionTarget<TInput> dataflow worker, which executes a synchronous function on each incoming row.

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

    Declaration
    public static RowActionTarget<TInput> RowActionTarget<TInput>(this in DownstreamFactory<TInput> downstreamFactory, string workerName, Func<RowActionTarget<TInput>, Task<ProgressStatus>> startingFuncAsync, Func<TInput, ProgressStatus> rowFunc, Func<RowActionTarget<TInput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync)
        where TInput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInput> 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<RowActionTarget<TInput>, 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.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Func<TInput, ProgressStatus> rowFunc

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

    • NotCompleted to continue to be called when there are input rows available.
    • Succeeded to discard all additional incoming rows, and successfully finish row processing and the worker.
    • Error or Fatal to fail the worker.

    Func<RowActionTarget<TInput>, 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.

    Returns
    Type Description
    RowActionTarget<TInput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInput

    The type of the input rows.

    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

    RowActionTarget<TInput>
    In This Article
    Back to top Copyright © 2023 Envobi Ltd