IDtRdsConsumer.Dataset

Syntax

Dataset: IDatasetModel;

Description

The Dataset property determines an MDM dictionary that is used as a data consumer.

Example

Executing the example requires that the repository contains an ETL task with the ETL_Task identifier and an MDM dictionary with the RDS_DICT identifier.

Add links to the Andy, Db, Drawing, Dt, Etl, Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    ETLTask: IEtlTask;
    EtlConsumer: IEtlPlainDataConsumer;
    DtRds: IDtRdsConsumer;
Begin
    MB := MetabaseClass.Active;
    ETLTask := MB.ItemById(
"ETL_Task").Edit As IEtlTask;
    
//Create a new data provider - MSM dictionary
    EtlConsumer := ETLTask.Create(EtlObjectType.PlainDataRdsConsumer) As IEtlPlainDataConsumer;
    EtlConsumer := EtlConsumer.Edit;
    EtlConsumer.ClearConsumer := 
False;
    EtlConsumer.Id := 
"RDS_Consumer";
    EtlConsumer.Name := 
"Data consumer - MDM dictionary";
    
//Create a visual consumer object
    CreateWX(ETLTask, EtlConsumer, 00);
    
//Set up data consumer
    DtRds := EtlConsumer.Consumer As IDtRdsConsumer;
    DtRds.Dataset := Mb.ItemById(
"RDS_DICT").Bind As IDatasetModel;
    DtRds.UpdateMode := UpdateLoadMode.InsertUpdate;
    
//Save data consumer
    EtlConsumer.Save;
    
//Save task
    (ETLTask As IMetabaseObject).Save;
End Sub UserProc;

//Create a visual object
Sub CreateWX(ETLTask: IEtlTask; ETLObject: IEtlObject; XPosition: Integer; YPosition: Integer);
Var
    WxRect: IWxRectangle;
    WxETLObj: IWxEtlObject;
Begin
    WxRect := ETLTask.Workspace.CreateRectangle;
    WxRect.Id := ETLObject.Id;
    WxETLObj := 
New WxEtlObject.Create;
    WxETLObj.EtlObject := ETLObject;
    WxRect.Style.TextPosition := WxTextPosition.Bottom;
    WxRect.Style.PictureMarginTop := -
10;
    WxRect.PinPosition := 
New GxPointF.Create(XPosition, YPosition);
    WxRect.Extension := WxETLObj 
As IWxShapeExtension;
End Sub CreateWX;

After executing the example, a new data consumer is created in the ETL task that is linked with the specified MDM dictionary.

See also:

IDtRdsConsumer