RegisterAttributeIdChange(newObjKey: Integer;
AttributeType: MetabaseUpdateRemappingType;
oldAttributeId: String;
newAttributeId: String);
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.
The RegisterAttributeIdChange method redetermines identifiers of update object attributes.
The RegisterAttributeIdChange method changes the binding of the attributes of export/import objects in the time series database by replacing the identifiers.
Executing the example in repository requires:
Time series database. Time series database has the 39512 key. It contains two added series attributes. Attribute identifiers are ATTR1 and ATTR2.
An update file with the AttrRemap.pefx name in the root of the C disc. This file is an update for the above specified time series database.
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: