Kogod School of Business
American University
Last updated on 12/29/09
Getting Started Prepare
Visio File
Context Diagrams Use
Case Diagrams Activity Diagrams Cross-Functional
Flowcharts
Data Models Class
Diagrams Packages Data
Flow Diagrams
Note: These instructions are for MS Visio Professional 2003 (11.3216.6408), which is installed in the Kogod Lab computers. Some of these instructions may not work exactly as detailed below in other versions of MS Visio, such as the ones running in the Anderson Lab, but there are usually workarounds in those other versions.
Useful Tip -- Copying a diagram into MS Word: to copy a Visio diagram to an MS Word document, first select all objects in your Visio file by pressing Ctrl and A in your keyboard or Edit and Select All from the menu. You can also select and de-select individual objects by pressing Ctrl and click-selecting the object with the mouse. Once all necessary objects are selected in your diagram either press Ctrl C or select Edit Copy from the menu to copy the selected objects to the clipboard. Then go to your MS Word document (e.g., Project.doc), and select Edit, Paste Special, Picture (Enhanced Metafile). I find that the Enhanced Metafile provides the best display format for Word.
Define your packages: packages are used for large systems that are too complex for a single Use Case diagram, by distributing different and related parts of the system to the various packages (more about this later in the semester). For now, you will work with one package only, the Top Package. You can decide later if you will need more packages (probably not).
Note: again, you don't need this at this point, but if you were splitting your model into several packages, you would need to right-click on the Top Package and then select New, then Package. This creates a package under the Top Package (think of this as folders). Then create all other packages that you need and then create model artifacts in any package you wish by right-clicking on that package. Try it out on a separate practice Visio file.
The requirements specification for your project needs three UML artifacts: (1) An Activity Diagram for the business process model; (2) a Context Diagram; and a (3) Use Case Diagram. Let's start blank diagrams for these three artifacts.
For the Business Process Model: MS Visio supports several business process models, but we will use an Activity Diagram instead. Activity Diagrams are generally used in UML to model the internal process of a use case and to model the interaction among use cases. While activity diagrams are not precisely business process modeling artifacts, they are used extensively by UML analysts to model software processes and other processes, so they are often used by these analysts to model business processes too.
For the Context Diagram: MS Visio doesn't support context diagrams specifically, but you can use a Use Case diagram model to draw your context diagram. So, Click on the UML Use Case banner in the Shapes pane to display the Use Case symbols
To copy your diagram to the Project.doc document: once you have a diagram ready to be transferred to your project document, press Ctrl and A in your keyboard, which selects all objects in your diagram (alternatively, select Edit from the main menu and then Select All). Then either press Ctrl C or select Edit Copy to copy the selected objects to the clipboard. Then go to your MS Word document (e.g., Project.doc), and select Edit, Paste Special, Picture (Enhanced Metafile). I find that the Enhanced Metafile provides the best display format for Word.
Your are ready to start modeling !!
Add One Use Case: drag one use case symbol (oval) from the Shapes window to the drawing window. This symbol will not represent a use case, but your system's boundary, which is represented as an oval in a context diagra
Notice that when you click on the Use Case it displays some small green squares, which you can use to re-size the oval figure
Notice that Use Cases have little “x” marks, which are the connecting points to connect lines to other symbols in your diagram
DOUBLE-click on the oval to change its name to something like "My System Context Diagram".
STOP and SAVE your WORK in your G drive!!
Add Actors: drag Actor icons from the Shapes pane to the drawing pane until you have all the actors you need, and place them around the oval figure representing your system.
Notice how Visio adds these Actors to your Use Case diagram in the Model Explorer window
Notice that when you click on an Actor it displays some small green squares, which you can use to re-size it. WARNING: Visio moves the actors around in a funny way when you do this – if this happens click on the Undo button.
Notice that Actors have little “x” marks, which are the connecting points to connect lines to other symbols in your diagram
DOUBLE-click on any Actor to change its name. All you need to type for now is Actor names. You can enter descriptions if you wish, but don't change any other items in the dialog box
STOP and SAVE your WORK in your G drive!!
Connect Actors with the System: To connect one Actor with the System “Communicates” line from the Shapes window to the drawing window. IMPORTANT!! Only use the "Communicates" symbol to connect actors with your system. Often students make the mistake of selecting other lines, which is technically incorrect (and external clients pick up on this). DO NOT use the Extends, Uses or Interface lines. These are for other purposes that we will discuss later on in class. All you need for now is simple "communicates" lines.
Once the line is in your diagram, connect one end to an Actor's connecting point until the green square becomes red. If the connecting point does not turn red it is not connected to the Actor. Then connect the other end of the line to a connecting point of in the system oval figure, also until it turns red.
Add arrow heads to connectin lines: notice that each end of the line is named (e.g., End1, End2). DOUBLE-click on the line and check the IsNavigable box of the corresponding end where you want the arrow to appear. In Visio and some UML artifacts, IsNavigable translates into directional arrows.
You can change the End name if you wish from the line's property box, but I suggest that you actually suppress the end names from the diagram as I explain below.
STOP and SAVE your WORK in your G drive!!
Clean up your Diagram: Grids, connecting points, and end names in lines are useful when drawing your diagram, but they add confusion when you are trying to read a diagram. I suggest removing them once you are done with your diagram.
To remove the grids, select View, then uncheck Grid
To remove connecting points (they will remain there, but will not be visible), select View, then uncheck Connecting Points.
To remove end names from connecting lines, click on any line until the connecting points are displayed, then select Shape, Actions, Shape Display Options.
Once in the UML Shape Display Options, uncheck the First end name, Second end name, End multiplicities (not needed for this diagram) and End visibilities (not needed for this diagram). The only box checked should be the End Navigability box, which displays the arrows.
Then check the two boxes that say “Apply …” at the bottom and click OK. Notice how much cleaner your diagram works
Click on the UML Use Case banner in the Shapes pane to display the Use Case symbols
Note: If you create more than one Use Case Diagram within this package, Visio adds a new page. In general you should not have more than one Use Case diagram in a single package, so if you create multiple Use Cases within a package, Visio treats them as multiple pages of the same diagram
Try it out in a separate practice file or in this file and delete later: create another Use Case diagram from the Top Package (and only package you have at this point) and see how Visio creates new pages
Then highlight the icon of the Use Case diagram you just crated in the Model Explorer window
Now drag all the symbols you need for your diagram
Start with the system boundary, by dragging the System Boundary symbol from the Shapes window to the drawing window
Then, double click on the system title to change the name of your system
STOP and SAVE your WORK in your G drive!!
Add Actors: Then drag all the Actors you need from the Shapes pane to the drawing pane, and place them around and outside the system (i.e., actors are external to the system).
Notice how Visio adds these Actors to your Use Case diagram in the Model Explorer window
Notice that when you click on an Actor it displays some small green squares, which you can use to re-size it. WARNING: Visio moves the actors around in a funny way when you do this – if this happens click on the Undo button.
Notice that Actors have little “x” marks, which are the connecting points to connect lines to other symbols in your diagram
DOUBLE-click on any Actor to change its name. All you need to type for now is Actor names. You can enter descriptions if you wish, but don't change any other items in the dialog box
STOP and SAVE your WORK in your G drive!!
Add Use Cases: Then drag all the Use Cases you need from the Shapes window to the drawing window, and place them inside the system (Use Cases should be internal to the system).
Notice how Visio adds these Use Cases to your diagram in the Model Explorer window
Notice that when you click on a Use Case it displays some small green squares, which you can use to re-size it.
Notice that Use Cases have little “x” marks, which are the connecting points to connect lines to other symbols in your diagram
DOUBLE-click on any Use Case to change its name. All you need to type for now is Use Case names. You can enter descriptions if you wish, but don't change any other items in the dialog box
STOP and SAVE your WORK in your G drive!!
Connect Actors with Use Cases: To connect one Actor with one Use Case, drag a “Communicates” line from the Shapes window to the drawing window. WARNING: DO NOT use the Extends, Uses or Interface lines. These are for other purposes that we will discuss later on in class. All you need for now is simple connecting lines.
Once the line is in your diagram, connect one end to an Actor's connecting point until the green square becomes red. If the connecting point does not turn red it is not connected to the Actor. Then connect the other end of the line to a connecting point of the corresponding Use Case, also until it turns red.
To add arrows to the line, notice that each end of the line is named (e.g., End1, End2). DOUBLE-click on the line and check the IsNavigable box of the corresponding end where you want the arrow to appear.
You can change the End name if you wish from the line's property box, but I suggest that you actually suppress the end names from the diagram as I explain below.
STOP and SAVE your WORK in your G drive!!
Cleaning up your Diagram: Grids, connecting points, and end names in lines are useful when drawing your diagram, but they add confusion when you are trying to read a diagram. I suggest removing them once you are done with your diagram.
To remove the grids, select View, then uncheck Grid
To remove connecting points (they will remain there, but will not be visible), select View, then uncheck Connecting Points.
To remove end names from connecting lines, click on any line until the connecting points are displayed, then select Shape, Actions, Shape Display Options.
Once in the UML Shape Display Options, uncheck the First end name, Second end name, End multiplicities (not needed for this diagram) and End visibilities (not needed for this diagram). The only box checked should be the End Navigability box, which displays the arrows.
Then check the two boxes that say “Apply …” at the bottom and click OK. Notice how much cleaner your diagram works
STOP and SAVE your WORK in your G drive!!
Click on the UML Activity banner in the Shapes pane to display the Activity Diagram Symbols
Highlight the icon of the Activity Diagram you just crated in the Model Explorer window for your Business Process Model
Add Swim Lanes: drag one use swim lane for every actor, user, function or department you want to model from the Shapes window into the drawing window.
DOUBLE-click on each swim lane and change the respective names from "Partition1, 2, etc." to the corresponding actors, users, functions or departments you are modeling
Drag all other symbols you need from the Shapes window to the drawing window (you may want to drag one or two symbols at a time). The symbols should be placed in the swim lane of the corresponding actor, user, function or department carrying out that activity.
All symbols in an Activity Diagram are connected with directed arrow using the Flow Control symbol (in some cases you can use Object Flow symbols, but you won't need them for the business process model). Drag a Flow Control arrow from the Shapes window into the drawing window.
Once the arrow is in your diagram, connect each end of the arrow to the corresponding symbol you are connecting until the green square becomes red. If the connecting point does not turn red it is not connected to the symbol. Once arrows and symbols are connected with red squares you can move the symbol around and the arrow will move with it.
Diagonal flow control arrows create confusing diagrams in this model. Please change all diagonal lines to angled arrows by right-clicking on the arrow and selecting Right-Angle Connectors.
Use Action State symbols to diagram activities in the process. You can use the State symbol to annotate a particular state of the process that doesn't have an activity (e.g., outstanding invoice). You will use the Action State symbol for the most part.
Use Decision symbols to diagram decision points (e.g., approve credit?). It is important that you put some text in your diagram indicating what decision you are making. You can do this by selecting View from the main menu, then Toolbars, then Drawing. Once you have the drawing toolbar visible, click on the text box icon, create a text box in the diagram and type in the text. Then close the drawing toolbar (it will keep drawing things in your diagram otherwise). The border of the text box should not be visible in the diagram, so right-click on the text box an select Format, then Line, then select None in the Pattern box.
It is also important to add some text indicating the outcome of the decision (e.g., Yes or No, Approve or Disapprove). You should also note this with text boxes. Once you do this, connect Flow Control arrows from the corresponding decision point to the next related symbol.
If an activity branches into several others, use the Transition Fork symbol. Connect the activity to the Transition Fork and then draw lines from this fork to the corresponding next symbols.
All activities running in parallel eventually need to merge, either into an activity or the Final State. To do this, use the Transition Join symbol. Connect each of your merging arrows into the Transition Join, and then connect the Transition Join to the next activity or the Final State.
STOP and SAVE your WORK in your G drive!!
Cleaning up your Diagram: Grids, connecting points, and end names in lines are useful when drawing your diagram, but they add confusion when you are trying to read a diagram. I suggest removing them once you are done with your diagram.
To remove the grids, select View, then uncheck Grid
To remove connecting points (they will remain there, but will not be visible), select View, then uncheck Connecting Points.
Run MS Visio
Select Business Process then Cross-Functional Flowchart
Or, select File from the main menu, New, Business Process, Cross-Functional Flowchart
Then select the band (swim lane) orientation as Horizontal or Vertical (a matter of preference), but horizontal swim lanes are popular for business process models
It is better to get rid of the grid lines, select View and uncheck the Grid box
Select the Cross Functional Flow Chart Shapes banner from the Shapes window on the left.
Note: if you don't see the Shapes window, open it by selectivn View from the main menu, then Shapes Window
Drag all the swim lanes you need from the Shapes window to the drawing window on the right--swim lanes are used to separate processes by department, function, actor, user, etc.
Give a name to each of your swim lanes by double-clicking on the <Function> title at the left of each swim lane
Drag all the separators you need from the Shapes window to the drawing window--separators are used to differentiate important phases in the process (e.g., loan application, loan processing, loan maintenance)
Give a name to each phase by double-clicking on the <Phase> title at right end of the phase
Once you have all your swim lanes and phase separators, click on the Basic Flowchart Shapes banner in the Shapes window to view all the symbols you can use in this diagram
You can drag any symbol you may need to the drawing window, but the symbols most often used in business process models are: process, decision, document, direct data (rotated to vertical), terminator, off-page reference, and annotation.
Connect the symbols as needed using the Dynamic Connector symbol. Drag a dynamic connector line to your diagram and drop it anywhere. Once the line is in your diagram, connect one end to the first symbol you want to connect until the green square becomes red. If the connecting point does not turn red it is not connected to the symbol. Then connect the other end of the line to the other symbol you are connecting to, also until it turns red.
Add text to your symbols as needed by double-clicking on the symbol.
Also, you will notice that all symbols have a dark background color, which some times makes it hard to read. To change or remove the background color, righ-click on the symbol, then select Format then Fill and change or delete colors as desired.
OTHER IMPORTANT SYMBOLS:
Start and End: Business process diagrams have a well defined start and end (just like activity diagrams have an initial and ending state). You need to drag two terminator symbols to your diagram. Place one terminator symbol at the very beginning of your diagram and write "Start" on it by double-clicking on the symbol. Similarly, place a terminator symbol at the end of your diagram and write "End".
Connecting pages: if your process model spans more than one page, place and Off-Page Reference symbol at the end of the first page and write in a reference number or letter (e.g., 1 or A), then continue your diagram in the next page, but place an Off-Page Reference symbol at the beginning of the diagram using the same reference number or letter you used at the end of the prior page
Cleaning up your Diagram: Grids, connecting points, and end names in lines are useful when drawing your diagram, but they add confusion when you are trying to read a diagram. I suggest removing them once you are done with your diagram.
To remove the grids, select View, then uncheck Grid
To remove connecting points (they will remain there, but will not be visible), select View, then uncheck Connecting Points.
Note: ERD's are not UML artifacts. They are relational models. Therefore, you can't include them in the same file with your Visio requirements models. So, when you save your data model, ensure that you use a different file name than the one you used for your UML requirements diagrams.
Run MS Visio
Select Database then Database Model Diagram
Or, select File from the main menu, New, Database, Database Model Diagram
It is better to get rid of the grid lines, select View and uncheck the Grid box
Drag the necessary Entities to your diagram: Double click on an entity and enter its name in the Definition tab
Then enter the respective fields in the Columns tab
Check the PK box for the fields making up the primary key
Ensure that the PK fields are at the top, if not, use the Move Up button to move the PK to the top
Drag a Relationship line to the diagram: Before you continue, there are many notations you can use for relationships. The one we use in this class is the Crow's Feet notation. When you first drag the relationship line, you will probably see an arrow. We need to change this to Crow's Feet notation.
To do this, select Database from the main menu, then Options, then Document. Check the Relationships and Crow's Feet boxes. Also check the Show Verb Phrase radio button and check the Forward Text box
Note: relationships have forward names (e.g., clients place orders) or inverse names (e.g., orders are placed by clients). Checking the Show Verb Phrase will show the relationship name in the diagram, and selecting the Forward Text box will show the forward name only, which is more intuitive. If you disagree, then uncheck the Forward Text box and check the Inverse Text box.
You should now see a one-to-many relationship line. Connect the "many" side of the line to the table with the "many" relationship, and the "one" side to the table with the "one" relationship (e.g., "one" client can place "many" orders. You connect the relationship line with the entity when the green dot turns red .
You will notice that the relationship name is over the line. To correct this, if you want to move the name above or below the line, click on the relationship line, then right-click on it, and select Format, Text. Then click on the Text Block tab and add to the Bottom Margin to move up, or add to the Top Margin to move down. To move the text right or left, click on the Paragraph Tab, then either add to the Before Text or After Text indentation.
One observation about relationships: some times when you connect two entities with a relationship line you don't get the minium cardinality you desire. For example, instead of a one-to-(one or many) relationship, you may see a (zero or one)-to-(zero or many). To correct the "zero-or-many" side and make it a "one or many", click on the relationship line, then select "Miscellaneous" on the properties box, and then select a cardinality of "one or more". To correct the "zero or one" to "one and only one" is a bit trickier. To make this correction you need to make the foreign key field mandatory. To do this, select the table on the "many" side of the relationship. Then, in the properties box, select Columns, and then check the box labeled "Req'd" for the foreign key field. When you check the box, the foreign key field must match a value in the primary table and therefore it must exist, so the minimum cardinality can no longer be zero, but has to be one. Visio knows this and changes the cardinality accordingly.
Click on the UML Static Structure banner in the Shapes pane to display the Activity Diagram Symbols
In the Model Explorer, right-click on either the Top Package or any other package that you may have created under the Top Package to draw your class diagram
Drag the necessary Classes to your diagram
Double click on a class and enter its name in the UML Class Properties dialog box.
Click on the Attributes button to enter the respective properties for that class
Click on the Operations button to enter the respective methods or operations for that class
Draw the necessary Inheritance links
To draw a "generalization" inheritance link (Generalization-Specialization or Gen-Spec inheritance) drag a Generalization line (the one with the little triangle). Connect the line to the more specific class (i.e., sub-class) and the triangle pointing to the general class (super-class). Note: because a super-class can have many sub-classes associated with it, there is no need to indicate the multiplicity (i.e., cardinality) of the relationship
To draw a "whole-part" inheritance link, drag a Composition line (the one with a little diamond). Connect the line to the "part" class (i.e., sub-class) and the diamond to the "whole" class (i.e., super-class). Note: because an object of the "whole" super-class can be associated with one or many objects of a "part" sub-class, we need to indicate the multiplicity (i.e., cardinatlity) of the relationship.You can change the multiplicity of a relationship by clicking on the relationship line.
Draw other relationship links among classes (for Object-Oriented databases, similar to data models)
To draw a relationship link, drag a Binary Association line and connect each end of the line to the respective classes that have the relationship you are modeling. Again, like in data models, you need to specify the mulitiplicities (i.e., cardinality) of the relationship.
Relationships often have a (verb) name that describes the relationship. The name is some times omitted in these diagrams to reduce clutter, particular when the relationship is obvious. To display (or hide) the relationship name, click on the relationship line, then select Shape from the menu, then Actions, then Shape Display Options. Then check (or uncheck) the Name box. Similarly to remove end line names uncheck the corresponding boxes.
Complex UML models are often broken into Packages. Each package groups UML artifacts associated with a particular functionality or distinguishing characteristic of an application. For example, in a loan application model, one package may contain all the loan application use cases, whereas another may contain all the loan servicing use cases.
Similarly, different UML diagrams (e.g., class diagrams, use case models) may be organized in separate packages.
The relationship among packages can be shown in a Package diagram
It is always good to plan the use of packages before you start drawing models
So, start with a blank UML model. Select File, New, Software, UML Model Diagram
In the Model Explorer, click on the Top Package
Once the Top Package is selected, drag a Package icon into the drawing and give it a name (e.g., Loan Application)
Notice that two things happen when you drag the first package to the drawing: (1) a Static Structure-1 name and symbol appears under the Top Package in the Model Explorer. This is the Package Diagram itself (Package digrams are static structures). Click on this static structure (or right-click and select Rename) and give it a name (e.g., "Use Case Model Package Diagram"); (2) a Package Folder appears under the Top Package with the name you gave to the Package. This is where you will draw the part of the model corresponding to this package.
Then drag all other necessary Packages and give each a name (e.g., Loan Service, Credit Management)
Notice also that each package also has a Static Structure icon. You can delete these (unless you plan to draw a static structure in the package, like a Class Diagram -- you won't need them for Use Case models).
To draw portion of a Use Case model in a Package, righ-click on the Package, then select New, Use Case Diagram
Give this Use Case Diagram a name (e.g., Loan Application Use Case Diagram)
Do the same for all other packages
Notice that a worksheet tab appears in the drawing window for each diagram you have defined.
Now, simply jump to each diagram or sheet and draw your model as necessary
Actors in one package can connect to use cases in another package. If you model actors or use cases from another, simply drag the respective actor or use case from the other package to the current package. You will notice that the package name prefix will appear in the actor or use case name with a colon (:).
If an actor in one package connects to a use case in another package, you need to draw a line between these two packages in the Package diagram. You can use a Binary Association line for this purpose.
Select File, New, Software, Data Flow Model Diagram
Draw the context diagram in the Top Process by dragging the necessary sybols and connecting them wit data flow links. Data flows in these diagrams have direction.
The Interface symbol is used for sources and consumers (sinks) of data external to the system
The Data Store symbol is used for internal data storage
The Process symbol is used for the processes (i.e., programs) that move the data from one process to another or between between data sources and sinks or data stores.
To draw level 1, 2, etc. dataflow diagrams, simply insert new pages and draw them there.