UML & SysML modelling languages

Expertise and blog articles on UML, SysML, and Enterprise Architect modelling tool

version francaiseTwitterVideos UMLChannel SparxSystems EA YouTubeLinkedIn
Saturday, 16 March 2013 10:19

Sparx Systems Enterprise Architect hints & tips, FAQ

Written by
Rate this item
(11 votes)

This page provides a selection of hints and tips for your daily use of Sparx Enterprise Architect. Various articles are also available via the EA hint tag.

Please do not hesitate to contact me via email (This email address is being protected from spambots. You need JavaScript enabled to view it.) if you're looking for additional hints, or if you have any that you would like to share so I can add them onto this page.

Available hints:

  1. keyboard shortcuts
  2. display a default diagram upon opening an EA project
  3. display a diagram or an element's comments/notes in a note on the diagram
  4. use the "drag and drop" to create a realization link between a use case and a requirement
  5. organise a class' attributes and operations using stereotypes
  6. reset a text label to its default position
  7. filter the search on a package instead of the whole project
  8. use ctrl-c and ctrl-v shortcuts in the project browser to copy/paste packages
  9. create multiple connectors between elements using the Relationship Matrix
  10. reverse a connector's direction
  11. copy a diagram in the Clipboard without the frame

Hint 1: Keyboard shortcuts

Here is a selection of keyboard shortcuts available in Enterprise Achitect:

  1. ALT-G: once an element has been selected from a diagram, Alt-G will highlight this element, e.g. a class or a use case, in the Project Browser.
  2. Ctrl-U: once an element has been selected from the Project Browser, Control-U will show the list of diagrams where this element has been used. If the selected class, use case, activity or other selected element from the project browser is found in a single diagram, EA will open this diagram.
  3. SHIFT-ALT-G  this shortcut makes it possible to find where the active diagram is located in the project browser, as Enterprise Architect will highlight this diagram in this project browser.
  4. Ctrl-TAB: similar to the Alt-TAB shortcut in Windows, this shortcut lets you switch between the list of opened diagrams with a preview window (this can be usefil when you have several diagrams opened).
  5. F2 on a selected element or connector from the diagram to edit the name of the element (e.g. class, use case, interface) or the transition.
  6. F4 on a selected element or connector from the diagram to change the colour or the line's width of a connector, or access the display settings of an element (background colour, font, line colour and width).

Hint 2: display a default diagram upon opening an EA project

To guide your colleagues and clients who have access to a shared EA project in a collaborative context, it can be useful to provide sufficient information once the project is opened, e.g. a title, summary, and hyperlinks to the main models, matrix, search queries.

You can achieve this by first creating a diagram that contains this information before setting it as the "Model Default":

  • Open the diagram to set as the default,
  • open the menu Diagram > Advanced > Make Model Default (EA version 10).
  • To make sure that it has worked, close and re-open your EA project ; your diagram should be displayed.
  • Note: if you use the Diagram toolbar, the "home" icon will open this diagram once clicked.

sparx enterprise architect make model default

Hint 3: display a diagram or an element's comments/notes in a note on the diagram

Sometimes you have the need to display onto a diagram the content of the diagram's or an element's notes (e.g. a class, interface, use case).

So you don't have to duplicate this content or to write it within a note outside the element i.e. in a diagram notes, Enterprise Architect makes it possible to display the content of an element or the diagram's notes within a note:

  • To show the diagram's notes content in a UML note:
    • select or create a new UML note,
    • right click on this note, and select Advanced > Link to Diagram Note
  • It is possible afterwards to unselect this option.
  • To show an element's s notes content in a UML note:
    • create a new UML note and associate it with an element from the diagram, e.g. a class,
    • right click on the association between the note and the element, and select Link this Note to an Element Feature...
    • choose Element Note as the "Feature type".
    • Other choices are available so you can instead display an attribute's description, an operation's, etc.
    • Sparx Enterprise Architect link note to element feature
  • Example of a note linked with the diagram's description, and of another note linked with a class description:

astuce EA : link note to an element feature and to a diagram note

Hint 4: use the "drag and drop" to create a realization link between a use case and a requirement

There are several means available to define traceability throughout your model, e.g. to create realization links between requirements and use cases:

  1. display both use cases and requirements on a new diagram, and simply create realization links using the QuickLinker by dragging links from a use case to a requirement;
  2. use the relationship matrix to display all use cases and requirements, and create new links via a right click > "create a new relationship".

Enterprise Architect also lets you drag and drop requirements from the project browser onto use cases that are displayed in the active diagram to create those links:

  • Open a use case diagram
  • Select a requirement from the "Project Browser", and drag/drop this element onto a use case of your choice to specify that this use case realizes this requirement -> the selected requirement is not added onto the diagram, but the realization link is created by EA.

EA hint : drag and drop to link a requirement with a use case

  • The generation of this new link can be checked through the use case or the requirements properties, in the links tab:

astuce-sparx-ea-lien-realisation-requirement-usecase properties

 

Hint 5: organise a class' attributes and operations using stereotypes

It is sometimes useful to reorganise the attributes and/or operations of a class by groups. For instance, you may have to separate and list the attributes defined in your legacy system from those that are seen as "custom".

In the illustration below, the original version of the class Task shows all its attributes, and a new version of that same class where attributes have been reorganised amongst the System and Custom stereotypes:

astuce enteprise architect regrouper les attributs d'une classe avec des stereotypes

To achieve this, you need to update each class' attribute (open the class properties -> Details tabs -> Attributes), and enter a value (e.g. System) in the Stereotype field for the current attribute:

définir un stéréotype dans l'attribut d'une classe

Hint 6: reset a text label to its default position

When working on the layout of elements within a diagram, text labels, e.g. guard conditions or transition names, are often moved around to improve the overall visibility.

Reverting a text label to its initial position is sometimes needed ; to achieve this, right click on the label, and select Default Position as illustrated below :hint ea to place a text label to its default position

Hint 7: filter the search on a package instead of the whole project

Enterprise Architect search feature is accessible via the keyboard shortcut Ctrl-F. By default, EA will run a search on the entire model.

However it can be useful to restrict the scope of our search on a selected part of the model i.e. a package and its contents. This can be achieved through the search advanced options:

1- Once the model search is opened, and details are provided (search module e.g. simple, extended, find orphans..., and criteria), click on Builder ; details of the selected search module e.g. "Simple" are displayed

2- Click on the "advanced options" icon, highlighted in green hereafter:

hint enterprise architect search builder

3- Modify the selection under "Search Scope" from "Return matching items for the entire model" to "Return matching items for the selected Package":


4- Select the package from the Project Browser on which the search needs to be done, and click on the Run action

Example: to "tidy up" your models, it is sometimes useful to search for orphan elements i.e. displayed on none of the diagrams in the project. In this scenario, it can be useful to restrict the search on a given model, e.g. business model, to avoid having the full list of elements within the project.

Hint 8: use ctrl-c and ctrl-v shortcuts in the project browser to copy/paste packages

This one is very straightforward, but good to know ; you can copy and paste packages from within your Project Browser via a right click, and "Copy Package to Clipboard" or "Paste Package from Clipboard".

Ctrl-C (copy) and ctrl-V (paste) on a selected package from the Project Browser will achieve exactly the same, whilst saving you time compared with the right click way.

Hint 9: create multiple connectors between elements using the Relationship Matrix

It would be really useful if it could be possible to create the same type of connector from a selection of elements to a target element. e.g. link several children classes to a main class via generalizations, link all use cases to a single actor or vice versa, link several activities to a gateway...

Since EA doesn't yet let you do this on the current diagram, the following workaround can help out : open the Relationship Matrix, display the source and target elements, Ctrl+Click to select multiple cells, and create the required associations. Go back to your diagram to work with the new links and associations.

Hint 10: reverse a connector's direction

Once you've created a directed connector between two elements, e.g. an aggregation between 2 classes or a data association between a BPMN2 activity and data object, you sometimes realise that the direction is incorrect and needs to be reversed. Instead of deleting the connector and creating a new one in the right direction, simply right click on the connector >  Advanced > Reverse Direction : 

Hint 11: copy a diagram in the Clipboard without the frame

It is often useful to copy and paste a diagram from EA to a Word document, Powerpoint presentation, e-mail, etc. To do so, simply press Ctrl-C in the diagram followed by Ctrl-V in the target tool. When the diagram frame is not needed, you can disable it via EA options: open the Tools menu, Options, and select Diagram. In Diagram Frames, disable option "'On Printed Images".