IMetabase.ElementDependenciesDatabase

Syntax

ElementDependenciesDatabase: IMbElementDependenciesDatabase;

ElementDependenciesDatabase: Prognoz.Platform.Interop.Metabase.IMbElementDependenciesDatabase;

Description

The ElementDependenciesDatabase property returns an object meant for working with object dependencies on MDM dictionary elements.

Comments

To check whether it is possible to work with dependencies, use the IMbElementDependenciesDatabase.Active property.

Example

Executing this example requires that the repository contains a regular report with the Report_1 identifier. This report uses any data sources that are based on MDM dictionaries. Tracking of dependencies on MDM dictionary elements is activated for the report and dictionaries.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    DepDB: IMbElementDependenciesDatabase;
    Template: IMbElementDependencyTemplate;
    Depends: IMbElementDependencies;
    Depend: IMbElementDependency;
    Dict: IRdsDictionary;
    Elements: IRdsDictionaryElements;
Begin
    MB := MetabaseClass.Active;
    DepDB := MB.ElementDependenciesDatabase;
    Template := New MbElementDependencyTemplateClass.CreateByObject(MB.GetObjectKeyById("Report_1"));
    Depends := DepDB.Select_(Template);
    Debug.WriteLine("Object dependencies");
    For Each Depend In Depends Do
        Dict := Depend.Dictionary.Bind As IRdsDictionary;
        Debug.Write("Dictionary: " + Depend.Dictionary.Name);
        Elements := Dict.Open(Null).Elements;
        Debug.WriteLine("; Element: " + Elements.Name(Depend.ElementKey));
    End For;
End Sub UserProc;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    DepDB: IMbElementDependenciesDatabase;
    DependencyTemplateClass: MbElementDependencyTemplateClassClass = New MbElementDependencyTemplateClassClass();
    Template: MbElementDependencyTemplateClass;
    Depends: IMbElementDependencies;
    Depend: IMbElementDependency;
    Dict: IRdsDictionary;
    Elements: IRdsDictionaryElements;
Begin
    MB := Params.Metabase;
    DepDB := MB.ElementDependenciesDatabase;
    DependencyTemplateClass.CreateByObject(MB.GetObjectKeyById("Report_1"));
    Template := DependencyTemplateClass As MbElementDependencyTemplateClass;
    Depends := DepDB.@Select(Template);
    System.Diagnostics.Debug.WriteLine("Object dependencies");
    For Each Depend In Depends Do
        Dict := Depend.Dictionary.Bind() As IRdsDictionary;
        System.Diagnostics.Debug.Write("Dictionary: " + Depend.Dictionary.Name);
        Elements := Dict.Open(Null).Elements;
        System.Diagnostics.Debug.WriteLine("; Element: " + Elements.Name[Depend.ElementKey As UInt32]);
    End For;
End Sub;

Information about regular report dependencies on MDM dictionaries elements is obtained when executing the example. Names of dictionaries and elements are displayed in a development environment console.

See also:

IMetabase