Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
Topic |
Prev | Next |
Scripting
Enterprise Architect's scripting environment is a flexible and easy to use facility that supports both Javascript and the Microsoft scripting languages JScript and VBScript. When any script runs, it has access to a built in 'Repository' object. Using this script object you can programmatically inspect and/or modify elements within your currently open model. Enterprise Architect also provides feature rich editors, tools to run, debug and manage your scripts. Scripts are modular and can include other scripts by name using the !include directive. They can be used for a broad range of purposes from documentation to validation and refactoring, they can be of enormous help with automating time consuming tasks.
Script Engine Support
Script Languages
Benefits
Script Groups
Scripts are managed and contained in groups. Each group has an attribute called 'Type'. This attribute is used to help Enterprise Architect decide how and where the script can be used and from which features it should be made available. The properties of a script group can be viewed from its shortcut menu.
Script Storage
Built in scripts are file based and are installed with Enterprise Architect. They appear under the Local Scripts group.
You cannot edit or delete Local scripts, but you can copy the contents easily enough.
User defined scripts are model based and as such, can be shared by a community. They are listed in the group to which they belong..
Using Scripts
The management interface for Scripting is the Scripting window, which contains the:
- Script Tree View ('Scripts' tab), which you use to review, create and edit scripts
- Script Console ('Console' tab), which you use to operate on an executing script
Other than the Local Scripts, which are file based and installed with Enterprise Architect, all other scripts are stored as model assets and can be shared with its users. Script debuggers can help you with script development and script editors can provide you with information on the automation interfaces available to you. Analyze the execution; for example, by recording a Sequence diagram of the script execution, and halting execution to view local variables.
Notes
Learn more