Silent Mode

Introduction

It is possible to run this publishing silently.

The current document explains how to configure the silent mode, and how to run it.

Silent Mode Configuration

The configuration files are located in the publisher install path, under the folder "launch".

Configuration of Rhp2MDSilent.bat

The provided Rhp2MDSilent.bat file do the following actions:

  1. Launch Rhapsody
  2. Open a project in Rhapsody
  3. Run the Rhapsody to MagicDraw transformation
  4. Close Rhapsody

To configure the Rhp2MDSilent batch file:

  1. Open the file Rhp2MDSilent.bat (in the launch folder) with a text editor. This is what you should see:
    SET RHP2MD_PATH=<current_publisher_path>
    SET RHP_PATH=<rhapsody_path>
    SET RHP_PROJECT_PATH=<rhapsody_project_path>
    start "" "%RHP_PATH%\rhapsody.exe" -cmd=open %RHP_PROJECT_PATH%
    start /wait timeout 50
    "%RHP2MD_PATH%\publisher.exe" -headless -nosplash --launcher.suppressErrors -launch "%RHP2MD_PATH%\launch\Rhp2MDSilent.main.launch"
    Taskkill /IM Rhapsody.exe /F

  2. Replace <current_publisher_path> by the full path of the publisher, for example:
    SET RHP2MD_PATH=C:\temp\rhp2md-publisher-win32-x86_64_2.0.1-SNAPSHOT

  3. Replace <rhapsody_path> by the full path to the rhapsody folder, for example:
    SET RHP_PATH=C:\Program Files\IBM\Rational\Rhapsody\8.3.2

  4. Replace the <rhapsody_project_path> by the full path to the project (rpy file) to transform, for example:
    SET RHP_PROJECT_PATH=C:\ProgramData\IBM\Rational\Rhapsody\8.3.2x64\Samples\SystemSamples\SysMLHandset\SysMLHandset.rpy

  5. Optional : If the Rhapsody project is heavy, you may have to increase the delay before transforming to MagicDraw:
    start /wait timeout 50

Configure the MagicDraw output file

The MagicDraw output file can be configured by setting the "rhp2md.md.path" argument in the publisher.ini file.

  1. Open the file publisher.ini, located in the publisher install path, in a text editor.
  2. Add a new line at the end of the file. You can choose any output path that fits your needs. For example:
    -Drhp2md.md.path=C:\temp\mdexport.mdzip

If the -Drhp2md.md.path property is not set, the MagicDraw file will be created in the %USER%\.rhp2md\com.sodius.mdw.interop.rhp_md_sysml\mdzips folder, where %USER% represents the User folder.

If the -Drhp2md.md.path property is set to an existing folder, the MagicDraw file will be created in the set folder.

Configure a menu in Rhapsody

Configuring a menu in Rhapsody helps exporting the current model in MagicDraw

  1. Select the menu Tools > Customize > Helpers...
  2. Create a new Menu Content, choose a name for the helper, for example : "RHP2MD Publishing"
  3. Set the Command parameter: select the "publisher.exe" file of your MagicDraw SysML Publisher installation, for example:
    C:\temp\rhp2md-publisher-win32-x86_64_2.0.1-SNAPSHOT\publisher.exe
  4. Set the Arguments parameter to:
    -headless -nosplash --launcher.suppressErrors -launch "<current_publisher_path>\launch\Rhp2MDSilent.main.launch"
    In these arguments, replace <current_publisher_path> by the MagicDraw SysML publisher path, for example:
    -headless -nosplash --launcher.suppressErrors -launch "C:\temp\rhp2md-publisher-win32-x86_64_2.0.1-SNAPSHOT\launch\Rhp2MDSilent.main.launch"
  5. Set the Project Type parameter toSysML.
  6. Click "Ok" to complete the Helper creation.

You will now find the publishing shortcut in the Tools menu.

Test the configurations

To test the modifications you can run the launch configuration from the publisher. Follow these steps:

  1. Run the MagicDraw SysML Publisher for Rhapsody by clicking the "publisher.exe" file.
  2. Run the service called "Execute Deployed Launch Configuration".

  3. Select the "Rhp2MDSilent.main.launch" Launch Configuration in the launch folder.

  4. Click the "Finish" button.

Output Logs

The Silent mode logs - the logs displayed in the console when running the wizard mode - are generated in the launch folder, in a file called Rhp2MDSilent.main.log.

The transformation logs are generated in the user folder (.rhp2md\com.sodius.mdw.interop.rhp_md_sysml\logs). They are generated in both wizard mode and silent mode.

With the current version of the publisher, it is not possible to configure their path.