Defining custom metrics and rules for UML models by using templates

You can create custom UML metrics to collect on a UML model in addition to the 19 metrics that are available by default. You can also create custom UML review rules to supplement the 15 rules that are available by default. Two templates are available for creating custom UML metrics. Four templates are available for creating custom UML review rules. You can add custom rules and metrics to existing analysis configurations or to new analysis configurations.

To create custom metrics and rules for UML models by using templates:

  1. Click Window > Preferences.
  2. Expand Analysis and click Custom rules and categories.
  3. To add a custom category, complete the following steps:
    1. On the Custom rules and categories page, click Add Category.
    2. In the Add Custom Category window, on theChoose Parent Category Location page, either select Model metrics for UML or Model review for UML; then click Next.
    3. In the Name field, type a name for a category and click Finish. The new category is displayed in the Current Custom Categories list.
  4. To add a custom rule, complete the following steps:
    1. On the Custom rules and categories page, click Add Rule.
    2. In the Add custom rule window, on the Choose a parent category page, either select one of the categories listed under Model Review for UML or Model Metrics for UML; then click Next.
    3. On the Select Template page, select one of templates and click Next.
    4. On the Assign Template Values page, follow the instructions in the Description field to fill in the template values and click Finish. The new rule is displayed in the Current Custom Rules list.
  5. Optional: To export custom rules, click Export, type a name for the export file and click Save. The custom rules are saved in a file with .ccr as a file name extension.
  6. Optional: To import custom rules, click Import, browse to a file with .ccr as a file name extension, and click Open.
  7. Optional: To delete a custom category, complete the following steps:
    1. In the Current Custom Rules list, select a rule from a category you want to delete and click Delete Rule. Repeat for all rules in the category.
    2. In the Current Custom Categories list, select a category to delete and click Delete Category.

Feedback