GetRubricatorDesc Command

Purpose

It determines a time series database that contains a modeling object.

Parameters of Use

Command parameters are passed in the IUiCommandExecutionContext.Data property. Executing the command requires to specify the following value in this property:

Value type Description
IMetabaseObjectDescriptor Repository object.

Application Features

The command returns only time series databases.

Example

Executing the example requires a form containing a button named Button1 and the UiModel component named UiModel1.

It is required that the repository contains a time series database that includes a modeling container with a model. This model is specified as an object for the UiModel component.

Add links to the Fore, KeFore, Metabase, Ms, UI system assemblies.

The example is a handler of the OnClick event for the Button1 button.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Result: IMetabaseObjectDescriptor;
    Key: Integer;
Begin
    Key := UiModel1.Object.Key;
    
// Execute function
    Result := GetSmhDesc(Key, "GetRubricatorDesc");
    
// Display value
    WinApplication.InformationBox(Result.Name + " (" + Result.Id + ")");
End Sub Button1OnClick;

Function GetSmhDesc(Key: Integer; Plugin: String): IMetabaseObjectDescriptor;
Var
    Mb: IMetabase;
    Desc, Result: IMetabaseObjectDescriptor;
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
Begin
    
// Get current repository
    Mb := MetabaseClass.Active;
    Desc := Mb.Item(Key);
    
// Get the Ms plugin
    Target := WinApplication.Instance.GetPluginTarget("Ms");
    
// Create a context to execute a command
    Context := Target.CreateExecutionContext;
    
// Send command parameter
    Context.Data := Desc;
    
// Execute command
    Result := Target.Execute(Plugin, Context) As IMetabaseObjectDescriptor;
    
Return Result;
End Function GetSmhDesc;

After executing the example, clicking the Button1 button displays a message with information about name and identifier of the time series database that contains a modeling container with the specified model.

See also:

IUiCommandTarget.Execute