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>)).
Implements
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, ILoggableTaskType Parameters
| Name | Description |
|---|---|
| TInput | The type of incoming data. |
Constructors
ConditionalSplit()
Declaration
public ConditionalSplit()ConditionalSplit(Predicate<TInput>)
Declaration
public ConditionalSplit(Predicate<TInput> matchPredicate)Parameters
| Type | Name | Description |
|---|---|---|
| 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
| Type | Description |
|---|---|
| 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
| Type | Description |
|---|---|
| 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
| Type | Description |
|---|---|
| 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
| Type | Description |
|---|---|
| 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
| Type | Description |
|---|---|
| int |
UnmatchedSourceBlock
Declaration
public ISourceBlock<TInput> UnmatchedSourceBlock { get; }Property Value
| Type | Description |
|---|---|
| ISourceBlock<TInput> |
Methods
AddComplementVoidLinkToOtherTargets(Func<Type, IDataFlowDestination>, Delegate)
Declaration
protected override void AddComplementVoidLinkToOtherTargets(Func<Type, IDataFlowDestination> createAutomaticVoidDestination, Delegate pred)Parameters
| Type | Name | Description |
|---|---|---|
| Func<Type, IDataFlowDestination> | createAutomaticVoidDestination | |
| Delegate | pred |
Overrides
CheckParameter()
Declaration
protected override void CheckParameter()Overrides
CleanUpOnFaulted(Exception)
Declaration
protected override void CleanUpOnFaulted(Exception e)Parameters
| Type | Name | Description |
|---|---|---|
| Exception | e |
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
| Type | Name | Description |
|---|---|---|
| IDataFlowDestination<TInput> | target | The transformation or destination component to link to. |
Returns
| Type | Description |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| 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
| Type | Description |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| 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
| Type | Description |
|---|---|
| IDataFlowSource<TInput> | The linked data flow source. |
Reset()
Declaration
protected override void Reset()