ICubeMetaUpdateEx.PrerequisiteObjects

Syntax

PrerequisiteObjects: ICubeMetaUpdateAdditionalObjects;

Description

The PrerequisiteObjects property returns the collection of objects, which are to be copied before a time series database is copied.

Comments

The objects specified in this collection are copied before the time series database, so they can be independent of it. This collection is used to copy various MDM dictionaries and other external objects that can affect the time series database or its content.

Example

Executing the example requires that the repository contains a time series database with the FC identifier. An attribute that refers to the MDM dictionary Users is created in this database. This dictionary is stored in the MDM repository with the NSI_1 identifier.

Sub UserProc;
Var
    Mb: IMetabase;
    Update: ICubeMetaUpdateEx;
    Rubr: IRubricator;
    Dict: IMetabaseObjectDescriptor;
    Prerequisite: ICubeMetaUpdateAdditionalObjects;
    PrerequisiteDict: ICubeMetaUpdateAdditionalObject;
    DataSettings: ICubeMetaUpdateAdditionalObjectDataSettings;
Begin
    Mb := MetabaseClass.Active;
    Update := New CubeMetaUpdateClass.Create As ICubeMetaUpdateEx;
    // Copied time series database
    Rubr := Mb.ItemById("FC").Bind As IRubricator;
    Update.Rubricator := Rubr;
    //Copy together with  data
    Update.CopyData := True;
    //Objects copied earlier than the database
    Prerequisite := Update.PrerequisiteObjects;
    Dict := Mb.ItemByIdNamespace("Users", Mb.ItemById("NSI_1").Key);
    PrerequisiteDict := Prerequisite.Add(Dict);
    //Copy the MDM dictionary together with the child objects
    // (selection schemas, groups of elements, alternative hierarchies);
    PrerequisiteDict.IncludeChildren := True;
    //Parameters of copying the data
    DataSettings := PrerequisiteDict.DataSettings;
    DataSettings.BatchMode := ObjectUpdateDataBatchMode.InsertOnly;
    DataSettings.IncludeData := True;
    DataSettings.ReferenceConstraintsHandling := UpdateDataConstraintsHandlingType.ErrorBreak;
    DataSettings.UpdateRdsSequence := True;
    Update.Save("c:\Fc.zip");
End Sub UserProc;

On executing the example the time series database is copied and saved to the Fc.zip file. The MDM repository, on which the database depends, is also included in the copy. The dictionary is copied with all child objects. Also parameters of copying the data is determined for the dictionary. As time series databases depend on dictionaries, on creating a database copy first the MDM dictionary is copied. On copying the value of the repository system sequence is refreshed.

See also:

ICubeMetaUpdateEx