Question & Answer
Question
How do you get an instance from an implicit object dependent using API method IRPDependency.getDependent() with IBM Rational Rhapsody?
Cause
The IRPDependency.getDependent() method returns an unexpected result: class instead of the expected instance for ImplicitObject.
![](/support/pages/system/files/support/swg/rattech.nsf/0/f8d790ac5bdfdcaa852580d0003ea6a4/Cause/0.298.jpg)
Answer
The project mapping of dependencies from:
- Implicit objects => dependent is Class defining the object
Explicit objects => dependent is the Object itself
Therefore the API is returning the correct result as dictated by the Rhapsody model structure.
To get the instance from an implied object dependent you should use the additional method: IRPModelElement.getOwner().
![](/support/pages/system/files/support/swg/rattech.nsf/0/f8d790ac5bdfdcaa852580d0003ea6a4/Content/0.2BA.jpg)
Please find full code example attached below.
[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"8.0;8.0.1;8.0.2;8.0.3;8.0.4;8.0.5;8.0.6;8.1;8.1.1;8.1.2;8.1.2.1;8.1.3;8.1.4;8.1.5;8.2","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
swg21999330