Some properties not declared in Rhapsody but useful for code generation ruleset are automatically added by each connector reader, these properties are described here.
Following properties can be used for all code generation ruleset only under RulesPlayer1):
RULESPLAYER_version : gives the current RulesPlayer version number, return type:
java.lang.StringRHP_plugin_version : gives the current Rhapsody Metamodel version number, return
type: java.lang.StringinterfaceFileMapper : gives the current instance of the External File Mapping Rules
interface,
com.sodius.mdw.rhapsody.api.utils.RhapsodyFileMapper2)RhapsodyFileMapper instance or nulluser.dir : gives the current Rhapsody Model Project to generate, return type:
java.lang.StringFollowing properties can be used for all code generation ruleset as much under RulesPlayer as
RulesComposer:
RHP_gen_main : Rhapsody asks to generate the Main file, return type:
java.lang.Boolean3)RHP_gen_makefile : Rhapsody asks to generate the Main file, return type:
java.lang.Boolean3)These properties can be read from:
rhapsodymodel.getReader().getProperty("propertyName")
rhapsody.ModelElementself.eMetamodel()
.getModelReaderDescriptor("Rhapsody On-demand")
.getProperty("propertyName")
context.getWorkbench().getMetamodelManager()
.getMetamodel("rhapsody")
.getModelReaderDescriptor("Rhapsody On-demand")
.getProperty("propertyName")
Following properties can be used for all transformation ruleset as much under RulesPlayer as RulesComposer to update selected elements in Rhapsody projet:
unitsToReplace : provides a list as type java.util.List
that contains the selected elements (see details):
var modifiedUnits : java.util.List = java.util.ArrayList.new(); modifiedUnits.add(newPkg); modifiedUnits.add(renamedPkg);
This property can be written from:
rhapsodymodel.getWriter().setProperty("propertyName", instance)
rhapsody.ModelElementself.eMetamodel()
.getModelWriterDescriptor("Rhapsody Application")
.setProperty("propertyName", instance)
context.getWorkbench().getMetamodelManager()
.getMetamodel("rhapsody")
.getModelWriterDescriptor("Rhapsody Application")
.setProperty("propertyName", instance)
Following properties can be used for all code generation ruleset under RulesPlayer and only with connector
reader "Rhapsody Application" under RulesComposer:
RHP.SpecificationFilename : full path of the specification filename,java.lang.Stringlang_CG:Configuration:ExternalGeneratorFileMappingRules is set to
AsRhapsodyRHP.ImplementationFilename : full path of the implementation filename,java.lang.Stringlang_CG:Configuration:ExternalGeneratorFileMappingRules is set to
AsRhapsodyFollowing properties can be used for all code generation ruleset as much under RulesPlayer as
RulesComposer:
RHP.IsBeingGenerated : Rhapsody asks to generate this element,java.lang.Stringlang_CG::File::Generate is set (check box)"TRUE"4) or
nullThese properties5) can be read from:
rhapsody.ModelElementself.getProperty("propertyName")Notes:
1) These properties cannot be used under RulesPlayer Helper,
see for details.
2) This interface is required when a ruleset uses its own
External File Mapping Rules, see tutorial for
details and a source code snippet.
3) You can use either the simple data type
boolean or class java.lang.Boolean
4) This value is always set under RulesComposer for the whole
model.
5) As we said in introduction, these properties are always attached
to these elements by each connectors. It is not necessary to define them in the Properties.ini
file.