ConditionalSplit<TInput>

Class ConditionalSplit<TInput>

The ConditionalSplit<TInput> transformation routes incoming rows based on a specified condition. Rows that match the MatchPredicate are sent to the primary output (linked via 'LinkTo()'). All other rows are sent to a secondary output (linked via LinkUnmatchedTo(IDataFlowDestination<TInput>)).

Inheritance
DataFlowTransformation<TInput, TInput>
ConditionalSplit<TInput>
Inherited Members
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
    public class ConditionalSplit<TInput> : DataFlowTransformation<TInput, TInput>, IDataFlowTransformation<TInput, TInput>, IDataFlowSource<TInput>, IDataFlowSource, IDataFlowDestination<TInput>, IDataFlowDestination, IDataFlowComponent, ILoggableTask
Type Parameters
NameDescription
TInput

The type of incoming data.

Constructors

ConditionalSplit()

Declaration
    public ConditionalSplit()

ConditionalSplit(Predicate<TInput>)

Declaration
    public ConditionalSplit(Predicate<TInput> matchPredicate)
Parameters
TypeNameDescription
Predicate<TInput>matchPredicate

Properties

MatchCount

Number of rows that matched the MatchPredicate and were sent to the primary output.

Declaration
    public int MatchCount { get; }
Property Value
TypeDescription
int

MatchPredicate

Defines the condition used to determine if a row should be sent to the primary output. Rows that evaluate to true are forwarded via 'LinkTo'. Rows that evaluate to false are sent to the secondary output via LinkUnmatchedTo(IDataFlowDestination<TInput>). Defaults to a condition that filters out null values.

Declaration
    public Predicate<TInput> MatchPredicate { get; set; }
Property Value
TypeDescription
Predicate<TInput>

SourceBlock

SourceBlock from the underlying TPL.Dataflow which is used as output buffer for the component.

Declaration
    public override ISourceBlock<TInput> SourceBlock { get; }
Property Value
TypeDescription
ISourceBlock<TInput>
Overrides

TargetBlock

TargetBlock from the underlying TPL.Dataflow which is used as input buffer for the component.

Declaration
    public override ITargetBlock<TInput> TargetBlock { get; }
Property Value
TypeDescription
ITargetBlock<TInput>
Overrides

UnmatchedCount

Number of rows that did not match the MatchPredicate and were sent to the secondary output.

Declaration
    public int UnmatchedCount { get; }
Property Value
TypeDescription
int

UnmatchedSourceBlock

Declaration
    public ISourceBlock<TInput> UnmatchedSourceBlock { get; }
Property Value
TypeDescription
ISourceBlock<TInput>

Methods

AddComplementVoidLinkToOtherTargets(Func<Type, IDataFlowDestination>, Delegate)

Declaration
    protected override void AddComplementVoidLinkToOtherTargets(Func<Type, IDataFlowDestination> createAutomaticVoidDestination, Delegate pred)
Parameters
TypeNameDescription
Func<Type, IDataFlowDestination>createAutomaticVoidDestination
Delegatepred
Overrides

CheckParameter()

Declaration
    protected override void CheckParameter()
Overrides

CleanUpOnFaulted(Exception)

Declaration
    protected override void CleanUpOnFaulted(Exception e)
Parameters
TypeNameDescription
Exceptione
Overrides

CleanUpOnSuccess()

Declaration
    protected override void CleanUpOnSuccess()
Overrides

InitComponent()

Declaration
    protected override void InitComponent()
Overrides

LinkUnmatchedTo(IDataFlowDestination<TInput>)

Links the secondary output to the specified target. Rows that do not satisfy the MatchPredicate are forwarded to this destination.

Declaration
    public IDataFlowSource<TInput> LinkUnmatchedTo(IDataFlowDestination<TInput> target)
Parameters
TypeNameDescription
IDataFlowDestination<TInput>target

The transformation or destination component to link to.

Returns
TypeDescription
IDataFlowSource<TInput>

The linked data flow source.

LinkUnmatchedTo(IDataFlowDestination<TInput>, Predicate<TInput>)

Links the secondary output to the specified target. Rows that do not satisfy the MatchPredicate are forwarded to this destination.

Declaration
    public virtual IDataFlowSource<TInput> LinkUnmatchedTo(IDataFlowDestination<TInput> target, Predicate<TInput> rowsToKeep)
Parameters
TypeNameDescription
IDataFlowDestination<TInput>target

The transformation or destination component to link to.

Predicate<TInput>rowsToKeep

A predicate to further filter which rows should be forwarded.

Returns
TypeDescription
IDataFlowSource<TInput>

The linked data flow source.

LinkUnmatchedTo(IDataFlowDestination<TInput>, Predicate<TInput>, Predicate<TInput>)

Links the secondary output to the specified target. Rows that do not satisfy the MatchPredicate are forwarded to this destination.

Declaration
    public virtual IDataFlowSource<TInput> LinkUnmatchedTo(IDataFlowDestination<TInput> target, Predicate<TInput> rowsToKeep, Predicate<TInput> rowsIntoVoid)
Parameters
TypeNameDescription
IDataFlowDestination<TInput>target

The transformation or destination component to link to.

Predicate<TInput>rowsToKeep

A predicate to further filter which rows should be forwarded.

Predicate<TInput>rowsIntoVoid

A predicate to determine which rows should be discarded.

Returns
TypeDescription
IDataFlowSource<TInput>

The linked data flow source.

Reset()

Declaration
    protected override void Reset()
Overrides

Implements