Create editable sequence diagram with Rational Software Architect

Sequence diagrams play a key role in documentation. These diagrams easily depict the flow, interaction among objects, and message communication, Bala Subramanaian Vetrivel describes how to generate sequence diagrams for Java projects by using IBM Rational Software Architect for WebSphere Software, Version 7.5.4. He also explains the limitations of sequence diagrams that cannot be edited, the need for generating editable sequence diagrams, and steps to generate editable diagrams.


Bala Subramanian Vetrivel (, Technical Specialist, IBM

Author1 photoBala Subramanian Vetrivel is a Technical Specialist on the Worldwide WebSphere Business Partner team. He has seven years of experience in the IT Industry and his areas of specialization include BPM, C/C++, IBM Blueworks, IBM Component Business Model, IBM PureSystems, IBM Rational products, IBM Workload Deployer, Java, SOA, WebSphere Application Server, WebSphere Business Modeler and Monitor, WebSphere Business Services Fabric, WebSphere Industry Content Packs, WebSphere Integration Developer, WebSphere MQ, WebSphere Process Server, and WebSphere TX. In his current role, he works with IBM business partners and customers on architecture design, proofs of concepts, requests for proposals, and technology enablement. He also has contributed to developerWorks articles, the Biztech project, and IBM Redbooks. You can contact Bala at

19 June 2012

Also available in Chinese Russian

Import the sample application

In working through this example, you will use the Enterprise JavaBeans (EJB) 3.0 Counter sample that is included with IBM® Rational® Software Architect to generate sequence diagrams. First, import this sample application:

  1. Start Rational Software Architect in a new workspace.
  2. Click Help and then Welcome on the menu from the workspace.
  3. Click the Samples icon, as shown in Figure 1, to open a window with options
  4. Select Counter application from the list of sample applications (Figure 2).
  5. Click Import sample from the help window (Figure 3).
  6. It the dialog window that opens, specify the folder where you want to copy the projects in Project location root.

Rational Software Architect then copies all projects of the Counter application to the specified location and imports them into workspace, as shown in Figure 4.

Figure 1. Select samples
Samples icon highlighted in the toolbar
Figure 2. Select the Counter application
Screen segment shows the Counter application selected
Figure 3. Import the Counter sample
Import sample option selected
Figure 4. Counter sample in the workspace
Counter sample projects imported into the workspace

Generate a non-editable sequence diagram

By default, Rational Software Architect generates a non-editable sequence diagram. Follow these steps to create the diagram:

  1. In the Outline tab view shown in Figure 5, select the class and method for which you want to generate sequence diagram.
Figure 5. Select the method from the list in the Outline tab
getRequestParam() selected under PageCodeBase
  1. Right-click on the method, and select Visualize > Add to New Diagram file > Static Method Sequence Diagram, as shown in Figure 6.
Figure 6. Generate a static method sequence diagram
Selections shown in sequence on three drop-down menus
  1. Specify the path to the diagram to be generated in the next window.

Rational Software Architect then generates sequence diagram as shown in Figure 7.

Figure 7. The generated sequence diagram
Sequence diagram for the selected method

Limitations of a non-editable sequence diagram

Rational Software Architect generates sequence diagrams by literally converting Java code, line by line. In most of the cases, especially for complex code, the generated diagrams become too complex, so they are very difficult to understand. Therefore, we need editable sequence diagrams so that we can add abstraction, delete unnecessary elements, add comments, and so forth.

Generate an editable sequence diagram

The extension of the static diagram is .tpx, which cannot be modified. To make the diagram editable, right-click on the diagram, and select File > Save as Diagram File, as shown in Figure 8.

Figure 8. Save as Diagram File selected on the context menu
File > Save as Diagram File selected on two drop-down menus

The extension of the new diagram is .dnx. Diagram files can use various extensions, but .dnx is the most common one, and the .dnx extension can be modified. As Figure 9 shows, the Palette window also appears so that you can edit the diagram.

Figure 9. Editable Sequence diagram
.dnx diagram on left, Palette pane on right


The author thanks Saldy Mathew from IBM India for encouraging him to transform his findings into article.



Get products and technologies



developerWorks: Sign in

Required fields are indicated with an asterisk (*).

Need an IBM ID?
Forgot your IBM ID?

Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.


All information submitted is secure.

Dig deeper into Rational software on developerWorks

ArticleTitle=Create editable sequence diagram with Rational Software Architect