I tried to make my first Rhapsody plugin and so far I Managed to make the plugin appear under the Tools tab.
I wrote this so far in my project, but the Log tab remains unchanged
@Override
public void RhpPluginInit(IRPApplication rpyApplication) {
IRPApplication rpy = RhapsodyAppServer.getActiveRhapsodyApplication();
rpy.writeToOutputWindow("Log", "test\n");
}
My .hep file looks like this
MyPluginProfile.hep:
[Helpers]
numberOfElements=2
name1=MyPlugin
JavaMainClass1=Pack.MyPlugin
JavaClassPath1=D:\Work\eclipseWS\rhapsodyIntegr
isPlugin1=1
isVisible1=1
DLLServerCompatible1=1
name2=Invoke MySimplePlugin
isPluginCommand2=1
command2=MyPlugin
applicableTo2=ObjectModelDiagram
isVisible2=1
applicableToProfile1=SimplePluginProfile
DLLServerCompatible2=1
And I imported it in Rhapsody from File > Project Properties > Properties tab > Selected "View Filtered By "helper"" > Helpers File. There I gave the full path to MyPluginProfile.hep.
In the end, I have two questions:
Why isn't the message printed in the Log tab in Rhapsody?
If I modify the message, I'll have to reload the helper to see the change? If yes, how do I do it correctly?
Thanks, Daniel
Daniel, Don't be lulled into thinking that just because you have an entry under the Tools menu in the Rhapsody GUI that your plugin is working properly. If there is any kind of problem with Rhapsody loading your plugin, the entry in the Tools menu will still show up but your plugin can still be broken. The best way to troubleshoot is to update your Rhapsody.ini file and add an entry that tells Rhapsody to debug your plugin activity. In the [General] section, make the following entry:
[General] JavaAPILogFile=c:\temp\rhap814.log
Then, restart Rhapsody and reload your model. (BTW, I assume you have a corresponding .sbs file whose name matches that of your .hep file and that you have "added to model" that .sbs profile.) Then go look at that log file to see what the problem may be. Usually it is a classpath error. You have two ways of specifying where your plugin .class files are located, either a directory or a jar file. Your hep file does NOT specify a .jar file in the JavaClasspath1 property so I assume it is the former. If you have created a .jar file, you need to append that to the JavaClasspath1 property value.
IMPORTANT: Once you get your plugin working REMOVE (or better yet COMMENT by prepending a semicolon ";") the JavaAPILogFile entry in Rhapsody.ini. Otherwise you will see about a 10x DROP in plugin performance. Also, check your "applicableToProfile1" entry in the second helper. That should probably have a "2" at the end and not a "1".
For more precise debugging, add this entry to your rhapsody.ini file in the [JVM] section:
For debugging using Eclipse:
[JVM]
Options=ClassPath,LibPath,MaxHeap,MaxStack,EclipseDebug
EclipseDebug=agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y
or for JDB debugging:
Options=ClassPath,LibPath,MaxHeap,MaxStack,JDBDebug
JDBDebug=-agentlib:jdwp=transport=dt_shmem,address=jdbconn,server=y,suspend=y