MDWObject APIs

A model element is represented by the interface MDWObject, which is the root interface of metatypes.

When you define a script, the self variable is always available, whatever the implementation language is. This variable is the instance the script is evaluated on (instance of the script's metatype).

Call script

The interface MDWObject provides services to call scripts on model elements:

Additional script call methods are provided to convert the evaluation result to a specific type.
Here are the most commonly used:

Check metatype

The eIsInstanceOf method determines if an object is an instance of the given type (or subclass of the type). This is the strict equivalent of the Java instanceof operator.

You can get the metatype's name of a model element using the EMF eClass().getName() methods.

Access the model

Each model element can access it model using the eModel() method.