IEtlPlainDataUserProvider.ExMode

Fore Syntax

ExMode: Boolean;

Fore.NET Syntax

ExMode: boolean;

Description

The ExMode property determines whether user provider supports Fore.NET along with Fore.

Comments

Available values:

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.

Fore Example

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(2020);
    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(4040);
    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.

Fore.NET Example

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(2020);
    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(4040);
    WxDataTrans.Extension := WxETLDataTrans As IWxShapeExtension;
End Sub CreateWXC;

See also:

IEtlPlainDataUserConsumer