Using basic capabilities > Overview of using basic capabilities > Analytics > Analytic definition
  
Analytic definition
The analytic definition type enables you to control invocation of an analytic (see Analytics) on a diagram or on the information in the repository as a whole. The analytic definition provides a user interface for you to specify the macro Module and the Function to run for the analytic. You can specify values for parameters to determine whether to depict the analytic with icons or fill color.
To create an analytic definition
1 Open the encyclopedia in which you want to create your Analytic definition.
2 With the Explorer showing the All pane, right-click the Definition node, and then click New.
3 Select the Analytic from the list of definition types, and then click OK.
4 Enter a name for your Analytic definition, and then click OK.
5 In the Analytic type property you have the option to choose Report-based or Macro-based. The default is Macro-based, click OK. The definition editor is displayed, showing the Macro tab.
6 Enter your values in the Macro tab.
7 The Macro tab has two pages, which let you specify the macro to run for the analytic, and the properties and parameters. Enter values for the fields in the Macro tab as follows:
Description
Describes the purpose of the analytic (see the sample description in the Application Portfolio definition below).
Project
Specify the Microsoft Visual Basic Application macro project that the analytic code is contained in.
Module
Specify the Microsoft Visual Basic Application macro module that the analytic code is contained in.
Function
Specify the Microsoft Visual Basic Application function that the analytic code is contained in.
Auto run on drag and drop
Select this if you want to have your analytic run when you drag and drop it onto the diagram workspace of a diagram type that the analytic is associated with. If you do not select this option, you can run the analytic from the Heat Map Manager, when you open a diagram type that the Analytic has been associated with.
Parameters
This field is on Page 2 of 2 of the Macro tab. If your analytic macro has parameters specified that you can set values to, specify those parameters here, and specify the values in the Default Value field. For example, you could build a macro to visually indicate classes on a class diagram that have less than 5 methods (indicating this with a traffic light with a red light illuminated), 7 or more methods (with a traffic light illuminated green), and 5-7 methods (with a traffic light illuminated yellow). You could specify these thresholds as parameters, named low, medium, and high. After building the macro and creating an Analytic definition type to run it, you could change the parameter values in the Analytic definition type without having to alter the macro code. The sample below shows the Macro tab for the “Application Portfolio” analytic definition.
This graphic is described in the surrounding text.
8 Click the Analytic Depiction tab.
The Analytic Depiction tab captures information on how to depict the Analytic, that is, as with an icon or fill color on symbols, legends, and the Heat Map Manager. The Analytic Depiction tab provides the following information:
Icon File to use
Icon files are used as indicators in the Heat Map Manager and on legends inside diagrams. The icon file you specify is passed as a parameter to the analytic, and used on a legend in the diagram. Click Browse Externally to navigate to a metafile (bitmaps are not supported) outside of the encyclopedia, or click Browse Internally to select a file that has been added to the encyclopedia’s file table. To pick an “internal” icon file, the file must already be present in the encyclopedia's file table. Optionally, you can click Open to open the metafile you selected with your default metafile viewer or editor.
Fill Color
Colors are used as indicators in the Heat Map Manager and on legends inside diagrams. If a color is defined, it is passed as parameter to the analytic, and used on a legend inside the diagram that the analytic is run against. A color picker is provided for you to select standard or custom colors. If you specify a Fill Color and an Icon file to use, both are passed as parameters to the analytic but the icon file(s) is used in the legend and as an icon on symbols that satisfy the analytic criteria. If you select a Fill Color, and later decide that you no longer want to use one, you can click No Color to remove it.
9 Click OK.
You can now invoke the Analytic definition you created by dragging and dropping it onto a diagram, or by adding it to an Analytic Collection definition and running it from the Heat Map Manager.
See also
Analytic collection definition
Analytic examples in System Architect
Building analytics
Heat Map Manager
Analytics