Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Microsoft Visio 2010 Business Process Diagramming and Validation

You're reading from  Microsoft Visio 2010 Business Process Diagramming and Validation

Product type Book
Published in Jul 2010
Publisher Packt
ISBN-13 9781849680141
Pages 344 pages
Edition 1st Edition
Languages
Author (1):
David Parker David Parker
Profile icon David Parker

Table of Contents (15) Chapters

Microsoft Visio 2010 Business Process Diagramming and Validation
Credits
Foreword
About the Author
About the Reviewers
1. Preface
1. Overview of Process Management in Microsoft Visio 2010 2. Understanding the Microsoft Visio Object Model 3. Understanding the ShapeSheet™ 4. Understanding the Validation API 5. Developing a Validation API Interface 6. Reviewing Validation Rules and Issues 7. Creating Validation Rules 8. Publishing Validation Rules and Diagrams 9. A Worked Example for Data Flow Model Diagrams

Custom validation rules in code


Previously in Chapter 4, you learnt that you can add custom validation rules in code. You would need to do this if the validation rule is too complex to phrase as Filter and Test Expressions. For example, you might want to ensure that there are no cycles (paths which return back to where they start from).

You could add code into a Visio add-in, but I will demonstrate how you can put some custom code into the drawing document as VBA because this will be in the document along with any rule set that you may have written using Filter Expression and Test Expression.

First, you need to listen for the RuleSetValidated event of the document, which can be added easily to the ThisDocument class in the VBA project. I have used the getRule() method from Chapter 4 to ensure that there is a rule named CheckCycle present. If there is, then the CheckCycle() method is called.

Private Sub Document_RuleSetValidated(ByVal ruleSet As IVValidationRuleSet)
Dim rule As Visio.ValidationRule...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}