Introduction to Diagram Validation
Microsoft Visio Premium 2010 provides a new way for users to check their diagrams to detect common errors and for companies to ensure that employees are following certain diagramming standards. By using the new Diagram Validation feature, you can have Visio verify properties of a diagram and display diagramming issues, you can easily review and fix problems with your diagram.
By providing a way to automatically verify a diagram, Visio reduces the amount of time you must spend manually reviewing diagrams for errors. For example, Visio can detect issues such as shapes that are not labeled or connectors that are not glued to other shapes. Visio also enables companies to enforce a standardized notation, like Business Process Modeling Notation (BPMN), within their organizations to ensure that diagrams are drawn in a consistent manner. With the Diagram Validation feature, the correctness of a diagram can be checked against any 






organization’s business rules.
This article summarizes the different ways to use the Diagram Validation feature, from taking advantage of the out-of-box functionality to developing complex validation rules for a custom solution.
Overview of Diagram Validation
Microsoft Visio Premium 2010 provides Diagram Validation support for the Basic Flowchart, Cross-Functional Flowchart, Six Sigma, Microsoft SharePoint Workflow and BPMN diagrams. Using the Visio user interface (UI), you can easily validate these types of diagram against the provided validation rules. Visio also provides an extensive Diagram Validation API that can be used to implement Diagram Validation support for any diagram type. This support allows companies to develop custom validation rules and functionality to meet their own needs.
Diagram Validation terminology: Rule Sets, Rules and Issues
A validation rule, or simply a rule, represents one condition that a diagram should satisfy. Each rule has some underlying business logic which determines whether this condition has been met. An issue is one case in a diagram where the rule has not been satisfied. Depending on your diagram, you may find multiple issues associated with the same rule. For example, if the rule requires that all shapes be labeled, then the Diagram Validation feature will display an issue for each shape without a label.
Rule sets are logical groupings of rules, such as the BPMN and flowchart rule sets. To see which rule sets are available in your current diagram, on the Process tab, click the arrow next to Check Diagram and then click Rules to Check. Rule sets with a checkmark beside them are 






active—only rules from active rule sets will be evaluated during Diagram Validation. Clicking on a rule set will toggle it between active and inactive.
Figure 1: Rule Sets in a Diagram

Basic Flowchart, Cross-Functional Flowchart, Six Sigma, Microsoft SharePoint Workflow and BPMN diagrams created in Visio 2010 already contain an appropriate rule set, and corresponding rules, for the particular diagram type.
Validating a Diagram using the User Interface
You can access the Diagram Validation functionality from the Process tab in Visio Premium 2010. While working on a diagram with an active rule set, click the Check Diagram button to see whether the diagram has any issues.
Figure 2: The Process tab

Visio will either tell you that there are no issues in the diagram, or list the issues in the Issues window. Figure 3 shows a basic flowchart diagram in which a connector is not attached to the next shape in the flowchart. When you click Check Diagram, Visio displays two issues with the diagram. You can click on an issue in the Issues window to navigate to the page or shape associated with the issue.
Figure 3: Validation Issues Window

Once you fix the listed issues, you can click Check Diagram button to confirm that there are no longer any issues with the diagram.
Sometimes you may find that an issue does not apply to a certain shape in your diagram. When this happens, you can ignore the issue and Visio will not display it in the Issues window. If a rule does not apply to the entire diagram, you can also ignore the rule so that no issues associated with the rule are displayed. As shown in Figure 4, you can do this by right-clicking an issue in the Issues window, and selecting the appropriate option.
Figure 4: Ignoring a Validation Issue

When a rule set is evaluated during Diagram Validation, ignored rules are still checked and issues associated with these rules are still detected. By default, however, ignored issues and issues associated with ignored rules are not visible in the Issues window. Using the menu shown in Figure 4, you can choose to display the ignored issues or stop ignoring a rule or issue. You can also use this menu to rearrange issues in the Issues window so that issues are sorted by rule, category or page.
Importing Rule Sets using the User Interface
Using the Visio UI, you can import the flowchart rule set into any diagram and transfer any rule set from one diagram to another. The ability to import rule sets into a diagram is particularly useful when you are working with diagrams created using previous versions of Visio, because, by default, these diagrams do not have validation rules. If you create a diagram in Visio 2010 from the Basic Flowchart, Cross-Functional Flowchart, Six Sigma, Microsoft SharePoint Workflow or BPMN template, you already have the appropriate rule set in your diagram and do not need to import rule sets.
To import the flowchart rule set into any flowchart diagram, open the diagram in Microsoft Visio Premium 2010. Then, on the Process tab, click the arrow next to Check Diagram, click Import Rules From, and then Flowchart Rule Set, as shown in Figure 5. The flowchart rule set is always listed as a rule set that can be imported into your diagram.
Figure 5: Importing Rules into a Diagram

To import rule sets from another diagram, first ensure that this diagram in open in Visio. Then, on the Process tab, click the arrow next to Check Diagram, click Import Rules From, and then select the name of the open diagram containing the rule sets to import.
Working with the Issues Window by using the User Interface
If you save a diagram that has issues, these issues are saved with your diagram and are available when you open the diagram again. Validation issues also stay in the diagram if the Issues window is closed. This allows you to fix issues with your diagram over time without having to rerun Diagram Validation.
As shown in Figure 6, there is a check box on the Process tab that controls the visibility of the Issues window. This can be useful, for example, if you want to close the Issues window when showing the diagram to others, and then open it again later to fix any remaining issues in your diagram.
Figure 6: The Issue Window check box toggles the visibility of the Issues window

Removing Diagram Validation Information using the User Interface
Because issues are saved in your diagram, whoever opens the diagram can view the issues by clicking the Process tab and then selecting the Issues Window check box. The Issues window opens with the saved issues. You can remove saved issues from your diagram along with other personal information using the following steps.
1. Click on the File tab.
2. Click Info, and then click Remove Personal Information.
3. On the Personal Information tab, select Remove these items from the document.
Rule sets and rules are also stored as part of your diagram. You can remove inactive rule sets from a diagram to reduce the file size before sharing it. This also prevents others from using these rule sets to validate your diagram. We recommend that you remove rule set only from a final document, because this removal is permanent.
Before you remove a rule set from your diagram, you must mark it as inactive.
1. On the Process tab, click the arrow next to Check Diagram.
2. Click Rules to Check.
3. If the rule set has a check mark next to it, click on the rule to make it inactive.
Once the rule set that you want to remove is inactive, you can remove it as follows.
1. Click on the File tab.
2. Click Info, and then click Reduce File Size.
3. Select Remove Inactive validation rule sets.