It opens the Data Mining tool.
Command parameters are sent in the IUiCommandExecutionContext.Data property as an array of the Variant type, which elements contain the values:
Value type | Description |
Element 1: IDmTableDataSource | Table data source for data mining. |
Element 2: DmMethodKind | Data mining method. |
The displayed dialog box depends on whether parameters are set.
Parameters are set. A dialog box of the specified data mining method is displayed.
Parameters are not set. A dialog box to select data for analysis is displayed.
Executing the example requires a form containing a button with the Button1 identifier.
It is required that the repository contains a table with the TABLE identifier containing data for analysis.
Add links to the Db, Fore, Metabase, Ms, Stat, UI system assemblies.
The example is a handler of the OnClick event for the Button1 button.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Mb: IMetabase;
Table: ITable;
DataSource: IDmTableDataSource;
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
Arg: array Of Variant;
Begin
// Get current repository
Mb := MetabaseClass.Active;
// Get table
Table := Mb.ItemById("TABLE").Bind As ITable;
// Create a data source that is table
DataSource := (New TableDataSource.Create) As IDmTableDataSource;
DataSource.Table := Table As IMetabaseObjectDescriptor;
// Get the Ms plugin
Target := WinApplication.Instance.GetPluginTarget("Ms");
// Create a context to execute a command
Context := Target.CreateExecutionContext;
// Create command parameters array
Arg := New Variant[2];
Arg[0] := DataSource;
Arg[1] := DmMethodKind.DecisionTree;
// Send command parameters array
Context.Data := Arg;
// Execute the command
Target.Execute("ShowDataMiningWizard", Context);
End Sub Button1OnClick;
After executing the example, clicking the Button1 button displays the Data Mining dialog box, the Pattern Substitution analysis type, the Decision Tree method.
See also: