Presents: ObjectRoleModeling.com Thursday, January 08, 2009
 Search
Register Login
Web Log
 
 
  Visio FAQ: Creating set constraints in VEA  
 
Location: BlogsObjectRoleModeling.com Web LogVisio FAQ    
Posted by: Scot Becker 7/28/2004
The Visio for Enterprise Architects (VEA) constraint editor can be a little confusing when it comes to creating set (subtype, equality, and exclusion) constraints. I’ll describe how to create these constraints using examples from a related entry: http://www.objectrolemodeling.com/WebLog/tabid/58/blogid/42/Default.aspx. Although the examples I am using are for subset constraints, the procedure is the same for equality and exclusion constraints.

But first, some terminology and the general procedure:

A set constraint compares a role or role sequence to another identically typed role or role sequence. A role sequence is just a combination of roles. "Identically typed" means it can only compare roles of the same object type (or role sequences with the same object types in the exact same order).

Thus, the general procedure is as follows:

  1. Select the facts you wish to constrain (holding down the shift key to select more than one) and right-click/select "Add constraints..." (or select "Database | Add constraint") to bring up the constraint editor
  2. Select the type of constraint you wish to add (subset, equality, or exclusion)
  3. Choose the number of roles at each end of the constraint. If you are comparing one role to another, choose one (the default). If you are comparing role sequences, choose the number of roles in the role sequence (2 or more)
  4. Click the roles in the same order in which they would be compared (detailed further below). For subset constraints, you generally select the roles to be compared before the roles they are compared to.

Example One: The constraint spans one role across two facts (the first diagram in the entry above)

  1. Select a constraint type of subset and leave the number of roles at each end set to 1
  2. Click the Person role of the Person has been employed since Date fact
  3. Click the Person role of the Person is employed at Company fact

If should look like this:

Note that the roles to be compared in the constraint are highlighted and have a number corresponding to the order of comparison. In this case, the Person role of the Person has been employed since Date fact is compared to the Person role of the Person is employed at Company fact (and if that Person is not in an instance of the latter fact type, the constraint is violated)

Example Two: The constraint spans two roles per role sequence across two facts (the fourth diagram in the entry above)

  1. Select a constraint type of subset and set the number of roles at each end set to 2
  2. Click the Person role of the Person manages Project fact
  3. Click the Project role of the Person manages Project fact
  4. Click the Person role of the Person is assigned to Project fact
  5. Click the Project role of the Person is assigned to Project fact

If should look like this:

Note that the roles to be compared in the constraint are highlighted and have a notation corresponding to the order of comparison. The notation is in the format: [Role Sequence].[Role]. Notice that for each role sequence, the object types are the same: 1.1 is the same object type as 2.1 (and ditto for 1.2 and 2.2).

In this case, the [Person, Project] role combination of the Person manages Project fact is compared to the [Person, Project] role combination of the Person is assigned to Project fact (and if that [Person, Project] is not in an instance of the latter fact type, the constraint is violated).

Example Three: The constraint spans two roles per role sequence across three facts (the fifth diagram in the entry above)

  1. Select a constraint type of subset and set the number of roles at each end set to 2
  2. Click the Person role of the Person works on Project fact
  3. Click the Project role of the Person works on Project fact
  4. Click the Person role of the Person works in Department fact
  5. Click the Project role of the Department sponsors Project fact

If should look like this:

Note that the roles to be compared in the constraint are highlighted and have a notation corresponding to the order of comparison. The notation is in the format: [Role Sequence].[Role]. Notice that for each role sequence, the object types are the: 1.1 is the same object type as 2.1 (and ditto for 1.2 and 2.2).

In this case, the [Person, Project] role combination of the Person works on Project fact is compared to the [Person, Project] role combination of the Person works in Department and Department sponsors Project facts if those facts were joined on Department (and if that [Person, Project] is not in instances of the latter fact types across that join, the constraint is violated).

The pattern is similar if you have more than 2 roles per role sequence and/or more than 3 facts: you select the roles in the order in which they reside in the role sequence and then in the order in which you want to compare those role sequences.

Permalink |  Trackback
 

Note: To comment on a blog post, you must be logged in.

  Search Web Log  
 
 
  Categories  
   
  Archive  
   
  Blog Roll  
   
  Syndication  
   
 
© 2003 - 2009 Orthogonal Software Corporation. All rights reserved. Terms Of Use Privacy Statement