Book a Demo

Author Topic: Access EA Project from Java API  (Read 7148 times)

brk

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Access EA Project from Java API
« on: April 21, 2014, 01:30:14 am »
Hallo everyone,

I would like to access EA project from JAVA API. I found the EA JAVA API tutorial where it creates new Repository and gives access to it. I would like to read already existing repository/project with Java API.

I couldn't find any reference for that accessing already existing EA project with JAVA API.

Could anybody help me out.

Many thanks in advance,
Regards,
Ram

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Access EA Project from Java API
« Reply #1 on: April 21, 2014, 09:22:38 am »
AFAIK you can't do that from Java. You would need another language to interface EA.

No idea whether that helps: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1397472127
q.
« Last Edit: April 21, 2014, 09:24:37 am by qwerty »

EXploringEA

  • EA User
  • **
  • Posts: 172
  • Karma: +8/-0
    • View Profile
Re: Access EA Project from Java API
« Reply #2 on: April 21, 2014, 03:32:26 pm »
Hi

If you are wanting to access EA from a external Java app that should work fine and is covered in Sparx documentation - I did a little experiment some time ago when queried about EA and Java (http://exploringea.com/2013/12/11/ea-automation-with-java/) and all seemed to work fine.

What you can't do, as far as I know yet, is create an AddIn written in Java.  Perhaps Sparx will add support one day - when they do, I'll do another experiment and write up "EA automation with Java – part2". ;D

So depends on what you are trying to do.
Hope that helps.
EXploringEA - information, utilities and addins

brk

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Access EA Project from Java API
« Reply #3 on: April 21, 2014, 07:43:53 pm »
Well i have EA trail version. So everytime creating new repository with Java API opens EA Tool but with this EA trail version it is not possible.

So i am trying to access or read data from already existing EA project with java API. I found one pdf document , http://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDQQFjAA&url=http%3A%2F%2Fsamples.leanpub.com%2FScriptingEA-sample.pdf&ei=0eZUU6f4OO2A7Qax3YHgDw&usg=AFQjCNET5_8LcvfF9T8U7zgjYTgXpfU9IQ&sig2=m8uKUhEJJU79RQw4aXBeIQ&bvm=bv.65058239,d.bGE, in internet its for scriptingEA. It says, from page 6,  to access EA project Witha JAVA API is not possible.

I am just trying to get already running EA application from outside with Java APIinstead of creating one. The above document shows accessing running EA instance from outside in C++, Perl,Python and VB langugaes but not in Java. It says its not possible with java  :-[

Many thanks for your help.

Regards,
Ram
« Last Edit: April 21, 2014, 07:46:20 pm by brk235 »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Access EA Project from Java API
« Reply #4 on: April 21, 2014, 11:26:40 pm »
As said: with native Java it's not possible. But obviously you can follow the steps explained by MrWappy and run it through Eclipse.

q.

EXploringEA

  • EA User
  • **
  • Posts: 172
  • Karma: +8/-0
    • View Profile
Re: Access EA Project from Java API
« Reply #5 on: April 22, 2014, 03:06:04 am »
Hi

To be clear you should have no problems running a native java application accessing the EA API from outside of EA .

1. I don't think there is any specific issue with using an EA trial version that is in life; so if it is installed and running fine for modelling then should be fine for access from another app.
2. Not sure what OS you have but assume it is a normal windows XP / 7, and if a company PC may be that some policy restrictions are placed on your account to prevent a java app calling another application.  Can't imagine what the specific policies may be but then its windows and IT departments do their best.

So suggest you build the EA provided samples (see in the EA install directory e.g. C:\Program Files (x86)\Sparx Systems\EA\Code Samples\Java_Sample). There isn't a lot of supporting documents but the demo application works fine when run from a batch file (although my blog illustrated for eclipse that's not essential just seemed to be the way to go at the time)

If they fail to compile and run - check out what errors are being produced, as I believe that the java console will provide some clues.

If no luck report back with any errors observed - I'll take a look and I'm sure there are others on the forum with more experience of working with Java who may know instantly what's up; I just have the luxury of playing with it these days ;)
EXploringEA - information, utilities and addins