Running an MDWorkbench command line application

MDWorkbench RCP application enables executing rulesets and services in a non-IDE environment. MDWorkbench RCP application is to download directly from Sodius site:
https://www.sodius.com

MDWorkbench RCP application enables executing a launch configuration in headless mode (batch command line):

mdworkbench.exe -headless -nosplash --launcher.suppressErrors

The -headless parameter asks MDWorkbench to run in headless mode.
The -nosplash is an Eclipse built-in parameter to disable the splashscreen. If you omit the -nosplash parameter, the launch will be executed in headless mode but with a splashscreen displayed during the execution.
The --launcher.suppressErrors parameter prevents Eclipse from opening a dialog popup in case an error occurs during the execution.

Launch location

In headless mode, the launch configuration available in the workspace directory will be executed. If there is more than one available launch in this directory, or if you want to execute a launch located somewhere else in the file system, you must add a -launch parameter:

mdworkbench.exe -headless -nosplash --launcher.suppressErrors -launch C:\myWorkspace\myLaunch.launch

Evaluation directory

The evaluation directory is set in the launch configuration. You can override the evaluation directory using a -evaluationDirectory parameter:

mdworkbench.exe -headless -nosplash --launcher.suppressErrors -launch C:\myWorkspace\myLaunch.launch
-evaluationDirectory c:\generated

Launch arguments

The launch arguments (model connectors to use to read and write models, String arguments, etc.) are set in the launch configuration. You can override some launch arguments using -args[index] parameters:

mdworkbench.exe -headless -nosplash --launcher.suppressErrors -launch C:\myWorkspace\myLaunch.launch
-args[0] "XMI|c:\models\myModel.xmi" -args[2] "Hello World" -args[3] true

For a model connector, the value must of the form connectorName|uri (e.g. "XMI|c:\models\myModel.xmi").

Log

Progress messages and errors are persisted in a .log file, in the launch configuration directory. If the execution fails, a dialog box is opened to warn the user and the exception details may be found in the .metadata/.log file.

Synchronous launch

Using the launcher mdworkbench.exe, the launch configuration is executed asynchronously from the command shell. If you need to execute the program synchronously, you have to run the application using eclipsec.exe.

eclipsec.exe -headless -nosplash --launcher.suppressErrors -launch C:\myWorkspace\myLaunch.launch

In that case, progress messages and errors are displayed in the command shell as well. If the execution fails, the exception is printed in the command shell and no dialog box is opened.

Related tasks
Running an MDWorkbench RCP application