Question & Answer
Question
How to automate code generation and build process using the Rational Rhapsody API ?
Answer
Rhapsody code generation and build process can be scripted using Rhapsody APIs.The script can then be either executed within Rhapsody as a helper or outside Rhapsody from a batch file. Below is a code snippet that uses the set of basic APIs used for generating and building a Rhapsody component.
IRPApplication app = RhapsodyAppServer.getActiveRhapsodyApplication();
// Loads project
IRPProject prj = app.openProject("C:\\Rhapsody\\Rhapsody7501\\TestAPI\\TestAPI.rpy");
//IRPProject prj = app.activeProject();
// set active component
prj.setActiveComponent("TestComp");
// set active configuration
prj.setActiveConfiguration("TestConfig");
//generate configuration with dependencies
app.generateWithDependencies();
// builds component
app.buildWithDependencies();
Product Synonym
Rational Rhapsody
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
swg21409178