NEW RELEASE! The 2024x Refresh2 Hot Fix 1 was released on May 2, 2025. For more information, see 2024x Refresh2 Hot Fix 1 Version News.

Page History

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Content layer
id1425328535
Content column
id1425328548
Content block
id1425328537

Macro Engine supports five scripting languages: BeanShell,  JavaScript (Nashorn and Rhino), JRuby, Jython, and Groovy.

BeanShell
BeanShell is a lightweight scripting language for Java. The shipped version is 2.1.7. The advantage of using BeanShell is that its syntax is compatible with Java; therefore, you can use the code assistant feature in most Java IDE. The BeanShell syntax documentation is available at http://www.beanshell.org/docs.html.

JavaScript
JavaScript is a scripting language based on Java syntax. The documentation is available at:
http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/index.html and https://developer.mozilla.org/en/Rhino_documentation.

Warning

The JavaScript Nashorn is deprecated with the intention of removing it (learn more about deprecated JavaScript Nashorn).

Please use JavaScript Rhino instead

. Learn more about deprecated JavaScript Nashorn >>

- see the JavaScript migration from Nashorn to Rhino engine.

To find the usages of the JavaScript Nashorn in the project, run the Deprecated JavaScript validation suite (Analyze > Validation > Validate).

JRuby
JRuby is a 100% pure-Java implementation of the Ruby programming language. Macro Engine uses JRuby 1.7.11 The documentation is available at http://jruby.org/documentation.

Jython
Jython, a successor of JPython, is a Python programming language implemented in Java. The documentation is available at http://wiki.python.org/jython. Besides automating MagicDraw by using Jython scripting, the plugin development in the Jython programming language is also supported in MagicDraw. For more information on Jython, see JPython Scripting in MagicDraw OpenAPI User Guide.

Groovy
Groovy is an agile and dynamic language for the Java Virtual Machine. Macro Engine uses Groovy 2.0.1. The advantage of using Groovy is that its Java-like syntax seamlessly integrates with the existing Java source code and libraries. It supports many IDEs that provide code completion and debugging. BeanShell scripts can be easily moved to Groovy, with some modifications. For more information on Groovy, go to  http://groovy-lang.org/.

Content block
id1425328534

Related pages