Scripts
The scripts aspects lets you perform changes to your models in batches. The available scripts are shown in the Tools -> Scripts menu.
There are two types of scripts:
enhancement - perform a change to the model based on criteria that you specify
migration - a deprecated type that used to be utilized for migration between language versions. Language migrations now take care of this functionality and so migration scripts are no longer available top be created.
To define your scripts, create the Scripts aspect in your language and then create an Enhancement Script.
Give it a name and a descriptive title.
Then you specify one or more updaters. They are of several kinds.
Concept instance updater
The "concept instances updater" allows you to specify a query to get the nodes that you are interested in and then provide code that will update the found instances.
The "show as intention" flag
will offer the script in the intentions menu in the editor right next to the nodes that satisfy the query.
Factory method updater
This updater calls a factory method that is supposed to return instances of the AbstractMigrationRefactoring class that implement the filtering and enhancement functionality in BaseLanguage.
Extract interface updaters
The extract interface updater comes in handy when you want to replace references to methods of a class to methods of another class or of an interface.
You specify both the current and the desired target classes and then with the “pull up method” statement you indicate references to which methods to change and to what to change them.