How to add source artifacts using Java Application Programming Interface in Rational Rhapsody

Technote (FAQ)


How do you add source artifacts using Java Application Programming Interface (Java API) in IBM Rational Rhapsody?


You need to add source artifacts if you want to use Java API to automate the manual task to be performed within Rational Rhapsody.


In order to add source artifacts using Java API, execute the code provided below (sample):


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.

IRPApplication app = RhapsodyAppServer.getActiveRhapsodyApplication();

IRPModelElement target = (IRPClassifier) app.getSelectedElement();

IRPModelElement SA = target.addNewAggr("File", target.getName());

((IRPFile) SA).setFileType("Specification");
//or, set it to "Implementation", "logical" or "other"

Related information

How to retrieve source artifacts using Java Application

Document information

More support for:

Rational Rhapsody
Rational Rhapsody Developer

Software version:

7.5,, 7.5.1,, 7.5.2,, 7.5.3,,,, 7.6,, 7.6.1,,,, 8.0, 8.0.1

Operating system(s):

Linux, Windows

Reference #:


Modified date:


Translate my page

Content navigation