Introduction

With Modelio, you can run scripts written in Jython:

  • either from the Modelio command line

  • or in a dedicated view called the Script view

You can also save these scripts as macros, which you can then use as often as you wish. These macros are defined and organized in a dedicated catalog, and can be run through an associated pop-up menu command, an associated toolbar icon or through the macro window itself. For more information on macros, please see the section on the macros catalog.

The script view
2
The script view

Keys:

  1. To open the Script view, run the "Views/Script" command.

  2. The Script view tab.

  3. The Script view toolbar (see below).

  4. The Script view output zone.

  5. The Script view intput zone.

The script view toolbar

The script view toolbar buttons run the following operations:

  • 10: Opens the macro catalog, where scripts which have been saved as macros are presented.

  • 11: Loads an existing script.

  • 12: Loads an existing script and automatically runs it.

  • 13: Saves the script entered in the script input zone in a file.

  • 14: Clears the entire contents of the script view output zone.

  • 15: Activates the script debug mode. In this mode, the script input zone is not cleared when a script is run.

  • 16: Runs the script entered in the script input zone and displays the result in the script display zone. Clears the input view except if the debug mode is active.

Note: Two keyboard shortcuts exist for the script view:

  • Ctrl+Enter: Runs everything in the script input zone.

  • Shift+Enter: Runs only what is selected in the script input zone.

Entering and running Jython scripts
3
Entering and running a Jython script

Keys:

  1. Write your script in the Script view input zone.

  2. Click on the 7 button to execute the script.

  3. The result immediately appears in the Script view output zone.

Saving a script for re-use

If you intend to re-use a Jython script, you may want to save it, as shown below.

4
Saving a Jython script

Keys:

  1. Write your script in the Script view input zone.

  2. Click on the 8 button to save the script in a file.

  3. Choose a name and location for the script.

  4. Click on Save.

Note: Scripts which have been saved can be used as macros, available at either project, workspace or application level. For more information, please see the section on the macros catalog.