CreatePlainLink: IEtlPlainLink;
The CreatePlainLink method links ETL task objects that operate with flat data.
To execute the ETL task, use the IEtlTask.Execute method.
Executing the example requires an ETL task with the ETL identifier and created objects. Add links to the Andy, Etl, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MbObj: IMetabaseObject;
EtlTask: IEtlTask;
Link: IEtlPlainLink;
Provider: IEtlPlainDataProvider;
Consumer: IEtlPlainDataConsumer;
WLink: IWxLink;
Style: IWxStyle;
WxETLLink: IWxEtlObject;
WxProvider, WxConsumer: IWxShape;
Begin
MB := MetabaseClass.Active;
MbObj := MB.ItemById("ETL").Edit;
EtlTask := (MbObj) As IEtlTask;
//Create a new link object
Link := EtlTask.CreatePlainLink;
//Set data source and data consumer
Provider := EtlTask.Item(0) As IEtlPlainDataProvider;
Consumer := EtlTask.Item(1) As IEtlPlainDataConsumer;
Link.SourceObjectOutput := Provider.PlainOutput;
Link.DestinationObjectInput := Consumer.PlainInput;
Link.FillDefault;
//Create a visual link
//Source rectangle
WxProvider := EtlTask.Workspace.Shapes.Item(0);
//Consumer rectangle
WxConsumer := EtlTask.Workspace.Shapes.Item(1);
WLink := EtlTask.Workspace.AutoLinkShapes(WxProvider, WxConsumer);
WxETLLink := New WxEtlObject.Create;
WxETLLink.EtlObject := Link;
WLink.Extension := WxETLLink As IWxShapeExtension;
//End of visual creating of link (source-consumer)
MbObj.Save;
End Sub UserProc;
After executing the example a link between two first ETL task objects is set.
See also: