IBM Support

How to use the API with MicroC profile in IBM Rational Rhapsody

Question & Answer


Question

How do I access the Initial Values data using the API in IBM Rational Rhapsody?

Cause

You want to access the initial value data set in your MicroC project but the data is not found under any of the attributes.

Answer

Usually the initial value data is stored under the attribute initial value field.


Using the API you can access this data using the IRPAttibute.getDefaultValue() method. This code example assumes you have selected an attribute in the Rhapsody model:




However, using the MicroC profile you can specify initial values at a global level using the package's initial value tab:



This present a problem accessing the data since there is no dedicated method in the API to retrieve it as seen above.
This data is stored in the Annotations of the package and its tags/dependencies. The code example assumes you have selected a package in the Rhapsody model:



The source code is also attached.

[{"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","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21993167