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

Technote (FAQ)


Question

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

Cause

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

Answer

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

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.




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

Rate this page:

(0 users)Average rating

Document information


More support for:

Rational Rhapsody
Rational Rhapsody Developer

Software version:

7.5, 7.5.0.1, 7.5.1, 7.5.1.1, 7.5.2, 7.5.2.1, 7.5.3, 7.5.3.1, 7.5.3.2, 7.5.3.3, 7.6, 7.6.0.1, 7.6.1, 7.6.1.1, 7.6.1.2, 7.6.1.3, 8.0, 8.0.1

Operating system(s):

Linux, Windows

Reference #:

1624876

Modified date:

2013-02-14

Translate my page

Machine Translation

Content navigation