David J Parker
  MVP (Visio)
    bVisual ltd
Need Premium for Validation!
 Silverlight   application to view built-in rules
  • Click http://www.visiorules.com/rulesexplorer.html
Free Silverlight application
Create a drawing from one that contains
rule set(s)
 or
Import rule set(s) from an existing
document
Enable one or more of the rule sets
Select Process / Check Diagram
 or
Call document.Validate in code
Review issues
Define rules using quasi-ShapeSheet
formulae
 and/or
Respond to document.RuleSetValidated
event
 Useful for cyclic connections, for example
 Use ValidationRule.AddIssue
The Validation Process
Loop through each Target Type
Check that Filter Expression evaluates to
True
 Abort if False
Check that Test Expression evaluates to
False
 Abort if True
Add Issue
 Target (document. Page or shape)
 Rule
Save as VDX
 New v14 namespace
View in XML reader, eg XML Notepad
Role()=n
 0=Element,1=Connector,2=Container,4=Callout
HasCategory(category)
OnLayer(layername)
Is1D()
StrSame(Left(MasterName(750),n),name)
AggCount(set) = n, >n, <n, etc
ConnectedShapes(direction)
GluedShapes(direction)
ContainerMembers()
ListMembers()
Callouts()
ParentContainers()
ShapesOnPage()
OnBoundaryOf()
TWO books on Visio
Click http://www.visiorules.com/
Microsoft Visio 2010 Business Process Diagramming and Validation

see https://www.packtpub.com/microsoft-visio-2010-business-process-diagramming/book

Sample Chapters

Chapter 2 : Understanding the Microsoft Visio Object Model
see https://www.packtpub.com/sites/default/files/0141-chapter-2-understanding-the-microsoft-visio-
object%20.pdf


Chapter 3 : Understanding ShapeSheet™ in Microsoft Visio 2010
see http://www.packtpub.com/article/understanding-shapesheet-microsoft-visio-2010

For latest news, updates and rule sets, visit http://www.visiorules.com
Click http://www.visualizinginformation.com/
Extension to Process tab
Adding validation to DFDs
There are a number of rules that are commonly followed
when creating DFDs:
1.   All processes must have at least one data flow in, and one data flow
     out
2.   All processes should modify the incoming data, producing new
     forms of outgoing data
3.   Each data store must be involved with at least one data flow
4.   Each external entity must be involved with at least one data flow
5.   A data flow must be attached to at least one process
6.   Data flows cannot go directly from one external entity to another
     external entity; such flows need to go through at least one process.
There are also some conventions that could be
considered.:
1.   Do not allow a single page of a data flow diagram to get too
     complex—it should have no more than ten components. If it has
     more than this, combine some components into a single, self-
     contained unit and create a new DFD for that unit.
2.   Each component should be labeled with a suitable description.
3.   Each data flow should be labeled describing the data flowing through
     it.
4.   Each component and subcomponent should be numbered in a top-
     down manner.
MSDN Articles
    Introduction to Validation Rules in Visio Premium 2010
    click http://msdn.microsoft.com/en-us/library/ff847470.aspx
    Creating Custom Validation Rules for Visio Premium
    click http://msdn.microsoft.com/en-us/library/ff797562.aspx
Blogs
        10 Days for Office 2010: 10 Visio 2010 Tips and Tricks
        click
        http://blogs.msdn.com/b/mvpawardprogram/archive/2010/05/13/10-
        days-for-office-2010-10-visio-2010-tips-and-tricks.aspx

        David J Parker click http://davidjpp.wordpress.com/

Vbug nov 2010 Visio Validation

  • 1.
    David J Parker MVP (Visio) bVisual ltd
  • 3.
    Need Premium forValidation!
  • 5.
     Silverlight application to view built-in rules • Click http://www.visiorules.com/rulesexplorer.html
  • 6.
  • 7.
    Create a drawingfrom one that contains rule set(s) or Import rule set(s) from an existing document Enable one or more of the rule sets Select Process / Check Diagram or Call document.Validate in code Review issues
  • 8.
    Define rules usingquasi-ShapeSheet formulae and/or Respond to document.RuleSetValidated event Useful for cyclic connections, for example Use ValidationRule.AddIssue
  • 9.
  • 10.
    Loop through eachTarget Type Check that Filter Expression evaluates to True Abort if False Check that Test Expression evaluates to False Abort if True Add Issue Target (document. Page or shape) Rule
  • 12.
    Save as VDX New v14 namespace View in XML reader, eg XML Notepad
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
    Microsoft Visio 2010Business Process Diagramming and Validation see https://www.packtpub.com/microsoft-visio-2010-business-process-diagramming/book Sample Chapters Chapter 2 : Understanding the Microsoft Visio Object Model see https://www.packtpub.com/sites/default/files/0141-chapter-2-understanding-the-microsoft-visio- object%20.pdf Chapter 3 : Understanding ShapeSheet™ in Microsoft Visio 2010 see http://www.packtpub.com/article/understanding-shapesheet-microsoft-visio-2010 For latest news, updates and rule sets, visit http://www.visiorules.com
  • 18.
  • 19.
  • 23.
  • 24.
    There are anumber of rules that are commonly followed when creating DFDs: 1. All processes must have at least one data flow in, and one data flow out 2. All processes should modify the incoming data, producing new forms of outgoing data 3. Each data store must be involved with at least one data flow 4. Each external entity must be involved with at least one data flow 5. A data flow must be attached to at least one process 6. Data flows cannot go directly from one external entity to another external entity; such flows need to go through at least one process.
  • 25.
    There are alsosome conventions that could be considered.: 1. Do not allow a single page of a data flow diagram to get too complex—it should have no more than ten components. If it has more than this, combine some components into a single, self- contained unit and create a new DFD for that unit. 2. Each component should be labeled with a suitable description. 3. Each data flow should be labeled describing the data flowing through it. 4. Each component and subcomponent should be numbered in a top- down manner.
  • 27.
    MSDN Articles Introduction to Validation Rules in Visio Premium 2010 click http://msdn.microsoft.com/en-us/library/ff847470.aspx Creating Custom Validation Rules for Visio Premium click http://msdn.microsoft.com/en-us/library/ff797562.aspx Blogs 10 Days for Office 2010: 10 Visio 2010 Tips and Tricks click http://blogs.msdn.com/b/mvpawardprogram/archive/2010/05/13/10- days-for-office-2010-10-visio-2010-tips-and-tricks.aspx David J Parker click http://davidjpp.wordpress.com/

Editor's Notes

  • #3 Validation Business Rule Modeling Business Rule Visualization Import Rules
  • #8 Sub Validate([RuleSet As ValidationRuleSet], [Flags As VisValidationFlags]) Member of Visio.Validation
  • #9 Event RuleSetValidated(RuleSet As ValidationRuleSet) Member of Visio.Application, Visio.Document, Visio.Documents, Visio.InvisibleAppFunction AddIssue([TargetPage As Page], [TargetShape As Shape]) As ValidationIssueMember of Visio.ValidationRule
  • #10 The UI doesn’t Clear, removes individual issues from dirty pages
  • #12 Change to show rule is processed even if ignored, but it is not displayed
  • #18 Role()Returns an integer indicating the shape role: {Element = 0, Connector = 1, Container = 2, Callout = 4}. OnLayer(LayerName)Returns a Boolean indicating whether the shape is a member of the specified layer. Returns a Boolean indicating whether layer exists on page if called on a Page. AggCount(Set)Counts the number of shapes in a set.
  • #19 FunctionDescriptionConnectedShapes(Direction)Returns the set of shapes, matching the Direction criteria, connected to the shape. The Visio.VisConnectedShapesFlagsconstant values are:visConnectedShapesAllNodes = 0visConnectedShapesIncomingNodes = 1visConnectedShapesOutgoingNodes = 2GluedShapes(Direction)Returns the set of shapes, matching the Direction criteria, glued to the shape. GluedShapes(n), where n is one of the following Visio.VisGluedShapesFlags constant values: visGluedShapesAll1D = 0 visGluedShapesIncoming1D = 1 visGluedShapesOutgoing1D = 2 visGluedShapesAll2D = 3 visGluedShapesIncoming2D = 4 visGluedShapesOutgoing2D = 5ContainerMembers()Returns the set of shapes that are members of the container / list shape. ListMembers()Returns the set of shapes that are members of the list shape. Callouts()Returns the set of shapes that are callouts on the shape. ParentContainers()Returns the set of containers that the shape belongs to. ShapesOnPage()Returns the set of top-level shapes on page. If no page specifier precedes the function, the shape’s containing page is assumed. FilterSet(Set,FilterExpression)Returns the subset of shapes in a set that match an expression. OnBoundaryOf()Returns the set of containers such that the shape is on the boundary of these containers.
  • #31 Part of new Rules Tools add-in
  • #32 Ruleset XSL is part of new Rules Tools add-in
  • #36 An example rule