RPY Connector System Properties

Prerequisites

To use the connector RPY in a Eclipse application, this property "rhapsody.omroot" must be set first to the location of a Rhapsody Share folder, see this paragraph.

To use this connector in a Java program, please refer to this paragraph for details.

System Properties Definition

If properties are not declared, default values are used, see underlined values.

rhapsody.omroot
declares the path of the Rhapsody Share folder. Default path is computed with the current open Rhapsody application, see details.
 
rpy.ini.file
defines the path of a System Properties File where you can declare all properties in a same time.
Example of content:
logFile=d:/rpy.log
traceRPY=false
loglevelRPY=error
resolveUnloadedHandlers=false
ignoreReadOnly=true
ignoreUseExternal=true
ignoreFullPathName=true
ignoreFeatureDescriptions=true
computeAllTags=true
disabledProcess=derived,Component

Note: If you define a relative path in rpy.ini.file, the file is search under the HOME path according to the OS.
The property rpy.ini.file could be set only in the Java command-line arguments for a simple Java Program:
java -Drpy.ini.file=d:\rpy_config.ini -Drhapsody.omroot=D:/Users/user-id/IBM/Rational/Rhapsody/8.1.4/Share -jar MyProgram.jar
Or for an Eclipse platform in the Configuration File:
-vmargs
-Drhapsody.omroot=D:/Users/user-id/IBM/Rational/Rhapsody/8.1.4/Share
-Drpy.ini.file=D:/rpy_config.ini
-Xms256m
-Xmx1024m
logFile
declares the path of a log file to redirect the content of the console messages.
 
Note: If you define a relative path, the file is created under the HOME path according to the OS.

 
loglevelRPY
debug, info, warning, error
set trace log level option combined with property
traceRPY.
 
CAUTION: set property traceRPY to debug could decrease performance to read a huge model.
 
computeAllTags
false, true
if false does not compute derived feature allTags and improve so performance. To be active, the option disabledProcess should not contains argument ModelElement.
 
ignoreReadOnly
false, true
if true does not compute derived feature readOnly and improve so performance.
 
ignoreUseExternal
false, true
if true does not compute derived feature external and improve so performance.
 
ignoreFullPathName
true, false
if true does not compute derived feature fullPathName and improve so performance.
 
traceRPY
true, false
enables the "verbose" mode. Trace more messages according to the log level set in property
loglevelRPY .
 
CAUTION: this option permits to trace all the parsing. Also do not use it on a very huge model, otherwise reading could take several hours.
 
disabledProcess
Component, Configuration, EventReception, InterfaceItem, ModelElement, Profile, Relation, State, Statechart, Stereotype, TopLevel, Type, Unit, Variable, derived, references
 
Permit to disable one or several post-processes. Give a list of these keywords separated with punctuation character like ';'.
 
ignoreFeatureDescriptions
true, false
if true does not compute derived features descriptionHTML and description and improve so performance.
 
ignorePreloadPredefinedTypes
true, false
if true does not preload predefined types components.
 
resolveUnloadedHandlers
true, false
if false does not resolve unloaded handlers and improve so performance.
 

Use Properties in a Java Program

As seen in prerequisites, the Rhapsody Share folder must be declared first:

-Drhapsody.omroot=<RhapsodyShareFolder>

To declare the other properties:

  1. The easiest way to declare them is writing those in a properties file and adding an option in the Java command-line arguments:
    -Drpy.ini.file=<iniFile>
  2. If you directly manipulate the Model instance in your program using the Java classes of the plugin com.sodius.mdw.core,
    You have two more ways:
     
    1. Using a java.util.Map to store properties:
       
      MDWorkbench workbench = MDWorkbenchFactory.create();
      Model model = workbench.getMetamodelManager().getMetamodel("rhapsody").createModel();
      Map<String, Object> options = new HashMap<String, Object>();
      options.put("traceRPY", new Boolean(true));
      options.put("loglevelRPY", "debug");
      model.read("RPY", "project.rpy", options);
      workbench.shutdown();
      
    2. Using the RPY connector descriptor to store them:
       
      MDWorkbench workbench = MDWorkbenchFactory.create();
      Model model = workbench.getMetamodelManager().getMetamodel("rhapsody").createModel();
      ConnectorDescriptor desc = workbench.getMetamodelManager().getMetamodel("rhapsody").getModelReaderDescriptor("RPY");
      desc.setProperty("traceRPY", new Boolean(true));
      desc.setProperty("loglevelRPY", "debug");
      model.read("RPY", "project.rpy", null);
      workbench.shutdown();
      

Properties reading order

  1. In what order are the properties read?
     
    The first properties read are rhapsody.omroot and rpy.ini.file at beginning of process, the others are read only on-demand.
     
  2. Which container is used in priority to read the properties?
     
    1. The properties file defined in property rpy.ini.file
    2. The Map "options" variable provided in method model.read("RPY", "project.rpy", options)
    3. The properties set on Java command-line using instruction -DloglevelRPY=debug
    4. The properties set into connector descriptor using method desc.setProperty("loglevelRPY", "debug")