In this tutorial, you will learn to customize Xmi toolkit ruleset for Statemate.
This tutorial shows:
- How to configure RulesComposer to work with Statemate,
- How to upgrade metamodel Statemate in RulesComposer,
- How to import ruleset sources in RulesComposer workspace,
- How to test and debug your customized rules,
- How to deploy new ruleset under Statemate.
If you select the metamodel Statemate in the Models view and on click-right select command Open
Model, choose connector: Read from Statemate with selection and then a message box displays the
following error:

And or:

It is not necessary to re-install RulesComposer. This needs only to be configured to work with
Statemate, and then it will be able to read some models from Statemate.
- Please look at folder:
<RhapsodyInstallationDir>\Sodius\RulesComposer\bin
- You will find several DOS script files in this folder, one concerns this tutorial:
rc4stm_ini_update.bat
Follow these instructions below:
- Close Rhapsody and RulesComposer applications, open a Command Prompt window and enter
following commands to go in folder:
<RhapsodyInstallationDir>\Sodius\RulesComposer\bin
- Example:
C:¶
CD C:\Program Files\IBM\Rational\Rhapsody\8.0¶
CD Sodius\RulesComposer\bin¶
- Enter the DOS script mentioned above with only one argument: the path of Statemate Application folder.
- Example:
rc4stm_ini_update C:\IBM\Rational\Statemate\4.6\bin¶
- Now restart Rhapsody, open a project and click on main menu Tool > RulesComposer for Statemate.
Select the metamodel Statemate in the Models view and on click-right select command Open
Model.
Choose connector: Read from Statemate with selection, and answer to all questions displayed in small
windows.
After, that RulesComposer reports completion of reading in the Console view, and finally Statemate
model is displayed in a model viewer tab.
- Note:
- it’s not required to keep the application Statemate opened, but the service NuTCRACKER
Service must remain active (see chapter page 13).
You can use the Import Wizard to import the Statemate to UML Rules Set into your RulesComposer
workspace.
- From the main menu bar, select File > Import
Then the Import wizard opens.
- Select General > Existing Project into Workspace and click Next.

- Choose Select archive file and click on the associated Browse button to locate the zip
file:
StatemateToolkitSRCForRulesComposer.zip
- Available under folder:
-
Statemate_INSTAL_PATH\plugins\StatemateForXMIBridge\src

- Under Projects select com.sodius.toolkit.statemate.rules project.
- Click Finish to start the import.
An Help is available in RulesComposer Help:
Select Help > Help Contents and book MDWorkbench Documentation,
Then Tasks > Developing Rules > Editing rules.
To run rules you have to use a Rule Set launch configuration:
- From the main menu bar, select Run > Run Configurations
Then the Run Configurations wizard opens.

- In RulesComposer browser four launch configurations imported with project appear:
statemate2rhapsodyAda, statemate2rhapsodyCpp, statemate2rose, and statemate2uml13
.
- Choose the launch configuration corresponding to the main rule you want to test.
In Parameters you can specify the input Statemate model and the output UML one.
By default the input model is pointing to a sample XMI model pingpong.xmi imported with Rules Set project
in the view Models. You can change this model by another model exported with the XMI Bridge in
format: XMI Statemate.
- Click Run to execute the main rule.
For more details, select Help > Help Contents, and in book MDWorkbenchDocumentation, select
Tasks > Developing Rules > Running and debugging.
- Note:
-
when you click on parameter stm43(in), the following window wizard is opened:

Use only XMI connector, other connectors are not
available under RulesComposer.
To integrate your new rules to the Statemate XMI Toolkit you have to deploy them. For that you can use the
Export wizard from RulesComposer.
- In the projects browser, select the Rule Set project.
- From the main menu bar, select File > Export, then the Export wizard opens.
- Select Java > JAR file and click Next.

- In box Select the resources to export choose only src package,
Check Export generated class files and resources.
- Save the jar file under folder:
Statemate_INSTAL_PATH\plugins\StatemateForXMIBridge\rules
- With file
statemate2uml.jar (replace the old jar) and click Finish.

Sometimes, if you get this error message box in RulesComposer :

Maybe the NuTCRACKER Service used by Statemate needs to restart, see in Windows menu: Control
Panel > Administrative tools > Services.
If this is inefficient, please restart your session or your machine, this will be enough to solve this problem.
If after trying all, this problem persists, please re-install Statemate.