A script is a method dynamically added to a metatype.
A script is attached to a metatype and is evaluated on an instance of this metatype, using the self variable, to produce a value based on this instance. It may be implemented in different languages:
It can be seen as a virtual method directly added to a metatype during evaluation. It's a very convenient way to extend and customize a metamodel for a particular model transformation or generation. Form MQL and TGL code, a script is called on a model element like a regular Java method, in a transparent manner.
MQL script statement
TGL script directive