Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: P on June 10, 2009, 08:35:49 pm

Title: Where can I find Java API or Java code example?
Post by: P on June 10, 2009, 08:35:49 pm
Hi everybody!

I'm using Eclipse and Enterprise Architect 7.1 library (eaapi.jar). I must use the Java api to update the EA model, such as create a new class diagram, add a new class, attributes and so on.
All samples that I find are in Visual Basic 6.0 or C#...nothing java samples!!
Please help me! I would need at least a full documentation about the API of this library!

Thanks very much!
Title: Re: Where can I find Java API or Java code example
Post by: Guido Spadotto on June 10, 2009, 09:11:05 pm
You can find some basic installation instructions here:
http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/setup.html

I've not been able to find "real" Java examples, but if you look at
http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/codeexamples.html and keep in mind that for any Object.attribute in VB there should be the corresponding getters and setters in Java, you should be able to start.
Title: Re: Where can I find Java API or Java code example
Post by: Eve on June 11, 2009, 08:47:20 am
You'll find a Java sample in your EA install directory (at least with EA 7.5).

The documentation for the interface is available at http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/theautomationinterface.html

As you've said, use getters and setters for the attributes though.  (Same as you would need to do for C++.)
Title: Re: Where can I find Java API or Java code example
Post by: mrf on June 11, 2009, 09:17:09 am
Hi P,

As Simon mentioned, there is a Java sample shipped with version 7.5 If you don't have version 7.5 or don't plan to upgrade, please feel free to send an email to [email protected] marked for my attention and we'll send a copy back to you in reply.
Title: Re: Where can I find Java API or Java code example
Post by: P on June 11, 2009, 11:59:07 am
Thank you very much for all support. I will sent mail to request for Java API and sample code.  :D
Title: Re: Where can I find Java API or Java code example
Post by: P on June 12, 2009, 03:03:21 pm
I have sent mail to [email protected]. But nothing happen. I haven't got any response back. It's very hard for me to coding without API. Even I can learn from VB example, but there are many thing I have to guess. I have to doubt that what's this parameter used for from example.

For example,

t = method.Parameters.AddNew("TestParam","string")

I don't know that what the second parameter ("string") is used for.  :(
Title: Re: Where can I find Java API or Java code example
Post by: mrf on June 12, 2009, 03:19:01 pm
I sent a reply to your email at about midday yesterday. Try checking your spam filters etc to see if it hasn't got caught up there.
Title: Re: Where can I find Java API or Java code example
Post by: P on June 13, 2009, 05:23:44 am
Hi,

Sorry, Michael. No any mails from sparxsystems (even in Spam folder). You might send to the wrong email. My email is [email protected]. Could you please try again?

Thank you,
P.