In addition to diagram enhancements and general changes in the Modeling perspective, numerous changes have been made to improve productivity and to comply with the UML specification.
Project Explorer enhancements
Filtering by name
In the Project Explorer, it is possible to display a text box that allows you to quickly filter out elements that do not interest you. Although working sets are useful in enabling filtering by entire models or projects, this textual element name filter is particularly handy if you have a large model, and you wish to see the elements of interest within it. Thus, this filter is more fine-grained.
- To activate the filter, click the Show/Hide Filter Box button in the Project Explorer's toolbar.
- Now, type some text in the filter box and press the Enter key on your keyboard.
Elements not matching the text string will be filtered out.
- If there are multiple elements matching your filter, use the Up or Down buttons to the right of the filter box to navigate between them.
- In addition, for even quicker access, simply click the element of interest in the pop-up window to navigate to it immediately.
- To determine whether the name filter should be taken into account, click the Down arrow button in the Project Explorer and choose Customize View.
- In the Filters tab of the Available Customizations dialog, check or uncheck Name Filter. If Name Filter is not checked, you will not be able to show the filter box.
Figure 1. Filtering by 'Util'
The textual filter can also be programmatically extended to support custom EMF EObjects. To extend it, implement this interface:
Grouping by diagram types
Previously, the Diagrams virtual folder contained a list of all of the diagrams for a given model. Now, the diagrams are grouped by their types.
Showing the physical location of model files
In some workflows, you might have models stored within subfolders of a project. Traditionally, the Project Explorer has displayed all of the models as children directly underneath the project. This became confusing if many of the models were given the same name. For example, if you created a Helper.emx model in each folder, it would become difficult to tell them apart.
Now it is possible to show the models and profiles with respect to the folder structure:
- Click Window > Preferences and choose Views >Project Explorer
- Then, check the check box labelled Show UML model and profile under its physical workspace file.
If you have UML Model files and UML Profile files filtered in the Filters tab of the Available Customizations view, those files will be hidden. Do not turn on the filters for UML Model files and UML Profile files if the Show UML model and profile under its physical workspace file preference is enabled, because the models and profiles will become completely hidden from your workspace.
- To further emphasize the physical location of the file, it is possible to display the workspace path of the resource next to the root resource's name:
- Show the Preferences view, and choose Modeling >Views > Project Explorer. The Display workspace path in labels drop-down menu allows you to choose one of three options (see Figure 2):
- For models and profiles
- For models, profiles, and fragment roots
The last two options will result in the resources' physical locations being displayed in the Project Explorer.
Figure 2. Project Explorer Preferences view
Working with the enhanced Element Imports functionality
When working with Element Imports, we are usually more concerned about the imported element, not the Element Import itself. Thus, several changes have been made to focus on the imported element, not the Element Import:
- The Element Import no longer displays the name of the imported element in brackets so that it will sort with the rest of the directly contained elements in the Project Explorer. In fact, if the Project Explorer is set to sort by Type then Alphabetical or Type then Storage Order, the sorting will be by the type of the imported element.
- If you select the Element Import / imported element in the Project Explorer, you will now see the properties of the imported element in the pop-up properties and in the Properties view. If you are interested in seeing the properties of the Element Import, choose Element Import Properties from the context menu. Alternatively, visualize the Element Import on the diagram and show its properties.
- The icon of the imported element (rather than an Element Import icon) is shown in the Project Explorer. A small shortcut icon will appear at the bottom-left of the icon to indicate that it is an Element Import.
- When adding new elements under the Element Import, you will be adding directly to the imported element, rather than having to navigate back to the original element. Similarly, when deleting the element under the Element Import, you will be deleting from the element import directly. In other words, the focus will be preserved in both cases.
- Navigating to the Project Explorer from diagrams, properties, and the Inheritance Explorer will make a better choice of selecting the element underneath the Element Import.
- It is possible to view the contents of the Element Import even if the element belongs to a model that has been filtered out by a working set. If you want to navigate to the actual element filtered out by a working set, and there is no corresponding imported element in context, you will get a message that notifies you of this.
FormatHelper and Point are both Element Imports (see Figure 3), so they appear with a shortcut decoration in the Project Explorer. Also, the properties displayed are for the imported element, not the Element Import.
Figure 3. Displaying the properties of an Element Import
Working sets are now supported by the Search infrastructure. It is possible to drag from the search results onto the diagram surface. Also, expanding a search result will show the references to the element.
Two new columns have been added:
- The element type has been moved into a separate column for easier sorting.
- A new column indicates the last modification date.
Finally, search results are now contributed by using a public provider mechanism defined in
com.ibm.xtools.rmp.ui.search, which allows programmatically contributing to the search results.
Figure 4. Using working sets on the model search page
Communicating validation results
The results of model validation are communicated visually to the user. Validation errors and warnings are now shown on diagram elements representing elements that have validation problems.
You can validate your model by performing one of the following series of steps:
- From the menu bar, select Modeling > Run Validation.
- From the context menu of the element in the Project Explorer, choose Validate.
- From the context menu of the element on the diagram, choose Validate.
As Figure 5 shows, hovering your mouse cursor over the validation decorator on the diagram element (a yellow exclamation or a red X) will display a pop-up message that describes the problem.
Figure 5. Hovering the mouse cursor over the validation decorator
A Problems on Selection dialog has been added in case you need further details. It shows a list of problems for the selection and gives you the chance to see details about the constraint that was violated (by pressing the Constraint Definition(s) button) or to perform quick fixes on the problems (by pressing the Quick Fix button). It is available from any element with validation errors or warnings, for elements in both the Project Explorer and on the diagram.
Figure 6. The Problems on Selection dialog contains the relevant markers
Repairing workspace references when the model is opened
In previous versions, when a model with broken references is opened, the Repair Workspace Reference dialog opened. There, you were given the choice of attempting to repair it automatically, marking the problems, or ignoring the broken references. The Repair button searched only the immediate projects. Now, however, an additional check box has been added so that you can search the entire workspace. The search will even detect models in closed projects and prompt you to open them if necessary.
Figure 7. Repair Workspace References screen displays two problems
Validation rules added
Previously, when you refactored an element (renamed or moved), you could preview the changes and individually choosing the resources that should be updated. When there are many affected elements, it became tedious to select the resources to be updated. Now, you can set the initial scope beforehand, as a shortcut. The three supported scopes are workspace, project, or model.
Figure 8. Use the refactoring wizard to choose a supported scope
Model fragments are handled more seamlessly than before. The context is preserved in the Project Explorer.
When reloading a model or model fragment that has been modified outside of the workspace, the focus in the Project Explorer is now preserved. Also, if a fragment is modified on disk, only the modified fragment is reloaded, not the entire model. For example, if you are using dynamic views, fragments and models can be changed by other users while you have the model loaded into memory. When this occurs, the context in the Project Explorer will be kept, so you spend less time trying to find your place in the model after loading fragments. This ensures a smoother workflow even when the model contents change and the model is reloaded.
Opening multiple subfragments at once
When working with a large model, portions of the model are typically fragmented into separate resources for better performance and to reduce the possibility of merge conflicts. By not opening the subfragments, less of the model is loaded into memory. This yields better performance. However, modelers with powerful machines might prefer to open all fragments immediately to eliminate the delay in case the fragment is loaded into memory later on. To accommodate this, the Open All Sub-fragments action now supports multiple selections so that you can select all the required fragments and open them all at once. Result: the time taken to load the fragments is spent upfront.
Figure 9. The Open All Sub-fragments action
Profiles are used to enable domain-specific modeling: they allow UML to be extended to suit a particular domain. Frequently, the same UML model is extensible to a variety of different domains. For example, the system to keep track of loyalty points might be essentially the same between two airline brands, with a few minor differences in the way that things are named and certain attributes or operations that are company-specific. Or different viewpoints into the same system might require different profiles. For example, the financial auditing domain and the reservations domain are two largely unrelated fields that focus on very different aspects, or viewpoints, of the same system. Perhaps the number-crunching auditors do not want to share their auditing criteria or attribute values with the reservations analysts, while the reservations gurus do not want to share their formulas on when to offer loyalty discounts.
Traditionally, it has been necessary to apply the profile directly onto the model to allow domain-specific modeling. For multiple domains, there was not much choice; you had to apply multiple profiles onto the same model or duplicate the model and apply a separate profile onto each one. In the former case, the model would then have irrelevant and potentially sensitive profiles; in the latter, the models could easily get out of sync.
Starting with Version 8, Rational Software Architect supports the concept of marking models: models that import a package and store the data regarding applied profiles and stereotypes on the imported packages. Packages are imported by using an Element Import stereotyped with the Marking Import stereotype. The profiles applied onto the marking model is applied virtually to the imported package, thus stereotypes can be applied onto the imported packages and their contents. When you apply stereotypes onto the imported package, only the marking model is modified, not the actual package's resource.
Figure 10. Use the New Model wizard template to create a new marking model
To have access to the profile information, the applied profiles and resources that contain the imported packages need to be distributed, in addition to the marking model.
If you are launching a runtime environment, be sure that the following settings are present in the arguments to enable support for marking models:
-Dorg.eclipse.uml2.uml.util.UMLUtil$ProfileApplicationHelper.INSTANCE= com.ibm.xtools.modeler.ui.marking:com.ibm.xtools.modeler.ui.marking.internal. ModelerProfileApplicationHelper -Dorg.eclipse.uml2.uml.util.UMLUtil$StereotypeApplicationHelper.INSTANCE= com.ibm.xtools.modeler.ui.marking:com.ibm.xtools.modeler.ui.marking.internal. ModelerStereotypeApplicationHelper
Stereotype properties can now be displayed on diagrams in either of these two ways:
- The first way is to right-click to show the context menu of the diagram element and then select Filters >Stereotype and Visibility Style > Show Stereotype Compartment When Not Empty. This makes visible the stereotype compartment that contains the names and values of the attributes.
- The second way is by adding a Stereotype Attribute Note in either of these ways:
- Right-click the element with the stereotype, and select Add UML > Stereotype Attribute Note. A note attached to the original stereotyped element will be added.
- Alternatively, from the palette:
- Select the UML Common palette drawer (see Figure 11).
- In the Comment palette group, choose the Stereotype Attribute Note Attachment tool item.
- Then click the stereotyped element and drag the cursor to a blank area of the diagram.
- In the ensuing context menu, choose Create Stereotype Attribute Note Attachment to new Element: Stereotype Attribute Note.
Figure 11. Displaying stereotype properties
Property sets are used to group a collection of attributes (or properties). They supercharge the functionality of profiles and simplify application of stereotypes. A property set profile is applied to a package in a model (or the model root). Stereotypes in a property set profile are similar to required stereotypes in that they are implicitly applied to the elements of the specified metaclass. Also, it is possible to save sets of values and apply them to quickly replace the defaults defined in the profile.
To create a property set profile:
- First, create a normal UML profile, and then apply the deployed Property Set profile to it.
- Next, apply the
PropertyProfilestereotype to the root of the profile.
- Now you are ready to add stereotypes. As you add stereotypes, you will find that each stereotype of the profile has the Set stereotype applied to it automatically.
- For every stereotype that you create, you must add a metaclass extension to the package in addition to any other desired metaclass extensions. This is because the stereotypes in property set profiles are to be applied to packages; the contents of the package where the stereotype is applied will automatically have the relevant stereotypes applied.
stereotype and the
Setstereotype both contain properties called category, but their intended use is different. The
PropertyProfilecategory is intended to describe a broader category, such as a language (Unified Auditing Language), while the
Setcategory is to correspond to a specific type within the language (Class). The
Set's category is important, because if it does not mach, the property set's UI will not show.
After creating the property set profile, it is to be applied to a model or package. When you browse the model, relevant elements inside the model will have a Property tab labelled Property Sets. From there, you can set the desired values. If you change the values from the defaults, the corresponding stereotype will be automatically applied to the element. (Also, the attribute name will appear in bold to indicate that the stereotype has been changed.) Clicking the Apply Defaults button will restore the default values and reverse the automatically applied stereotype.
Two new UML diagrams described in the UML specification are now supported in Rational Software Architect: the interaction overview diagram and the timing diagram. In addition, support for several new elements has been added, which are described in the following subsections.
Interaction overview diagram
The interaction overview diagram can be thought of as an activity diagram that has been restricted to control flows and embedded sequence diagrams. Thus, they are useful in expressing control flows, as well as the individual interactions that occur. Sequence diagrams that appear on interaction overview diagrams do not have to be created from scratch; you can reuse existing ones and either drag them onto the interaction overview diagram or select the Interaction Reference palette tool from the Interaction Overview palette drawer.
To work with the contents inside the referenced sequence diagrams (called the Interaction Reference), from the context menu of the interaction reference diagram element, select Filters > Show Inline Sequence Diagram.
Figure 12. An interaction overview diagram
The timing diagram portrays lifelines across a period of time. The vertical axis represents time in sequence diagrams, but the timing diagram uses the horizontal axis to represent time. States or conditions are added to the horizontal lifelines to represent changes in states or conditions over time. As with sequence diagrams, there is the concept of messages. However, because the focus is on states and conditions over time, the messages are sent between these states or conditions.
Figure 13. A timing diagram
The UML Modeler component now adds support for lost messages and found messages.
Lost messages and found messages
To comply with the UML specification, it is now possible to create lost messages and found messages.
- To create a lost message, drag the message to an empty area of the diagram.
- To create a found message, drag the message, starting from an empty area of the diagram.
Figure 14. Lost and Found messages in a sequence diagram
Deleting a message's referenced signal or operation updates the name of the message to
\Unspecified\ on the sequence diagram, in addition to removing the referenced signal or operation. You can rename the message as you wish.
Moving an operation from one class to another yields the same result unless the operation is moved to a superclass and is still visible from the class where it is invoked. Again, in this case, the messages between lifelines will be set to
If you had diagrams where you performed such refactorings before these enhancements, you can still benefit. As an example, suppose you open a diagram where you previously moved an operation corresponding to a message on a sequence diagram from one classifier to another. As a result, the diagram now contains an invalid message.
A validation rule to handle invalid messages in sequence diagrams has been introduced. The constraint for this rule can be found in this UML 2.2 specification:
UML 2.2 > UML 2.2 Specification > Interactions Package > Messages > Message signature operation should be contained in target lifeline classifier
When invoking a private operation and validating the model, a warning is now generated when validating the model. The validation constraint is controlled by UML 2.2 private operation call specification:
UML 2.2 > UML 2.2 Specification > Interactions Package > Messages > Private operation call (or UML 2.2 > Model Quality Dimensions > Correctness > Private operation call).
To see the constraint definition, as well as to enable or disable the constraint, select the Preferences view, and then, select Model Validation >Constraints.
Figure 15. The Model Validation, Constraints page in the Preferences view
Start Object Behavior action
The Start Object Behavior action element is now supported. To create a Start Object Behavior Action:
- Select the Actions palette drawer.
- Choose the Start Object Behavior tool item from the Object Actions tool group.
You can also find the Start Object Behavior action in the Object Action submenu in the Add UML context menu.
Figure 16. A Start Object Behavior in an activity diagram
State machine diagram
Entry and exit points
It is now possible to add entry points and exit points to the borders of composite states and orthogonal states.
- To do so, add a composite state or orthogonal state to the state machine (from the State Machine palette drawer, select the State types group, and then select either Composite State or Orthogonal State).
- Then, from the State Machine palette drawer, choose the Pseudostate Types tool group, followed by Entry Point or Exit Point.
You can also find Entry Point or Exit Point options in the Add UML context menu.
Any Receive Event
The Any Receive Event action is now supported.
- To add an Any Receive Event, first add a transition to a state's region.
- From the properties of the transition, activate the Triggers tab, and then click the Add button.
- In the Event Type drop-down menu, choose Any Receive Event.
- Click the OK button.
Figure 17. Selecting an Any Receive Event in a sequence diagram with an entry point and an exit point
Viewpoints have been enhanced to support an active language. It is also possible to share viewpoints, and an API has been added to the extension point to better support viewpoint use among different domains.
It is now possible to associate the active language with a viewpoint. In the Preferences dialog window (Modeling > Viewpoints page, shown in Figure 18), a new tab titled Active Language is now available. It can be used to configure the default language for user-defined viewpoints.
Figure 18. The Active Language tab on the Viewpoints preference page
Exporting and importing viewpoints
Additionally, viewpoints can now be shared. On the Viewpoints preference page, two buttons have been added to support importing and exporting viewpoints. Click Export on the Viewpoints preference page to display the "Export viewpoints" window.
Figure 19. "Export viewpoints" dialog window
Compare Merge enhancements
Improved alias support
When merging two versions of a model where the alias has been modified, the revision now shows as a single Modify change rather than an Add and Delete pair of changes.
Figure 20. Merging a model where the alias has been changed
Option added to filter the export log
When you perform a merge session, it is possible to filter the display to hide the changes that you are not interested in. When you click the Save List of Changes button, a Save Changes dialog window will now be displayed before the file is generated. With this dialog's options, you can decide whether you would like the filter settings to be applied to the log file or not.
Figure 21. The Save Changes dialog window in a merge session
This article provided an overview of the new functionality in the UML Modeler component of Rational Software Architect Version 8.0. By taking advantage of these enhancements, you will be able to model more effectively and efficiently, with an emphasis on clearer diagrams, problem prevention and resolution, and workflows that support collaboration.
The next and last article in this series describes important API changes and additions that allow extending Rational Software Architect features.
The author expresses his gratitude to Dusko Misic and Michael Hanner for reviewing this article and to Judith Broadhurst for editing.
- Read this author's related articles to learn more about modeling with Rational Software Architect:
- Migrating models to the IBM Rational Software Architect 8.0 format, a developerWorks article by the author of this article.
- Follow the More content in this series link in this article to Parts 1 and 3.
- Using the new features of the UML Modeler in Rational Software Architect Version 7.5, an IBM developerWorks article by Wayne Diu (September 2008)
- Learn more about Rational Software Architect versions available.
- Visit the Rational software area on developerWorks for technical resources and best practices for Rational Software Delivery Platform products.
- Stay current with developerWorks technical events and webcasts focused on a variety of IBM products and IT industry topics.
- Attend a free developerWorks Live! briefing to get up to speed quickly on IBM products and tools, as well as IT industry trends.
- Follow developerWorks on Twitter.
- Watch developerWorks on-demand demos, ranging from product installation and setup demos for beginners to advanced functionality for experienced developers.
- Explore Rational computer-based, Web-based, and instructor-led online courses. Hone your skills and learn more about Rational tools with these courses, which range from introductory to advanced. The courses on this catalog are available for purchase through computer-based training or Web-based training. Additionally, some "Getting Started" courses are available free of charge.
Get products and technologies
- Download either or both version for a trial:
- Evaluate IBM software in the way that suits you best: Download it for a trial, try it online, use it in a cloud environment, or spend a few hours in the SOA Sandbox learning how to implement service-oriented architecture efficiently.
- Join the discussion in the Rational Development Tools forum.
- Get involved in the My developerWorks community. Connect with other developerWorks users while exploring the developer-driven blogs, forums, groups such as the Rational Café, and wikis.
Dig deeper into Rational software on developerWorks
Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.
Experiment with new directions in software development.
Software development in the cloud. Register today to create a project.
Evaluate IBM software and solutions, and transform challenges into opportunities.