Creating #Visio #Validation Rules for #GraphDatabase template

Having developed Node and Edge/ Dynamic connector masters shapes for creating Node and Edge table entries for a SQL Server 2017, I decided that I should write some validation rules. The validation feature has been in Visio since the 2010 edition, but is underused, even though I wrote a book about them … see  Microsoft Visio 2013 Business Process Diagramming and Validation . I think that only six rules are necessary to validate that a page with Node and Edge shapes is well constructed before attempting to update the tables in SQL Server, or any other GraphDatabase.

This slideshow requires JavaScript.

In the above screenshots, I have presented an issue for each rule. The panel on the right Follow the link earlier to read more.

Most of these rules are possible because I ensured that the Node shapes have the category “GraphNode“, and the Edge shapes have the category “GraphEdge“. This allows for testing of the relevant shapes using the HASCATEGORY() function. Some rules are for checking that shapes are correctly connected – basically a Node shape must be connected to another Node shape (or itself) with an Edge shape. The other rules are checking that required Shape Data row values have been entered.

That’s it, so why are Visio validation rules not being used more?

Here are the rules in full:

ID 1
NameU UngluedConnector
Category Connectivity
Description Edge connector shape is not glued to a Node shape at each end.
RuleTarget Shape
RuleFilter HASCATEGORY(“GraphEdge”)
RuleTest AGGCOUNT(FILTERSET(GLUEDSHAPES(3), “HASCATEGORY(“”GraphNode””)”))=2
ID 2
NameU TooFewConns
Category Connectivity
Description Each Node shape should have at least one Edge shape connection.
RuleTarget Shape
RuleFilter HASCATEGORY(“GraphNode”)
RuleTest NOT(AGGCOUNT(FILTERSET(GLUEDSHAPES(1),”HASCATEGORY(“”GraphEdge””)”))+AGGCOUNT(FILTERSET(GLUEDSHAPES(2),”HASCATEGORY(“”GraphEdge””)”))) = 0
ID 3
NameU NoNodeValue
Category Data
Description Each Node shape should have a Node value
RuleTarget Shape
RuleFilter HASCATEGORY(“GraphNode”)
RuleTest AND(NOT(STRSAME(Prop.Node, “”)),NOT(STRSAME(Prop.Node, “<node>”)))
ID 4
NameU NoEdgeValue
Category Data
Description Each Edge shape should have an Edge value
RuleTarget Shape
RuleFilter HASCATEGORY(“GraphEdge”)
RuleTest AND(NOT(STRSAME(Prop.Edge, “”)),NOT(STRSAME(Prop.Edge, “<edge>”)))
ID 5
NameU NoNameValue
Category Data
Description Each Node shape should have a Name value
RuleTarget Shape
RuleFilter HASCATEGORY(“GraphNode”)
RuleTest AND(NOT(STRSAME(Prop.Name, “”)),NOT(STRSAME(Prop.Name, “<name>”)))
ID 6
NameU BadNodeConnect
Category Connectivity
Description Node shapes must only be glued to Edge shapes
RuleTarget Shape
RuleFilter HASCATEGORY(“GraphNode”)
RuleTest AGGCOUNT(FILTERSET(GLUEDSHAPES(1),”NOT(HASCATEGORY(“”GraphEdge””))”))+AGGCOUNT(FILTERSET(GLUEDSHAPES(2),”NOT(HASCATEGORY(“”GraphEdge””))”)) = 0

Useful links:

Introduction to Validation Rules in Visio Premium 2010

The Diagram Validation API

Dissecting the Process Flowchart Validation Rules

Writing rules to validate diagrams in Visio 2010 – A worked example

Other articles in this series:

Using #Visio and #PowerBI with #GraphDatabase in #SQLServer

Using #Visio and #PowerBI with #GraphDatabase in #SQLServer – Part 2

Using #JSON text in #Visio shapes

Advertisements

One Response to “Creating #Visio #Validation Rules for #GraphDatabase template”


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

Simplify Tasks

Want to learn the simple way?

Paul Turley's SQL Server BI Blog

sharing my experiences with the Microsoft data platform, SQL Server BI, Data Modeling, SSAS Design, Power Pivot, Power BI, SSRS Advanced Design, Power BI, Dashboards & Visualization since 2009

John Goldsmith's visLog

be smart, be clear, be visual ...

Mo's blog

Personal views on Dynamics 365 for Operations and Technical Architecture.

Chris Webb's BI Blog

Microsoft Power BI, Analysis Services, MDX, DAX, M, Power Pivot and Power Query

davecra.wordpress.com/

Microsoft Office 365 Development, and more...

PowerShell.Amsterdam

Automate, Accelerate, Accurate

johnvisiomvp

Life with Visio and other Microsoft Toys!

Title (Required)

Windows Server Essentials Tips & Tricks

Nilsandrey's Weblog

Just another WordPress.com weblog

Things that Should be Easy

Every so often (too often in the IT industry) I encounter things that should have been very easy to do but turned out to be far too complicated. My favorite topics include SharePoint, .Net development, and software architecture, especially distributed systems.

Visio Guy

Smart graphics for visual people

Hannes's Virtual Earth

Tips & Tricks around Mapping and Cloud Computing

Pluralsight blog

be smart, be clear, be visual ...

%d bloggers like this: