IBM Support

How to add a Value Property in a SysML project with the API using IBM Rational Rhapsody

Question & Answer


Question

How do you add a Value Property in a SysML project with the API using IBM Rational Rhapsody?

Cause

You have been unable to find an API method that adds a Value Property directly.

Answer

The "ValueProperty" is a SysML element, but is not a a core metaclass of the Rhapsody tool. They are SysML new term stereotypes of UML "Attributes". Therefore, you must first create an attribute, then apply the "ValueProperty" stereotype to the attribute. Note that if you specify the wrong name stereotype or the SysML profile is not loaded in your project, a new stereotype will be created in its absence (producing unexpected results). Here is an example of the API code required to create a Value Property element in Rhapsody. A downloadable example can be found at the bottom of this article.



 
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.



 


AddValueProperty.javaAddValueProperty.java

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

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg22004934