Microsoft Visio 2013 Business Process Diagramming and Validation

By David J. Parker
    What do you get with a Packt Subscription?

  • Instant access to this title and 7,500+ eBooks & Videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies
  1. Free Chapter
    1. Overview of Process Management in Microsoft Visio 2013
About this book

Microsoft Visio is a diagramming program which ultimately allows business professionals to explore and communicate complex information more effectively. Through easy-to-understand visual representations, Visio enables you to present complicated data in a clear and communicative way. Therefore, productivity is increased by utilizing the wide variety of diagrams that can convey information at a glance as data can be understood and acted upon quickly. This book enables business developers to unleash the full potential of Visio 2013 Professional Edition.

Microsoft Visio 2013 Business Process Diagramming and Validation is a focused tutorial with a range of practical examples and downloadable code that shows you how to create business process diagramming templates with Visio, enabling you to effectively visualize business information. It draws on real business examples and needs and covers all the new features of Visio 2013 Professional Edition.

This focused tutorial will enable you to get to grips with diagram validation in Visio 2013 Professional Edition to the fullest extent, enabling you to perform powerful automatic diagram verification based on custom logic and assuring correct and compliant diagrams. You will learn how to create and publish rules and how to use the ShapeSheet to write formulae. There is also a special focus on extending and enhancing the capabilities of Visio 2013 diagram validation and on features that are not found in the out-of-the-box product, like installing and using the new Rules Tools add-on complete with source code, reviewing the new diagramming rules in flowcharts and BPMN templates, and creating your own enhanced Data Flow Model Diagram template complete with validation rules.

Microsoft Visio 2013 Business Process Diagramming and Validation begins by covering the basic functions of Visio 2013 before moving on to discuss how to formulate your own validation rules and how to use the Visio Object Model. ShapeSheet functions are explored in detail as well as how to create validation rule sets and visualizing issues, with practical demonstrations along the way. It also covers integration with SharePoint 2013 and Office365 and how to build a Rules Tools add-on using C#, how to create test and filter expressions, and how to publish validation rules for others to use. Finally, the book concludes with the creation and implementation of a new RuleSet for Data Flow Model Diagrams with a worked example. By following the practical and immediately deployable examples found in this book, you will successfully learn how to use the features of Microsoft Visio 2013 and how to extend the functionality provided in the box.

Publication date:
November 2013

Exploring the new process management features in Visio 2013

Firstly, Microsoft Visio 2010 introduced a new Validation API

for structured diagrams and provided several examples of this in use, for example with the BPMN (Business Process Modeling Notation) Diagram and Microsoft SharePoint Workflow templates and the improvements to the Basic Flowchart and Cross-Functional Flowchart templates, all of which are found in the Flowchart category. Microsoft Visio 2013 has updated the version of BPMN from 1.1 to 2.0, and has introduced a new SharePoint 2013 Workflow template, in addition to the 2010 one.

Templates in Visio consist of a predefined Visio document that has one or more pages, and may have a series of docked stencils (usually positioned on the left-hand side of workspace area). The template document may have an associated list of add-ons that are active while it is in use, and, with Visio 2013 Professional edition, an associated list of structured diagram validation rulesets as well. Most of the templates that contain validation rules in Visio 2013 are in the Flowchart category, as seen in the following screenshot, with the exception being the Six Sigma template in the Business category.

Exploring the new process management features in Visio 2013

Secondly, the concept of a Subprocess was introduced in Visio 2010. This enables processes to hyperlink to other pages describing the subprocesses in the same document, or even across documents. This latter point is necessary if subprocesses are stored in a document library, such as Microsoft SharePoint.

The following screenshot illustrates how an existing subprocess can be associated with a shape in a larger process, selecting an existing shape in the diagram, before selecting the existing page that it links to from the drop-down menu on the Link to Existing button.

Exploring the new process management features in Visio 2013

In addition, a subprocess page can be created from an existing shape, or a selection of shapes, in which case they will be moved to the newly-created page.

There were also a number of ease-of-use features introduced in Microsoft Visio 2010 to assist in the creation and revision of process flow diagrams. These include:

Microsoft Visio 2013 has added two more notable features:

However, this book is not about teaching the user how to use these features, since there will be many other authors willing to show you how to perform tasks that only need to be explained once. This book is about understanding the Validation API in particular, so that you can create, or amend, the rules to match the business logic that your business requires.


Microsoft Visio now sits at the top of the Microsoft Process Management Product Stack, providing a Business Process Analysis (BPA) or Business Process Modeling (BPM) tool for business analysts, process owners/participants, and line of business software architects/developers.

Reviewing Visio Process Management capabilities

Of course, your particular business may not have all, or parts, of the stack, but you will see in later chapters how Visio 2013 can be used in isolation for business process management to a certain depth.

If we look at the Visio BPM Maturity Model that Microsoft has previously presented to its partners, then we can see that Visio 2013 has filled some of the gaps that were still there after Visio 2010. However, we can also see that there are plenty of opportunities for partners to provide solutions on top of the Visio platform. The maturity model shows how Visio initially provided the means to capture paper-drawn business processes into electronic format, and included the ability to encapsulate data into each shape and infer the relationship and order between elements through connectors. Visio 2007 Professional added the ability to easily link shapes, which represent processes, tasks, decisions, gateways, and so on with a data source. Along with that, data graphics were provided to enable shape data to be displayed simply as icons, data bars, text, or to be colored by value. This enriched the user experience and provided quicker visual representation of data, thus increasing the comprehension of the data in the diagrams. Generic templates for specific types of business modeling were provided.

Visio had a built-in report writer for many versions, which provided the ability to export to Excel or XML, but Visio 2010 Premium introduced the concept of validation and structured diagrams, which meant that the information could be verified before exporting. Some templates for specific types of business modeling were provided.

Visio 2010 Premium also saw the introduction of Visio Services on SharePoint that provided the automatic (without involving the Visio client) refreshing of data graphics that were linked to specific types of data sources.

Understanding the Visio BMP Maturity Model

Throughout this book we will be going into detail about Level 5 (Validation) in Visio 2013, because it is important to understand the core capabilities provided in Visio 2013. We will then be able to take the opportunity to provide custom Business Rule Modeling and Visualization.


There are two process flow diagram templates, in addition to the Six Sigma Diagram template, in the Flowchart category of Visio 2013 Professional Edition that include their own validation rules. The first, BPMN Diagram, provides native Visio support for an important and widely-used process flow notation, and the second, Microsoft SharePoint 2013 Workflow, enables visual development of SharePoint workflows that integrates closely with SharePoint 2013.

The Object Management Group/Business Process Management Initiative ( promotes the BPMN standards. The BMPN version in Microsoft Visio 2013 is 2.0, an upgrade from Version 1.1 in Visio 2010. Although this officially added diagram types to the standard, it did not add more BPMN templates in Visio 2013. Instead, Microsoft actually simplified the number of stencils and shapes for BPMN in Visio 2013, while increasing their capability. There is no better short description of BPMN than the charter from the OMG's website, which states:

Having been involved in the creation of two other BPMN solutions based on earlier versions of Visio, I believe that the native support of BPMN is a very important development for Microsoft, because it is obviously a very popular methodology for the description of an interchange of business processes.

The BMPN template in Visio 2010 contained five docked stencils, each of them containing a logical set of shapes, but for Visio 2013 these have been reduced to just one, BPMN Basic Shapes, as seen on the left of the following screenshot. The other stencils are still there, but hidden by default.

Understanding a BPMN Diagram

Each of the shapes has BPMN Attributes in the form of a set of Shape Data, which can be edited using the Shape Data window or dialog. Some shapes can also be edited using the right mouse menu.

Understanding a BPMN Diagram

These Shape Data rows correspond to BPMN Attributes, as specified by the OMG specification. In the preceding screenshot, a Task shape is selected, revealing that there are many permutations that can be set.

The following screenshot shows all of the BPMN master shapes in the BPMN Basic Shapes stencil:

Understanding a BPMN Diagram

In reality, any of these Task shapes can be changed into a Collapsed SubProcess shape, and each of the Event shapes into any of the other Event shapes, by amending the Shape Data . Thus, the original name of the Master shape is really immaterial, since it is the Shape Data that determine how it should be understood.


Validation ensures that the diagram is compliant with the required business logic by checking that it is properly constructed. Therefore, you need to be able to verify that the ruleset being used is the one that your business requires. Visio will not provide instant feedback at the moment that you transgress a rule. However, it will check your diagram against a ruleset only when you select Check Diagram. It will then provide you with feedback on why any given rule has been broken.

Some of the Validation API can be accessed via the PROCESS tab on the Diagram Validation group; however, but there is more that is available only to developers, thus enabling you to automate some tasks if necessary. The following example of a BPMN diagram has some errors in it they would be difficult to spot if it were not for the Issues window that lists them, because the diagram has been validated.

Validation of process diagrams

The PROCESS tab is split into three ribbon groups. The first group on the PROCESS tab, Subprocess, is for the creation of Subprocesses, and the third group is for the Import and Export of a SharePoint Workflow, but it is the second group, Diagram Validation, that is of most interest here.

In this second group, the first button, Check Diagram, validates the whole document against the selected ruleset(s). You can have more than one ruleset in a document that can be enabled or disabled as required. The drop-down menu on the Check Diagram button (shown in the following screenshot) enables you to select which Rules to Check, and also to Import Rules From another open Visio document. It is a pity that you cannot export to/ import from XML, but we will create our own tool to do that in a later chapter.

Validation of process diagrams

At this point, we should be aware that Visio documents used to either be saved as binary (normally with a *.vsd extension) or XML format (normally with a *.vdx extension); however, in Visio 2013 they are in a new XML format that follows the Open Packaging Convention.

Visio 2013 diagram files have either a *.vsdx extension, or a *.vsdm extension if they contain macros. The easiest way to look at the contents of a Visio 2013 file is to change the extension to *.zip, and then just double-click to open it. Inside the zip file, you will find a visio folder, and inside that is a validation.xml file if there are any rules within the document, as shown in the following screenshot:

Analyzing the structure of a Visio document

Simply double-clicking on the xml file will open it in the associated program, which in my case is Internet Explorer.

If we expand a RuleSets branch, and one of the Rule sub-branches, then we can see how a rule is defined, as shown in the following screenshot:

Analyzing the structure of a Visio document

Later, we will be going into these definitions in much greater detail but, for now, notice that the RuleFilter and RuleTest elements contain formulae that precisely define what constitutes the particular rule.

The Diagram Validation group also has the option to show/hide the Issues Window, which has a right mouse menu that is identical (apart from the additional Arrange By menu option) to the drop-down menu on the Ignore This Issue button, as shown in the following screenshot:

Analyzing the structure of a Visio document

Now that we can see that a Rule has an ID, and belongs to a RuleSet that also has an ID, we can begin to understand how an issue can be associated with a shape. So, if we expand an Issue element in the Visio document XML, we can see that Issue has IssueTarget and RuleInfo elements, as at the bottom of the following screenshot of the Validation XML.

Analyzing the structure of a Visio document

We can then use the ShapeID and the PageID from the preceding Issue to find the actual shape in the relevant page XML, by reviewing the Shape elements under the Shapes collection of PageContents, also identified by its ID, as shown in the following screenshot:

Analyzing the structure of a Visio document

In fact, the PageID and ShapeID elements of an IssueTarget are optional because an Issue may just be associated with a page, or even with the whole document.

We will use the new Validation API to explore these RuleSets, Rules, and Issues in later chapters, and we will expose them to scrutiny so that your business can be satisfied that you have modeled the business logic correctly.


Microsoft Visio has had, for several versions, a useful Save As Web feature that creates a mini-website, complete with widgets for pan and zoom, Shape Data, and shape reports. This has worked best using the Vector Markup Language (VML) in Microsoft Internet Explorer; or in Scalable Vector Graphics (SVG) using a web browser that supports it natively; or in older browsers that have the required plug-in. This is quite powerful, but it does require that the native Visio file is republished if any changes are made to the document. The new Open Packaging Convention XML in Visio 2013 is utilized by Visio Services in SharePoint 2013 to render the diagram in html directly, and has a JavaScript Object Model (JSOM) for developers. In addition, Microsoft has an ActiveX Visio Viewer control that can display native Visio files that are in the new OPC format or the older binary and XML formats.

This control is installed as default with Microsoft Outlook 2007 and later, but is also available as a separate free download from Microsoft. In fact, the Visio Viewer control has a programmable API that enables Shape Data and hyperlinks to be extracted and exposed too. While this viewer has the advantage that the native file does not need to be hosted on SharePoint with Visio Services, its reach is limited by the choice of browsers available and the willingness to make the native Visio file accessible—this is not always the best strategy.

Microsoft Visio 2013 provides Visio Services for Microsoft SharePoint. Therefore, with rendering on the server, any client that accesses the Microsoft SharePoint site will have the ability to view Visio diagrams without having to install anything locally.

The user can interact with the diagrams by clicking on shapes to view the Shape Data, navigating any embedded hyperlinks as well as pan/zoom and print capabilities. These are capabilities of the Save As Web and Visio Viewer options too. In addition, Visio 2013 introduced commenting on shapes and the ability to co-author. These features are extremely useful for collaboration.

Microsoft Visio 2007 introduced the ability to add a data recordset to a diagram and refresh that data so that the diagram could be kept up-to-date, but the Save As Web html pages and the Visio Viewer ActiveX controls are not able to automatically respond to any data changes. Therefore, the diagram can quickly become outdated, thus requiring you to refresh the diagram in Visio, and then to republish it.

Now with Visio Services, that same data recordset can be refreshed by the server, thus providing everyone who views the diagram using the new Visio web part with the latest information. This is extremely nice, but be aware that there are some limitationsfor example, no shapes will be added or deleted in this operation, but data-linked cells will have their formulas updated, which is a big advance from Visio 2010 when only linked Shape Data and Data Graphics were updated. No layer visibility changes will be respected. Still, you no longer have to republish just to refresh the data set!


By now, you should be eager to explore the out of the box structured diagram functionality, and perhaps be considering how to create validation rules for your own business. In doing so, I would advise that you always look to build upon what Visio provides—do not try to replicate it! I believe that trying to create your own Shape Data objects, or your own line routing algorithms, for example, is ultimately a waste of time as they will lead you down some dead-ends, as the routing algorithms are complex and difficult to reproduce.

The following three legacy diagram templates have had their functionality reduced because Microsoft has removed the add-ons that they were associated with. The new templates for these seem ripe for someone to create validation rules for the following:

The following two diagram templates in Visio have their own limitations for automation because, though they have associated add-ons, they do not have a programmers interface:

One of the frequently asked questions by newbies to Visio occurs when confronted by the multiple diagram categories and types: How is a particular template supposed to be used? Often, they are directed to the Visio online help for examples of how to create certain types of diagrams but this is not always sufficient because they are really asking for automatic assistance as they create the diagram. What they usually want is in fact a guided diagramming system; they require a system that provides them with some feedback on the way that they are composing a diagram. It is easy to drag-and-drop shapes in Visio, to connect them together, to make a diagram pretty with embellishments, or to add text in a variety of ways. However, this loosely-created drawing cannot consistently convey any semantic meaning unless it follows generally accepted rules. It is the imposition of rules that turns a pretty picture into a meaningful mesh of semantic symbology. This is where Microsoft Visio 2013 Professional has made a great advance because it has provided us with the ability to create validation rules for different types of behaviors. In fact, these new features are worthy of a ribbon tab, the PROCESS tab, that although automatically applied to several drawing templates, is also available for use on any type of diagram.

About the Author
  • David J. Parker

    David J. Parker, being frustrated as an architect in the late 80s trying to match 3D building models with spreadsheets, explored linking Unix, CAD, and SQL databases in the early 90s for facilities and cable management. In 1996 he discovered the ease of linking data to Visio diagrams of personnel and office layouts. He immediately became one of the first Visio business partners in Europe, and was soon invited to present his applications at worldwide Visio conferences. He started his own Visio-based consultancy and development business, bVisual ltd (, applying analysis, synthesis, and design to various graphical information solutions. He presents Visio solution providers and Visio Services courses for Microsoft EMEA, adding personal anecdotes and previous mistakes hoping that all can learn by them. He wrote his first book, Visualizing Information with Microsoft Office Visio 2007, to spread the word about data-linked diagrams in business, and his second book, which is about creating custom rules for validating structured diagrams in Visio 2010, has now been updated and extended for Visio 2013. He wrote WBS Modeler for Microsoft, which integrates Visio and, Project, and many other Visio solutions for various vertical markets. David has been regularly awarded Most Valued Professional status for his Visio community work over the years, and maintains a Visio blog at Based near to Microsoft UK in Reading, he still sees the need for Visio evangelism throughout the business and development community, and has been touring many European capitals over the last two years spreading the word of intelligent business diagramming with Visio and SharePoint.

    Browse publications by this author
Latest Reviews (1 reviews total)
Microsoft Visio 2013 Business Process Diagramming and Validation
Unlock this book and the full library FREE for 7 days
Start now