IMetabaseUpdateContext.RegisterAttributeIdChange

Fore Syntax

RegisterAttributeIdChange(newObjKey: Integer;
                         AttributeType: MetabaseUpdateRemappingType;
                         oldAttributeId: String;
                         newAttributeId: String);

Fore.NET Syntax

RegisterAttributeIdChange(newObjKey: uinteger;
                         AttributeType: Prognoz.Platform.Interop.Metabase.MetabaseUpdateRemappingType;
                         oldAttributeId: string;
                         newAttributeId: string);

Parameters

newObjKey. Repository object key after update.

AttributeType. Repeated attribute mapping type. Use values of MetabaseUpdateRemappingType.MetafactsAttribute and MetabaseUpdateRemappingType.MetavalsAttribute.

oldAttributeId. Identifier of the object attribute before update.

newAttributeld. Identifier of the object attribute after update.

Description

The RegisterAttributeIdChange method redetermines identifiers of the update object attributes.

Comments

The RegisterAttributeIdChange method changes the binding of the attributes of export/import objects in the time series database by replacing the identifiers.

Fore Example

Executing the example in repository requires:

Add links to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    Update: IMetabaseUpdate;
    Context: IMetabaseUpdateContext;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Create an update from file
    Update := Mb.CreateUpdate;
    Update.LoadFromFileNF("C:\AttrRemap.pefx", UpdateLoadMode.Replace);
    Context := Update.CreateUpdateContext;
    // Rename series attribute identifiers of time series database
    Context.RegisterAttributeIdChange(39512, MetabaseUpdateRemappingType.MetafactsAttribute, "ATTR2""ATTR1");
    Context.RegisterAttributeIdChange(39512, MetabaseUpdateRemappingType.MetafactsAttribute, "ATTR1""ATTR2");
    // Apply update
    Update.ApplyEx(Null, Context);
End Sub UserProc;

After executing the example, time series database is updated in the repository with the specified key, the specified attribute identifiers are renamed.

Fore.NET Example

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

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Update: IMetabaseUpdate;
    Context: IMetabaseUpdateContext;
Begin
    // Get repository
    MB := Params.Metabase;
    // Create an update from file
    Update := Mb.CreateUpdate();
    Update.LoadFromFileNF("C:\AttrRemap.pefx", UpdateLoadMode.ulmReplace);
    Context := Update.CreateUpdateContext();
    // Rename series attribute identifiers of time series database
    Context.RegisterAttributeIdChange(39512, MetabaseUpdateRemappingType.murtMetafactsAttribute, "ATTR2""ATTR1");
    Context.RegisterAttributeIdChange(39512, MetabaseUpdateRemappingType.murtMetafactsAttribute, "ATTR1""ATTR2");
    // Apply update
    Update.ApplyEx(Null, Context);
End Sub;

See also:

IMetabaseUpdateContext