IMetabase.GetItems

Syntax

GetItems(Keys: Array): IMetabaseObjectDescriptors;

GetItems(Keys: System.Array): Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptors;

Parameters

Keys. Integer array containing object keys.

Description

The GetItems method returns the collection of description of the objects, which keys are passed by the Keys parameter.

Comments

Only existing objects are included in the collection. If an object with any key is not found, this key is skipped. And the exception error is not generated.

Example

Executing the example, the repository requires objects with the 5781 and 5782 keys.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    mb: IMetabase;
    key: Array[2Of Integer;
    MDescs: IMetabaseObjectDescriptors;
    Desc: IMetabaseObjectDescriptor;
    i: Integer;
Begin
    mb := MetabaseClass.Active;
    key[0] := 5781;
    key[1] := 5782;
    MDescs := mb.GetItems(key);
    For i := 0 To MDescs.Count - 1 Do
        Desc := MDescs.Item(i);
        Debug.WriteLine("Identifier: " + Desc.Id + "; Name: " + Desc.Name);
    End For;
End Sub UserProc;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    key: Array[2Of Integer;
    MDescs: IMetabaseObjectDescriptors;
    Desc: IMetabaseObjectDescriptor;
    i: Integer;
Begin
    mb := Params.Metabase;
    key[0] := 5781;
    key[1] := 5782;
    MDescs := mb.GetItems(key);
    For i := 0 To MDescs.Count - 1 Do
        Desc := MDescs.Item[i];
        System.Diagnostics.Debug.WriteLine("Identifier: " + Desc.Id + "; Name: " + Desc.Name);
    End For;
End Sub;

After executing the example the console window will show identifiers and names corresponding to the objects with set keys.

See also:

IMetabase