RegisterAttributeIdChange(newObjKey: Integer;
AttributeType: MetabaseUpdateRemappingType;
oldAttributeId: String;
newAttributeId: String);
RegisterAttributeIdChange(newObjKey: uinteger;
AttributeType: Prognoz.Platform.Interop.Metabase.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 the 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 disk C root. 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.
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: