Scripts

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

Key:

  • 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

Key:

  • 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

Key:

  • 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.

scripts3.png (76.2 KB) admin admin, 25 June 2015 18:51

load_script.png (359 Bytes) admin admin, 25 June 2015 18:51

script_debug.png (748 Bytes) admin admin, 25 June 2015 18:51

go_16.png (888 Bytes) admin admin, 25 June 2015 18:51

scripts4.png (44.4 KB) admin admin, 25 June 2015 18:51

clear_content.png (357 Bytes) admin admin, 25 June 2015 18:51

scripts5.png (58.4 KB) admin admin, 25 June 2015 18:51

macro_catalog.png (420 Bytes) admin admin, 25 June 2015 18:51

load_run_script.png (462 Bytes) admin admin, 25 June 2015 18:51

scripts2.png (41 KB) admin admin, 25 June 2015 18:51

save_script.png (515 Bytes) admin admin, 25 June 2015 18:51

save_16.png (978 Bytes) admin admin, 25 June 2015 18:51

run_in_input.png (703 Bytes) admin admin, 25 June 2015 18:51

scripts1.png (76.5 KB) admin admin, 25 June 2015 18:51