This document will explain how to use Astah API.
About Astah API
Astah API is a Java Interface Group for developing applications software using Astah model data.
API can be used for developing plug-ins and also in the Script Editor to enable you access Astah models via Scripting language.
With Astah API, you can get, create, modify and delete models in the projects you create with Astah Professional and UML.
- Redistribution of astah-api.jar file is NOT allowed.
- By using Astah API, you are agreeing to be bound by the terms of END-USER LICENSE AGREEMENT.
In order to run applications created by using Astah API, you need to meet the requirements below:
- Astah Professional or UML is installed
- The Runtime Environment meets Astah’s System Requirements
- Set Classpath. (Reference: Sample application’s execution shell etc.)
|Compile and Run
|astah-pro.jar (or astah-uml.jar)
Run(Using a floating license)
- Multi-threading of Astah API is not supported. When using from multiple threads, exclusive control should be performed on the application side.
- A part of the class structure of Astah API is different from the one of UML metamodel. Astah API has a simplified structure. Some of abstract model elements in the UML metamodel inheritance structure are eliminated because they would not be instantiated as model elements.
- JAVA VM memory setting is required when handling a large size of Astah file
- Example for setting initial heap size 16MB and maximum 256MB: -Xms16m -Xmx256m
Try Script Editor
The easiest way to try out how API works is to use it in the Script Editor. You can run the script in Astah so that you can see how API works or test your script easily.
Model and Presentation
Astah projects consist of Models and Presentations. Presentation is visual information to notate the model elements in Astah.
For example, if you want to get color information of a specific Class, you access presentation. If you want to edit attributes of a specific Class, you access model.
Just remember, you use presentations for anything visual.