ICubeMetaUpdateEx.MetafactsAttributeRemappings

Fore Syntax

MetafactsAttributeRemappings: ICubeMetaUpdateAttributeRemappings;

Fore.NET Syntax

MetafactsAttributeRemappings: Prognoz.Platform.Interop.Cubes.ICubeMetaUpdateAttributeRemappings;

Description

The MetafactsAttributeRemappings property returns the collection of correspondences between time series attributes of the replicated database and time series attributes of database copy.

Comments

To determine the collection of correspondences of observation attributes of the replicated database and the database copy, use the ICubeMetaUpdateEx.MetavalsAttributeRemappings property.

Fore Example

Executing the example requires that the repository contains a time series database with the FC identifier containing the COUNTRY custom time series attribute and a time series database with the FC_COPY identifier containing the A_COUNTRY custom time series attribute. These attributes must have the same characteristics.

Add links to the Metabase, Cubes system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    Obj: IMetabaseObject;
    ObjDesc: IMetabaseObjectDescriptor;
    RubUpdateEx: ICubeMetaUpdateEx;
    Rub: IRubricator;
    AttrRemapping: ICubeMetaUpdateAttributeRemappings;
    AttrR: ICubeMetaUpdateAttributeRemapping;
Begin
    mb := MetabaseClass.Active;
    CrInfo := Mb.CreateCreateInfo;
    CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_CUBEMETAUPDATE;
    CrInfo.Id := Mb.GenerateId("Cube_Meta_Upd");
    CrInfo.Permanent := True;
    CrInfo.Parent := Mb.Root;
    ObjDesc := Mb.CreateObject(CrInfo);
    Obj := ObjDesc.Edit;
    RubUpdateEx := Obj As ICubeMetaUpdateEx;
    Rub := mb.ItemById("FC").Bind As IRubricator;
    RubUpdateEx.Rubricator := Rub;
    RubUpdateEx.Metabase := Mb;
    RubUpdateEx.RdsDatabase := Rub.Database;
    RubUpdateEx.TargetRubricator := mb.ItemById("FC_COPY_").Bind As IRubricator;
    AttrRemapping := RubUpdateEx.MetafactsAttributeRemappings;
    AttrR := AttrRemapping.FindById("A_COUNTRY");
    AttrR.Source := "COUNTRY";
    AttrR.Type := CubeMetaUpdateAttributeRemappingType.Source;
    Obj.Save;
End Sub UserProc;

After executing the example the correspondence is set between the A_COUNTRY and COUNTRY attributes: when data is copied from the FC database to the FC_COPY database, data of the COUNTRY attribute is copied to the A_COUNTRY attribute. The object that contains replication settings is saved with the Cube_Meta_Upd identifier.

Fore.NET Example

The requirements and result of Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Cubes;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    Obj: IMetabaseObject;
    ObjDesc: IMetabaseObjectDescriptor;
    RubUpdateEx: ICubeMetaUpdateEx;
    Rub: IRubricator;
    AttrRemapping: ICubeMetaUpdateAttributeRemappings;
    AttrR: ICubeMetaUpdateAttributeRemapping;
Begin
    mb := Params.Metabase;
    CrInfo := Mb.CreateCreateInfo();
    CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_CUBEMETAUPDATE As integer;
    CrInfo.Id := Mb.GenerateId("Cube_Meta_Upd"0);
    CrInfo.Permanent := True;
    CrInfo.Parent := Mb.Root;
    ObjDesc := Mb.CreateObject(CrInfo);
    Obj := ObjDesc.Edit();
    RubUpdateEx := Obj As ICubeMetaUpdateEx;
    Rub := mb.ItemById["FC"].Bind() As IRubricator;
    RubUpdateEx.Rubricator := Rub;
    RubUpdateEx.Metabase := Mb;
    RubUpdateEx.RdsDatabase := Rub.Database;
    RubUpdateEx.TargetRubricator := mb.ItemById["FC_COPY_"].Bind() As IRubricator;
    AttrRemapping := RubUpdateEx.MetafactsAttributeRemappings;
    AttrR := AttrRemapping.FindById("A_COUNTRY");
    AttrR.Source := "COUNTRY";
    AttrR.Type := CubeMetaUpdateAttributeRemappingType.cmuartSource;
    Obj.Save();
End Sub;

See also:

ICubeMetaUpdateEx