Dataset: IDatasetModel;
The Dataset property determines an MDM dictionary that is used as a data provider.
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;
EtlProvider: IEtlPlainDataProvider;
DtRds: IDtRdsProvider;
Begin
MB := MetabaseClass.Active;
ETLTask := MB.ItemById("ETL_Task").Edit As IEtlTask;
//Create a new data provider - MDM dictionary
EtlProvider := ETLTask.Create(EtlObjectType.PlainDataRdsProvider) As IEtlPlainDataProvider;
EtlProvider := EtlProvider.Edit;
EtlProvider.Id := "RDS_Provider";
EtlProvider.Name := "Data provider - MDM dictionary";
//Create a visual source object
CreateWX(ETLTask, EtlProvider, 0, 0);
//Set up source
DtRds := EtlProvider.Provider As IDtRdsProvider;
DtRds.Dataset := Mb.ItemById("RDS_DICT").Bind As IDatasetModel;
//Save source
EtlProvider.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 provider is created in the ETL task that is connected with the specified MDM dictionary.
See also: