Five Visio 2013 templates include predefined validation rule sets. Their existence raises a number of questions, such as the following:
-
Is it possible to use those rule sets with other documents?
-
Is it possible for a diagram to have more than one rule set?
-
How do you find out what rules comprise an existing rule set?
-
Is it possible to modify an existing rule set?
-
Is it possible to create new rules?
In this exercise, you will learn the answer to the first question by
importing a rule set into a flowchart created with Visio 2007. You will
learn the answers to the second and third questions in the text at the
end of this section, and you’ll learn about modifying and creating rule
sets in the next section.
-
On the Process tab, in the Diagram Validation group, click the Check Diagram button.
Visio tells you that the document does not contain any rule sets and
also tells you what to do about it. Because you’ve opened a flowchart
created in an older version of Visio, you will import the flowchart
rule set.
-
Click OK.
-
On the Process tab, in the Diagram Validation
group, click the Check Diagram arrow (not the button), and then point to Rules to Check. The submenu confirms that there are no rules in this document.
-
Point to Import Rules From, and click Flowchart Rule Set
. Visio displays a dialog box confirming that one rule set was copied to the current document.
Tip
The flowchart rule set is available to import into any diagram. In addition, if you have other diagrams open that contain rule sets, you will find them listed and can import their rules.
-
On the Process tab, in the Diagram Validation group, click the Check Diagram button. Visio runs the imported rule set against your diagram and reports the results in the Issues window.
Note
CLEAN UP Save your changes to the Visio 2013 Flowchart drawing but leave it open if you are continuing with the next exercise.
Now that you know you can import a rule set into a diagram, you have
probably guessed the answer to the second question in the list at the
beginning of this section: you can have more than one rule set attached
to a Visio diagram.
The following graphic indicates that the current diagram uses two
rule sets. The check marks in front of both Contoso Business Rules and
Flowchart indicate that both rule sets are active. Consequently, when
you click the Check Diagram button, the diagram will be validated against both of them.
Tip
You can clear the check box for any rule set to remove it from the active list.
The answer to the third question posed at the beginning of this
section is a bit trickier, because the Visio 2013 user interface does
not provide a way to list the rules in a rule set. However, an
experienced Microsoft Visual Basic for Applications (VBA) programmer can write a short program to list the rules contained in a rule set. Even better, Visio MVP David Parker has already done the work for you by including code samples for this and other diagram validation
purposes in an article he wrote for MSDN. Although he wrote the article
about the 2010 release of Visio, it applies equally to Visio 2013.