Introduction

This document will explain how to use Astah API.

last updated
Jan 30, 2019
Products covered in this document
Astah Professional 8.1
Astah UML 8.1

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.

Agreements

  • 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.

Requirements

In order to run applications created by using Astah API, you need to meet the requirements below:

Path Necessary
astah-api.jar Compile and Run
astah-pro.jar (or astah-uml.jar) Run
<installation folder>/lib/**
<installation folder>/lib/rlm/**
-
Run(Using a floating license)

Notes

  • 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.

Script Editor in Astah

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.

The correspondence between the model and presentation is not necessarily 1:1.
Some model elements have presentations and some don’t. For more details, see Model and Presentation list and Javadoc.

Model-Presentation Interface Overview