It determines a time series database or a cube that contain a modeling object.
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. |
The command returns both any types of cubes and time series databases.
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, "GetCubeModelDesc");
// Display value
WinApplication.InformationBox(Result.Name + " (" + Result.Id + ")");
End Sub Button1OnClick;
Function GetSmhDesc(Key: Integer; Plugin: String): IMetabaseObjectDescriptor;
Var
Desc, Result: IMetabaseObjectDescriptor;
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
Begin
Desc := MetabaseClass.Active.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 the 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: