IBM Support

How to visualize relations among components using User Defined Method and Table Layout

Question & Answer


Question

How do you use IBM Rational Rhapsody tables to show dependencies among components?

Cause

Information about User Defined Method in conjunction with the use of Table View/Layout is limited as it's been introduced recently in Rhapsody v8.0.3.

Answer

You may not be able to tell which class belongs to which component by just looking at the below image.




However, with the help of User Defined Method, you are able to create a table as below, which will help you to visualize the relationship between components and classes connected by each dependency.



To make this table, you need to define your API as plug-in and hook them to particular columns as you see below:




 

public class MyDefinedPlugin extends RPUserPlugin {

...

public String getFromState(String guid) {

IRPProject proj = m_app.activeProject();

IRPCollection elms,cmps;

String rtn;

IRPDependency dep = (IRPDependency)proj.findElementByGUID(guid);

rtn=findCompByGUID(dep.getDependent().getGUID());

return rtn;

}

public String getToState(String guid) {

IRPProject proj = m_app.activeProject();

IRPCollection elms,cmps;

String rtn;

IRPDependency dep = (IRPDependency)proj.findElementByGUID(guid);

rtn=findCompByGUID(dep.getDependsOn().getGUID());

return rtn;

}

...

In case that API takes too long to populate the table, you can narrow the scope of API process by enabling filters on table columns (see Image 1) or adjust Scope field from Feature Window of Table View (see Image 2).



Image 1:



Image 2:




The attached sample contains Java source code and others files, and it is configured to work with Rhapsody v8.0.3 or newer by simply importing *.hep file to your project. This sample is provided for the demonstration purpose only. Read ReadMe.txt before use. Also check out TableExtension sample stored in ..\Samples\ExtensibilitySamples.

 
Disclaimer

All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Documentation","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"8.0.3;8.0.4;8.0.5;8.0.6","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21671292