Question & Answer
Question
How do you create a class link port using Java Application Programming Interface (API) in IBM Rational Rhapsody?
Cause
This involves the following class types:
- Composite class
- Outer class being a simple class
- Two inner classes
These three classes are interconnected by links, connected to the main port of each classes as shown below:
![](/support/pages/system/files/support/swg/rattech.nsf/0/4ae08d2113e8909c852578e10048c306/Cause/0.20A.gif)
Answer
The best Java Application Programming Interface (API) method to achieve this is by making use of the following method:
addLinkToPartViaPort ()
method of the IRPClass interface.
The method has a signature of :
addLinkToPartViaPort(IRPInstance, IRPInstance, IRPInstance, IRPRelation) - Method in interface com.telelogic.rhapsody.core.IRPClass
The Class itself, is the Composite Class.
- The first parameter is the Part
- The second parameter is the Port on the Part
- The third parameter is the Port on the Class
- The fourth parameter is optional (can be NULL) relation that is initialized by the link.
[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.6","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]
Product Synonym
Rational Rhapsody
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
swg21507961