Metric definition is the attribute of a Metric Suite with the «MetricDefinition» stereotype applied.
To build a metric definition
- Select the shape of a Metric Suite.
- Click the Create Element button on the shape, and then select Metric Definition. An attribute with the «MetricDefinition» stereotype is created.
- Type its name directly on the shape and then click a free space on the diagram.
- Select the attribute on the shape and click .
Select the type of the result values that should be calculated according to the formula specified in a metric definition.
This step is mandatory. A metric definition must have a result type, e.g., Real or Integer.
Press Enter to open the Specification window of the metric definition.
- Click the cell of the Default Value property value. and appear on the cell.
- Click and select Value Specification > Opaque Expression.
Click the cell of the Default Value property value again, and then click. The Default Value dialog opens.
From the Language drop-down list, select a language.
To build a structured expression, select StructuredExpression.
In the Body box, specify the formula for the metric definition. For more information about building structured expressions, see Specifying criteria for querying model.
- Click OK and then click Close in the Specification window.
The metric definition is specified.
If your Metric Suite is created using the BaseMetricSuite, it already has the metric definition for date tracking.
One metric definition can refer to another metric definition of either the same Metric Suite or a more general one (in case there is the Generalization relationship between these Metric Suites).