IBM Support

Troubleshooting Rhapsody profile helpers

Troubleshooting


Problem

A specific profile command is not working. For example, when you use the HarmonySE profile, the "generate sequence diagram" command does not launch its user interface and nothing appears to run.

Diagnosing The Problem

Introduction
It can be useful to test the helper command by running it externally from its profile. This method can determine whether a specific Java Runtime Environment is to blame and can also allow users to test the helper with a specific environment when multiple Java Runtime Environments are installed on a system.
Taking the HarmonySE "Generate Sequence Diagrams" helper as an example, here is the excerpt from line 50 of the HarmonySE.hep file:
name6=SE-Toolkit\Generate Sequence Diagrams
command6=javaw
isSynced6=0 isVisible6=1
applicableTo6=CallOperation,ActivityDiagramGE,MessageAction,State,ActivityDiagram
arguments6="-Djava.library.path="$OMROOT/JavaAPI" -DTab=GenerateSD -DDirection=FROM -classpath "$OMROOT/JavaAPI/rhapsody.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/ModelingToolbox.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/CommonGUITools.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/CommonRhapsodyTools.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/miglayout-4.0.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/balloontip-1.2.1.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/RenameActions.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/RefactorActionName.jar" com.ibm.rhapsody.setoolkit.ModelingToolbox_Launcher"
initialDir6=$JavaLocation/bin
isMacro6=0
applicableToProfile6=
helperTriggers6=
To run the helper command externally, we can extract the relevant information from the profile HarmonySE.hep file.
Specifically, we are interested in the following command arguments:
- Name of the helper class file
- Classpath
- Rhapsody API library path
- Helper-specific parameters
Most of the information we require is located in the "arguments6" attribute. Note, the "6" simply means that it is the 6th helper command in the HarmonySE.hep file. A different number is used for a different helper command.
In the next section, we will look at each of these four types of information in turn.

Inspecting the Helper Command
1) Name of the helper class.
Java packages delimited by periods, ending in the class name. Note, the class name (ModelingToolbox_Launcher) does not use the .class extension:
com.ibm.rhapsody.setoolkit.ModelingToolbox_Launcher
In this example, the helper class name is found at the end of the "arguments6" attribute:
arguments6="-Djava.library.path="$OMROOT/JavaAPI" -DTab=GenerateSD -DDirection=FROM -classpath "$OMROOT/JavaAPI/rhapsody.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/ModelingToolbox.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/CommonGUITools.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/CommonRhapsodyTools.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/miglayout-4.0.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/balloontip-1.2.1.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/RenameActions.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/RefactorActionName.jar" com.ibm.rhapsody.setoolkit.ModelingToolbox_Launcher"
2) Classpath
The classpath can be identified by the preceding "-classpath" Java command-line argument. It contains paths to any .jar libraries used by the helper.
Here is the classpath section highlighted in the HarmonySE "Generate Sequence Diagrams" helper:
arguments6="-Djava.library.path="$OMROOT/JavaAPI" -DTab=GenerateSD -DDirection=FROM -classpath "$OMROOT/JavaAPI/rhapsody.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/ModelingToolbox.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/CommonGUITools.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/CommonRhapsodyTools.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/miglayout-4.0.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/balloontip-1.2.1.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/RenameActions.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/RefactorActionName.jar" com.ibm.rhapsody.setoolkit.ModelingToolbox_Launcher"
Here is the extracted and formatted list from the same helper:
$OMROOT/JavaAPI/rhapsody.jar
$OMROOT/Profiles/HarmonySE/SE Toolkit/ModelingToolbox.jar
$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/CommonGUITools.jar
$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/CommonRhapsodyTools.jar
$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/miglayout-4.0.jar
$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/balloontip-1.2.1.jar
$OMROOT/Profiles/HarmonySE/SE Toolkit/RenameActions.jar
$OMROOT/Profiles/HarmonySE/SE Toolkit/RefactorActionName.jar"
This list represents the dependencies of the HarmonySE "Generate Sequence Diagrams" helper command.
3) Rhapsody API library path

Each helper requires a special dependency to use the Rhapsopdy API.
This dependency is the Rhapsody API dll file. It is denoted by the "-Djava.library.path" argument:
arguments6="-Djava.library.path="$OMROOT/JavaAPI" -DTab=GenerateSD -DDirection=FROM -classpath "$OMROOT/JavaAPI/rhapsody.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/ModelingToolbox.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/CommonGUITools.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/CommonRhapsodyTools.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/miglayout-4.0.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/balloontip-1.2.1.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/RenameActions.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/RefactorActionName.jar" com.ibm.rhapsody.setoolkit.ModelingToolbox_Launcher"
4) Helper-specific parameters
Each helper can use custom parameters that are passed to the internal Java code of the helper. There is no standard set of arguments nor are there any mandatory arguments required.
We determine that these arguments are helper-specific because they use the "-D" prefix:
arguments6="-Djava.library.path="$OMROOT/JavaAPI" -DTab=GenerateSD -DDirection=FROM -classpath "$OMROOT/JavaAPI/rhapsody.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/ModelingToolbox.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/CommonGUITools.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/CommonRhapsodyTools.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/miglayout-4.0.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/Common/balloontip-1.2.1.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/RenameActions.jar$PathDelimiter$OMROOT/Profiles/HarmonySE/SE Toolkit/RefactorActionName.jar" com.ibm.rhapsody.setoolkit.ModelingToolbox_Launcher"

Building a New Script
We can now construct a Windows batch file that uses this information to execute the helper externally from the profile. Note that Rhapsody must be running and a project must be open.
@echo off
set OMROOT=C:\Rhapsody84\share
set APPATH="C:\Rhapsody84\share\Profiles\HarmonySE\SE Toolkit"
set COMPATH=%APPATH%\Common
set LIBPATH=%OMROOT%\JavaAPI
set COMMON=%COMPATH%\CommonGUITools.jar;%COMPATH%\CommonUPDMToolkitTools.jar;%COMPATH%\CommonRhapsodyTools.jar;%COMPATH%\miglayout-4.0.jar;%COMPATH%\poi-3.8-20120326.jar;%COMPATH%\balloontip-1.2.1.jar;%APPATH%\RenameActions.jar;%APPATH%\RefactorActionName.jar
set CLASSPATH=%OMROOT%\JavaAPI\rhapsody.jar;%APPATH%\ModelingToolbox.jar;%COMMON%
java -DTab=GenerateSD -DDirection=FROM -Djava.library.path=%LIBPATH% -Djava.class.path=%CLASSPATH% com.ibm.rhapsody.setoolkit.ModelingToolbox_Launcher
The OMROOT and APPATH variables should be changed to mirror the Rhapsody installation on your system.
You can now investigate how different Java installations affect the launch of the helper command by changing the Java command in the batch file.  This will also clearly display any error messages that occur during runtime.

Document Location

Worldwide

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Component":"","Platform":[{"code":"PF033","label":"Windows"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

ibm16138873