IBM Support

How to add duplicate elements in IBM Rational Rhapsody with JAVA API.

Question & Answer


Question

How to add duplicate elements in IBM Rational Rhapsody with JAVA API?

Cause

You might have made true the below property.



    General::Model::WarnForDuplicates

Answer

Write one API as follows:



    IRPApplication rpy = null;
    IRPModelElement ele = null;
    IRPProject myapp = null;
    rpy = RhapsodyAppServer.getActiveRhapsodyApplication();
    myapp = rpy.activeProject();
    ele = rpy.getSelectedElement();
    myapp.setPropertyValue("General.Model.WarnForDuplicates" ,
    "FALSE");//This will set the property as false
    ele.setName("package_5");//It will rename the selected element as per the given names. It could be the duplicate name also.

    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.


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

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21984670