RegisterStrChange(OldStr: String; NewStr: String);
RegisterStrChange(OldStr: string; NewStr: string);
OldStr. Identifier of the object attribute before update.
NewStr. Identifier of the object attribute after update.
The RegisterStrChange method overrides the identifiers of the update object attributes.
The RegisterStrChange method changes the binding of the attributes of export/import objects in the time series database by replacing the identifiers.
NOTE. This method is used to support old objects, which were not be improved. Use IMetabaseUpdateContext.RegisterAttributeIdChange.
Executing the example requires the C:\Update.pefx update file and a time series database in the repository. The database contains an export object with configured binding of attributes. The provider repository contains one of the attributes of export object is linked with the COUNTRY_RU dictionary, which contains names of the countries in Russian. The consumer repository contains the dictionary of the same purpose with the COUNTRY_EN identifier. This dictionary stores names of the countries in English.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
Update: IMetabaseUpdate;
UpdateCxt: IMetabaseUpdateContext;
Begin
MB := MetabaseClass.Active;
Update := Mb.CreateUpdate;
Update.LoadFromFileNF("C:\Update.pefx");
UpdateCxt := Update.CreateUpdateContext;
UpdateCxt.RegisterStrChange("COUNTRY_RU", "COUNTRY_EN");
Update.ApplyEx(Null, UpdateCxt);
End Sub UserProc;
After executing the example the export object attribute binding will be reconfigured from COUNTRY_RU to COUNTRY_EN.
Executing the example requires the C:\Update.pefx update file and a time series database in the repository. The database contains an export object with configured binding of attributes. The provider repository contains one of the attributes of export object is linked with the COUNTRY_RU dictionary, which contains names of the countries in Russian. The consumer repository contains the dictionary of the same purpose with the COUNTRY_EN identifier. This dictionary stores names of the countries in English.
Add a link to the Metabase system assembly. The specified procedure is an entry point for the .NET assembly.
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Update: IMetabaseUpdate;
UpdateCxt: IMetabaseUpdateContext;
Begin
MB := Params.Metabase;
Update := MB.CreateUpdate();
Update.LoadFromFileNF("C:\Update.pefx", UpdateLoadMode.ulmReplace); ;
UpdateCxt := Update.CreateUpdateContext();
UpdateCxt.RegisterStrChange("COUNTRY_RU", "COUNTRY_EN");
Update.ApplyEx(Null, UpdateCxt);
End Sub;
After executing the example the export object attribute binding will be reconfigured from COUNTRY_RU to COUNTRY_EN.
See also: