IMetabaseUpdateContext.RegisterAttributeIdChange

Syntax

RegisterAttributeIdChange(newObjKey: Integer;
                         AttributeType: 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 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.

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.

See also:

IMetabaseUpdateContext