View Question

How do I get the parent package?

Hi , I would like to know how I can get the parent package of the project I am in. For example the project name is: Example, how can I get this Example package? I want to use the method createPackage from your Astah SDK API. For this method you need to give to parameters, the ParentPackage and the name of the new Package u would like to make. createPackage(IPackage parentPackage, String name). How do I get the parentPackage of the current Astah model I opened?

Thank you in advance, would help me a lot.

Product: Astah Professional

How does this function work? It returns a null.

Hi Jess,

Using ProjectAccessor#getProject() as a parent will do.

Here's sample code to create a package:

https://gist.github.com/y-matsuda/7c9174bf49bdf92f367b#file-createpackagesample-java

Hope it helps!

SJ

Answer Question

This content has the following tags: