ICubeMetaUpdateEx.PrerequisiteObjects

Fore Syntax

PrerequisiteObjects: ICubeMetaUpdateAdditionalObjects;

Fore.NET Syntax

PrerequisiteObjects: Prognoz.Platform.Interop.Cubes.ICubeMetaUpdateAdditionalObjects;

Description

The PrerequisiteObjects property returns the collection of objects that must be replicated before a time series database is copied.

Comments

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

Fore 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;
    // Replicated time series database
    Rubr := Mb.ItemById("FC").Bind As IRubricator;
    Update.Rubricator := Rubr;
    // Replicate together with data
    Update.CopyData := True;
    // Objects replicated before database
    Prerequisite := Update.PrerequisiteObjects;
    Dict := Mb.ItemByIdNamespace("Users", Mb.ItemById("NSI_1").Key);
    PrerequisiteDict := Prerequisite.Add(Dict);
    // Replicate MDM dictionary together with child objects
    // (selection schemas, groups of elements, alternative hierarchies);
    PrerequisiteDict.IncludeChildren := True;
    // Data replication parameters
    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 replicated and saved to the Fc.zip file. The MDM repository, on which the database depends, is also included in the copy. The dictionary is replicated with all child objects. Data replication parameters are also determined for the dictionary. As time series database depends on the dictionary, on creating a database copy first the MDM dictionary is replicated. The dictionary and the database are replicated together with data. On replication the value of the repository system sequence is refreshed.

Fore.NET Example

The requirements and result of Fore.NET example execution match with those in the Fore example.

Public Shared Sub Main(Params: StartParams);
Var
    Mb: IMetabase;
    Update: ICubeMetaUpdateEx;
    Rubr: IRubricator;
    Dict: IMetabaseObjectDescriptor;
    Prerequisite: ICubeMetaUpdateAdditionalObjects;
    PrerequisiteDict: ICubeMetaUpdateAdditionalObject;
    DataSettings: ICubeMetaUpdateAdditionalObjectDataSettings;
Begin
    Mb := Params.Metabase;
    Update := New CubeMetaUpdateClass() As ICubeMetaUpdateEx;
    // Replicated time series database
    Rubr := Mb.ItemById["FC"].Bind() As IRubricator;
    Update.Rubricator := Rubr;
    // Replicate together with data
    Update.CopyData := True;
    // Objects replicated before database
    Prerequisite := Update.PrerequisiteObjects;
    Dict := Mb.ItemByIdNamespace["Users", Mb.ItemById["NSI_1"].Key];
    PrerequisiteDict := Prerequisite.Add(Dict);
    // Replicate MDM dictionary together with child objects
    // (selection schemas, groups of elements, alternative hierarchies);
    PrerequisiteDict.IncludeChildren := True;
    // Data replication parameters
    DataSettings := PrerequisiteDict.DataSettings;
    DataSettings.BatchMode := ObjectUpdateDataBatchMode.obupdabamoInsertOnly;
    DataSettings.IncludeData := True;
    DataSettings.ReferenceConstraintsHandling := UpdateDataConstraintsHandlingType.udchtErrorBreak;
    DataSettings.UpdateRdsSequence := True;
    Update.Save("c:\Fc.zip");
End Sub;

See also:

ICubeMetaUpdateEx