ExMode: Boolean;
ExMode: boolean;
The ExMode property determines whether user provider supports Fore.NET along with Fore.
Available values:
True. User provider will support Fore/Fore.NET because the IDtUserProviderEx interface is used that supports working with Fore/Fore.NET.
False. Default. A custom source will support only Fore because the IDtUserProvider interface is used that does not support working with Fore.NET classes.
The type of the IDtUserProvider interface that allows for specifying not only Fore class for implementing user provider interface, cannot control size of extracted data that leads to extensive memory use. It is more rational to use a new type of the IDtUserProviderEx interface that allows for specifying Fore/Fore.NET class for implementing system interface of user provider. When the Fore.NET class is implemented, it is possible to use partial data extraction.
To determine whether user consumer supports Fore.NET along with Fore, use IEtlPlainDataUserConsumer.ExMode.
Executing the example requires that the repository contains an ETL task with the ETL identifier.
Add links to the Andy, Drawing, Etl, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
EtlTask: IEtlTask;
DataUserProvider: IEtlPlainDataUserProvider;
DataUserConsumer: IEtlPlainDataUserConsumer;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get ETL task
MObj := MB.ItemById("ETL").Edit;
EtlTask := MObj As IEtlTask;
//Create the Custom Provider object
DataUserProvider := EtlTask.Create(EtlObjectType.PlainDataUserProvider) As IEtlPlainDataUserProvider;
// Set a new provider type for data source
DataUserProvider.ExMode := True;
// Set source name
DataUserProvider.Name := "Custom provider";
// Visual view of source in task
CreateWXP(DataUserProvider, EtlTask);
//Create the Custom Consumer object
DataUserConsumer := EtlTask.Create(EtlObjectType.PlainDataUserConsumer) As IEtlPlainDataUserConsumer;
// Set a new provider type for consumer
DataUserConsumer.ExMode := True;
// Set consumer name
DataUserConsumer.Name := "Custom consumer";
// Visual representation of consumer in task
CreateWXC(DataUserConsumer, EtlTask);
// Save changes
Mobj.Save;
End Sub UserProc;
// Create a visual object of data source
Sub CreateWXP(CopyObj: IEtlPlainDataProvider; Etltask: IEtltask);
Var
WxDataTrans: IWxRectangle;
WxETLDataTrans: IWxEtlObject;
Begin
WxDataTrans := EtlTask.Workspace.CreateRectangle;
WxDataTrans.Id := CopyObj.Id;
WxETLDataTrans := New WxEtlObject.Create;
WxETLDataTrans.EtlObject := CopyObj;
WxDataTrans.Style.TextPosition := WxTextPosition.Bottom;
WxDataTrans.Style.PictureMarginTop := -10;
WxDataTrans.PinPosition := New GxPointF.Create(20, 20);
WxDataTrans.Extension := WxETLDataTrans As IWxShapeExtension;
End Sub CreateWXP;
// Create a visual object of data consumer
Sub CreateWXC(CopyObj: IEtlPlainDataConsumer; Etltask: IEtltask);
Var
WxDataTrans: IWxRectangle;
WxETLDataTrans: IWxEtlObject;
Begin
WxDataTrans := EtlTask.Workspace.CreateRectangle;
WxDataTrans.Id := CopyObj.Id;
WxETLDataTrans := New WxEtlObject.Create;
WxETLDataTrans.EtlObject := CopyObj;
WxDataTrans.Style.TextPosition := WxTextPosition.Bottom;
WxDataTrans.Style.PictureMarginTop := -10;
WxDataTrans.PinPosition := New GxPointF.Create(40, 40);
WxDataTrans.Extension := WxETLDataTrans As IWxShapeExtension;
End Sub CreateWXC;
After executing the example, two objects are created in the ETL task: user provider and user consumer that use a new version of the IDtUserProviderEx data provider.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Etl;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MObj: IMetabaseObject;
EtlTask: IEtlTask;
DataUserProvider: IEtlPlainDataUserProvider;
DataUserConsumer: IEtlPlainDataUserConsumer;
Begin
// Get repository
MB := Params.Metabase;
// Get ETL task
MObj := MB.ItemById["ETL"].Edit();
EtlTask := MObj As IEtlTask;
//Create the "Custom Provider" object
DataUserProvider := EtlTask.Create(EtlObjectType.eotPlainDataUserProvider) As IEtlPlainDataUserProvider;
// Set single mode for source
DataUserProvider.ExMode := True;
// Set source name
DataUserProvider.Name := "Custom provider";
// Visual view of source in task
CreateWXP(DataUserProvider, EtlTask);
//Create the "Custom Consumer" object
DataUserConsumer := EtlTask.Create(EtlObjectType.eotPlainDataUserConsumer) As IEtlPlainDataUserConsumer;
// Set single mode for consumer
DataUserConsumer.ExMode := True;
// Set consumer name
DataUserConsumer.Name := "Custom consumer";
// Visual view of consumer in task
CreateWXC(DataUserConsumer, EtlTask);
// Save changes
Mobj.Save();
End Sub;
// Create a visual object of data source
Public Shared Sub CreateWXP(CopyObj: IEtlPlainDataProvider; Etltask: IEtltask);
Var
WxDataTrans: IWxRectangle;
WxETLDataTrans: WxEtlObject = New WxEtlObjectClass();
OutPoint: GxPointF = New GxPointFClass();
Begin
WxDataTrans := EtlTask.Workspace.CreateRectangle();
WxDataTrans.Id := CopyObj.Id;
WxETLDataTrans.EtlObject := CopyObj;
WxDataTrans.Style.TextPosition := WxTextPosition.wtpBottom;
WxDataTrans.Style.PictureMarginTop := -10;
OutPoint := WxDataTrans.PinPosition;
OutPoint.Create(20, 20);
WxDataTrans.Extension := WxETLDataTrans As IWxShapeExtension;
End Sub CreateWXP;
// Create a visual object of data consumer
Public Shared Sub CreateWXC(CopyObj: IEtlPlainDataConsumer; Etltask: IEtltask);
Var
WxDataTrans: IWxRectangle;
WxETLDataTrans: WxEtlObject = New WxEtlObjectClass();
OutPoint: GxPointF = New GxPointFClass();
Begin
WxDataTrans := EtlTask.Workspace.CreateRectangle();
WxDataTrans.Id := CopyObj.Id;
WxETLDataTrans.EtlObject := CopyObj;
WxDataTrans.Style.TextPosition := WxTextPosition.wtpBottom;
WxDataTrans.Style.PictureMarginTop := -10;
OutPoint := WxDataTrans.PinPosition;
OutPoint.Create(40, 40);
WxDataTrans.Extension := WxETLDataTrans As IWxShapeExtension;
End Sub CreateWXC;
See also: