IEtlPlainDataTransformer.ErrorOutput

Syntax

ErrorOutput(Index: Integer): IEtlPlainOutput;

Parameters

Index. Output index with error records.

Description

The ErrorOutput property returns parameters of the specified output with error records.

Comments

The current implementation allows only one output with error records for each converter, that is why the 0 value must be passed as the Index parameter.

Example

Executing the example requires an ETL task with the ETL_Task identifier. The task contains a converter with the PLAINDATATRANSFORMER identifier and a data consumer with the ERRORCONSUMER identifier.

Sub UserProc;
Var
    MB: IMetabase;
    ETLTask: IEtlTask;
    Transform: IEtlPlainDataTransformer;
    ErrorConsumer: IEtlPlainDataConsumer;
    Link: IEtlPlainLink;
    Shapes: IWxShapes;
Begin
    MB := MetabaseClass.Active;
    ETLTask := MB.ItemById("ETL_Task").Edit As IEtlTask;
     //Transformer
    Transform := ETLTask.FindById("PLAINDATATRANSFORMER"As IEtlPlainDataTransformer;
     //Error record consumer

    ErrorConsumer := ETLTask.FindById("ERRORCONSUMER"As IEtlPlainDataConsumer;
     //Link and set up output with error values
    Transform.ErrorOverlimitPolicy := EtlErrorOverlimitPolicy.StopOutput;
    Transform.ErrorStopLimit := 100;
     //Link transformer output fields and error record consumer input
    FillFields(ErrorConsumer.PlainInput.Fields, Transform.ErrorOutput(0).Fields);
     //Create a link
    Link := CreateLink(ETLTask, Transform.ErrorOutput(0), ErrorConsumer.PlainInput);
     //Create a visual link
    Shapes := ETLTask.Workspace.Shapes;

    CreateWXLink(ETLTask, Shapes.FindById(Transform.Id), Shapes.FindById(ErrorConsumer.Id), Link);
    (ETLTask As IMetabaseObject).Save;
End Sub UserProc;
//Fill input/output field lists
Sub FillFields(Fields, FieldsSource: IEtlPlainFields);
Begin
    Fields := Fields.Edit;
    Fields.Fill(FieldsSource);
    Fields.Save;
End Sub FillFields;
//Create a link between objects
Function CreateLink(ETLTask: IEtlTask; Output: IEtlPlainOutput; Input: IEtlPlainInput): IEtlPlainLink;
Var
    Link: IEtlPlainLink;
Begin
    Link := ETLTask.CreatePlainLink;

    Link.SourceObjectOutput := Output;
    Link.DestinationObjectInput := Input;
    Link.FillDefault;
    Return Link;
End Function CreateLink;
//Create visual links
Sub CreateWXLink(ETLTask: IEtlTask; Shape1: IWxShape; Shape2: IWxShape; Link: IEtlPlainLink);
Var
    WLink: IWxLink;
    WxETLLink: IWxEtlObject;
Begin

     //Create visual link objects
    WLink := ETLTask.Workspace.AutoLinkShapes(Shape1, Shape2);
    WLink.Style.LinePenBeginWxCap := WxLineCap.Flat;
    WLink.Style.LinePenEndWxCap := WxLineCap.Arrow30DegreeFilled;
    WxETLLink := New WxEtlObject.Create;
    WxETLLink.EtlObject := Link;
    WLink.Extension := WxETLLink As IWxShapeExtension;
End Sub CreateWXLink;

After executing the example the input with error records is set up for the PLAINDATATRANSFORMER converter:

See also:

IEtlPlainDataTransformer