IRubricatorInstance.RegenerateMnemo

Syntax

RegenerateMnemo(FactorKeys: Array);

Parameters

FactorKeys - factors keys array, which mnemonics must be regenerated.

Description

The RegenerateMnemo method regenerates factors mnemonics.

Example

Executing the example requires that the repository contains a time series database with the FC_MN identifier.

Sub Main;

Var

DicEdit: IMetaDictionary;

Nams: IMetaAttributeNamings;

Nam: IMetaAttributeNaming;

Ni, Nc: Integer;

Atrs: IMetaAttributes;

Atr: IMetaAttribute;

Dims: ICubeModelDimensionsEx;

Dim: ICubeModelDimensionEx;

Di, Dc: Integer;

Rubricator: IRubricator;

Mb: IMetabase;

RubI: IRubricatorInstance;

Rev: IRubricatorRevision;

FactorKeys: Array Of Integer;

FactsLookup: IRubricatorFactsLookup;

Begin

Mb := MetabaseClass.Active;

Rubricator := Mb.ItemById("FC_MN").Edit As IRubricator;

DicEdit := Rubricator.EditFacts;

Nams := DicEdit.AttributeMnemoNamings;

Atrs := DicEdit.Attributes;

Dims := Rubricator.Dimensions;

// Clearing of names collection

Nc := Nams.Count - 1;

For Ni := Nc To 0 Step - 1 Do

Nam := Nams.Item(Ni);

Nams.Remove(Nam);

End For;

// Installation of mnemonic suffix and prefix

Dc := Dims.Count - 1;

For Di := 0 To Dc Do

Dim := Dims.Item(Di);

Atr := Atrs.FindByValuesObject(Dim.DimensionO.Key);

If Atr <> Null Then

Nam := Nams.Add(Atr);

nam.MnemoPrefix := "(";

nam.MnemoSuffix := ")";

nam.NamingFormat := "NAME";

End If;

End For;

// Saving changes

(DicEdit As IMetabaseObject).Save;

// Generate database mnemonics

RubI := (Rubricator As IMetabaseObject).Open(Null) As IRubricatorInstance;

Rev := RubI.OpenRevision(Revision);

FactsLookup := RubI.CreateFactsLookup;

FactorKeys := FactsLookup.LookupFactors;

RubI.RegenerateMnemo(FactorKeys);

End Sub Main;

After executing the example mnemonic suffix and prefix are determined for the time series database (characters ")" and "(" respectively). Then mnemonics are generated according to new rules.

See also:

IRubricatorInstance