GetRevision(
Revision: Integer;
[Options: DictionaryGetDataOptions = 0]
): IRubricatorRevision;
GetRevision(
Revision: integer;
Options: Prognoz.Platform.Interop.Rds.DictionaryGetDataOptions
): Prognoz.Platform.Interop.Cubes.IRubricatorRevision;
Revision. Revision key.
Options. Parameter of getting data. Optional parameter. Default value - DictionaryGetDataOptions.None - getting data for reading.
The GetRevision property returns revision by its key.
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.
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(Null) As 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.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Rds;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
RubDesc: IMetabaseObjectDescriptor;
RubrIn: IRubricatorInstance;
DictIn: IMetaDictionaryInstance;
Record: IMetaDataMemberRecord;
TSKey: Integer;
RevDim: IDimInstance;
DimAtt: IDimAttributesInstance;
DimA: IDimAttributeInstance;
RubrRev: IRubricatorRevision;
i: uinteger;
Begin
// Get repository
MB := Params.Metabase;
// Get time series database
RubDesc := MB.ItemById["TSDB"];
// Get opened instance of time series database
RubrIn := RubDesc.Open(Null) As IRubricatorInstance;
// Get time series dictionary data
DictIn := RubrIn.GetDictionary(RubricatorDictionary.rubdicFacts);
// Get data of the first time series in dictionary
Record := DictIn.GetData(1, False).Record;
// Get key of the first time series
TSKey := Record.Members.FindById("KEY").Value As integer;
// Get data of revision dictionary for the first time series for specific date
RevDim := RubrIn.RevisionsDimensionPoint[TSKey As uinteger, 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.dgdoEditExisting);
// Display revision name in the console window
System.Diagnostics.Debug.WriteLine(RubrRev.Name);
End Sub;
See also: