IRubricatorInstance.GetRevision

Syntax

GetRevision(Revision: Integer; [Options: DictionaryGetDataOptions = 0]): IRubricatorRevision;

Parameters

Revision. Revision key.

Options. Parameter of getting data. Optional parameter. Default value - DictionaryGetDataOptions.None - getting data for reading.

Description

The GetRevision property returns revision by its key.

Comments

If the Revision parameter passes the Integer.MaxValue value, the method returns the last revision for version time series databases, and the revision that corresponds to actual data for non-version ones.

Example

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

Add links to the Cubes, Dimensions, Metabase, Rds system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    RubDesc: IMetabaseObjectDescriptor;
    RubrIn: IRubricatorInstance;
    DictIn: IMetaDictionaryInstance;
    Record: IMetaDataMemberRecord;
    TSKey: Integer;
    RevDim: IDimInstance;
    DimAtt: IDimAttributesInstance;
    DimA: IDimAttributeInstance;
    RubrRev: IRubricatorRevision;
    i: integer;
Begin
    
// Get repository
    MB := MetabaseClass.Active;
    
// Get time series database
    RubDesc := MB.ItemById("TSDB");
    
// Get opened instance of time series database
    RubrIn := RubDesc.Open(NullAs IRubricatorInstance;
    
// Get time series dictionary data
    DictIn := RubrIn.GetDictionary(RubricatorDictionary.Facts);
    
// Get data of the first time series in dictionary
    Record := DictIn.GetData(1).Record;
    
// Get key of the first time series
    TSKey := Record.Members.FindById("KEY").Value;
    
// Get data of the revision dictionary for the first time series for specific date
    RevDim := RubrIn.RevisionsDimensionPoint(TSKey, DateTime.Parse("01.01.2002 00:00:00"));
    
// Get revision dictionary attributes
    DimAtt := RevDim.Attributes;
    
// Get the "KEY" attribute
    DimA := DimAtt.FindById("KEY");
    
// Get revision key
    i := DimA.Attribute.Key;
    
// Get revision data with the specified key
    RubrRev := RubrIn.GetRevision(i, DictionaryGetDataOptions.EditExisting);
    
// Display revision name in the console window
    Debug.WriteLine(RubrRev.Name);
End Sub UserProc;

After executing the example the revision, to which data of the first time series for January, 1st, 2000 is included, is opened for edit. Revision name is displayed in the console window.

See also:

IRubricatorInstance