IBM Support

How to create a class link port using Java API in Rational Rhapsody

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:

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

Document Information

Modified date:
27 May 2022

UID

swg21507961