I'm trying to get a package-object (get by id) from the repository of Enterprise Architect (Sparx Systems) and get the package name.
Here's a code snippet:
org.sparx.Package oPackage = null;
oPackage = repo.GetPackageByID(Integer.parseInt(packageID));
String sName = oPackage.Name;
When I run my script, I get the following compilation error:
deleteExternalRef.java:44: error: cannot find symbol
String sName = oPackage.Name;
^
symbol: variable Name
location: variable oPackage of type Package
1 error
Am I doing something wrong in the Java code or am I using the EA-API in a wrong way? I can use methods of the Package class. Only when I try to use the variables, I get this error.
String sName = oPackage.Name;
you should use Sparx EA JAVA API (eaapi.jar), and your line will be following:
String sName = oPackage.GetName();