When Visio was first conceived of over 20 years ago, its first stated marketing aim was to outsell ABC Flowcharter, the best-selling process diagramming tool at the time. Therefore, Visio had to have all of the features from the start that are core in the creation of flowcharts, namely the ability to connect one shape to another and to have the lines route themselves around shapes. Visio soon achieved its aim, and looked for other targets to reach.
So, process flow diagrams have long been a cornerstone of Visio's popularity and appeal and, although there have been some usability improvements over the years, there have been few enhancements to turn the diagrams into models that can be managed efficiently. Microsoft Visio 2010 saw the introduction of two features, structured diagrams and validation rules, that make process management achievable and customizable, and Microsoft Visio 2013 sees these features enhanced.
In this chapter, you will be introduced to the new features that have been added to Microsoft Visio to support structured diagrams and validation. You will see where Visio fits in the Process Management stack, and explore the relevant out of the box content.
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.
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.
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.
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.
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.
- Container Management: The ability to add labeled boxes around shapes to visually organize them
- Callout Management: The ability to associate callouts with shapes to display notes
- List Management: To provide order to shapes within a container
- Validation API: The ability to test the business logic of a diagram
- Connectivity API: The ability to create, remove, or traverse connections easily
The following diagram demonstrates the use of Containers and Callouts in the construction of a basic flowchart, that has been validated using the Validation API, which in turn uses the Connectivity API.
There are three process flow diagram templates: Basic Flowchart, Cross-Functional Flowchart, and Six Sigma, in Visio 2013 Professional edition that have been enhanced since the previous versions of Visio and include validation rules.
There is now very little difference between the Basic Flowchart template and the Cross-Functional Flowchart template in the Flowchart category. In fact, they are identical apart from the latter opening with a couple of Swimlane shapes already placed on the page. Any Basic Flowchart diagram can become a Cross-Functional Flowchart diagram with the dragging and dropping of a Swimlane shape onto the page, at which point the new CROSS-FUNCTIONAL FLOWCHART tab will appear, as in the following screenshot:
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 (http://bpmn.org/) 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:
A standard Business Process Modeling Notation (BPMN) will provide businesses with the capability of understanding their internal business procedures in a graphical notation and will give organizations the ability to communicate these procedures in a standard manner. Furthermore, the graphical notation will facilitate the understanding of the performance collaborations and business transactions between the organizations. This will ensure that businesses will understand themselves and participants in their business and will enable organizations to adjust to new internal and B2B business circumstances quickly.
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.
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.
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.
Microsoft Visio 2013 also includes a template and shapes for designing workflows that can be developed in tandem with Microsoft SharePoint Designer.
With Visio 2010, you could pass the workflow back and forth between the two with no loss of data or functionality, by using a Visio Workflow Interchange
(*.vwi) file, and the Import and Export buttons are still present on the PROCESS tab in the ribbon in Visio 2013, as seen in the following screenshot. However, Visio 2013 Professional and SharePoint Designer 2013 become complementary design surfaces that you can seamlessly switch between, if you have them both installed on your desktop.
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.
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.
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:
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:
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.
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:
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.
There is also a Visio Process Repository, which is a site template that is included with Microsoft SharePoint 2013. It provides a place to share and collaborate on process diagrams, and for reviewers to add comments. The repository has built-in file access control and version control — users can view the process diagram simultaneously and edit the diagram without corrupting the original.
This repository can therefore ensure that a user is editing the most recent version of a process diagram, and enable a user to find out about updates that have been made to processes of interest to them.
In addition, administrators can monitor whether diagrams comply with a business's internal standards, or not, or discover, for example, which processes apply to a specified department. The Validation status of the diagram is automatically updated in the Process Repository when the diagram is saved back to SharePoint.
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!
Visio has a complex layering system. Most CAD systems, for example, insist that all diagram elements belong to a single layer. This layer can either be made visible or not, or all elements on a layer can have a specified color. Drawing elements in Visio can belong to none, one, or many layers! Visio Services, however, simply ignores layers.
Microsoft has merged the Professional and Premium editions from Visio 2010 into the Professional edition in Visio 2013. There is still a Standard edition, but there is a flavor of the Professional edition for 2013 that is available with certain Office365 subscriptions. The Office365 edition of Visio Professional can be used on up to 5 PCs as a Click-Once installation
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 Software and Database\UML Model Diagram solution from Visio 2010 has been removed and replaced with six UML templates, none of which have an add-on behind them to create a model in the way that it used to.
- The Software and Database\Database Model Diagram solution from Visio 2010 has been removed and replaced with three database modeling notation templates, none of which have an add-on behind them to create a model in the way that it used to.
- The Software and Database\Data Flow Model Diagram solution is one that was re-assessed for Visio 2010. We still have the template and stencil for this but the add-on has not made it through the Microsoft rationalization of Visio add-ons. Therefore, you can now construct DFD models badly without realizing it. We will attempt to remedy this omission in a later chapter by constructing a ruleset that can be used with DFD models.
- The Organization Chart solution within Visio is essentially a closed add-on that has been around for many years. It has been given a facelift in Visio 2013, but experience has shown that it can only be enhanced with great care (and skill). There is no Application Programming Interface (API) to develop with.
- The Pivot Diagram solution is useful but also lacks an API for developers, thus making customization difficult.
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.
Microsoft Visio 2013 provides considerable ease-of-use features to the end user, a rich programming model for the developer, and greater capabilities for document management and sharing than ever before.
In the next chapter we will need to delve deeper into the internal structure of a Visio document and the use of its various APIs, so that you can best understand how to formulate your own rules to represent the business logic that you require.