FetchItem(Key: Integer; [Options: Integer = 0]): IMetabaseObjectDescriptor;
FetchItem(Key: uinteger; Options: integer): Prognoz.Platform.Interop.Metabase.IMetabaseObjectDesriptor;
Key. Internal object key.
Options. Settings of the deferred loading of descriptions type by identifiers.
The FetchItem method returns the description of the object or the object, for which the deferred loading of the description attribute is set by the key.
The example of the object with the deferred loading of the description is the internal model of the metamodel calculation chain. The example of internal model creation is given in description of theIMsCalculationChainEntries.AddExclusiveModel.
The type of linked objects which require to download the description is specified in the Options parameter. If the memory of the computer contains cached descriptions then the method will load them.
If the repository uses the deferred loading of descriptions, then on executing the method the description of the object will be cached in memory. On the following requests the description will be taken from the cache of the Computer. However for the objects for which the IMetabaseObjectDescriptor.IsDeferred attribute is set, the descriptions will not be cached. Working with these objects will be performed by the Fetch* methods.
Executing the example requires that the repository contains an internal object with the 123 key.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
ObjDesc: IMetabaseObjectDescriptor;
Begin
MB:= MetabaseClass.Active;
ObjDesc:= MB.FetchItem(123);
Debug.WriteLine (ObjDesc.Name);
End Sub UserProc;
Public Sub Main(Params: StartParams);
Var
MB: IMetabase;
ObjDesc: IMetabaseObjectDescriptor;
Begin
MB := Params.Metabase;
ObjDesc := MB.FetchItem(123, 0);
System.Diagnostics.Debug.WriteLine(ObjDesc.Name);
End Sub;
After executing this example the inner object name is displayed into development environment console.
See also: