IRubricator.CreateFacts

Syntax

CreateFacts;

Description

The CreateFacts method creates a composite dictionary in the MDM repository to store information about factors of time series database.

Example

Executing the example requires that the repository contains a database with the BD identifier.

Sub Main;

Var

Mb: IMetabase;

NewRDS: IRdsDatabase;

NewRub: IRubricator;

CrInfo: IMetabaseObjectCreateInfo;

Begin

Mb := MetabaseClass.Active;

//Create MDM repository

CrInfo := MB.CreateCreateInfo;

CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_RDS_DATABASE;

CrInfo.Id := "NewNSI";

CrInfo.Name := "NewNSI";

CrInfo.Parent := MB.Root;

CrInfo.Permanent := True;

NewRDS := MB.CreateObject(CrInfo).Edit As IRdsDatabase;

NewRDS.Database := Mb.ItemById("BD").Bind As IDatabase;

(NewRDS As IMetabaseObject).Save;

//Create a time series database

CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_RUBRICATOR;

CrInfo.Id := "NewCatalog";

CrInfo.Name := "NewCatalog";

CrInfo.Parent := MB.Root;

CrInfo.Permanent := True;

NewRub := MB.CreateObject(CrInfo).Edit As IRubricator;

NewRub.Database := NewRDS;

//Create basic dictionaries in the MDM repository

NewRub.CreateMeasures;

NewRub.CreateUnits;

NewRub.CreateFacts;

NewRub.CreateRevisions;

NewRub.CreateValues;

(NewRub As IMetabaseObject).Save;

End Sub Main;

After executing the example an MDM repository and a time series database are created in the repository root. All basic dictionaries required for working with the time series database are created in the MDM repository.

See also:

IRubricator