Book a Demo

Author Topic: Issue with Java API eaapi.jar  (Read 3881 times)

Bruce Taylor

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Issue with Java API eaapi.jar
« on: April 27, 2013, 01:37:46 am »
Using the Java API contained in eaapi.jar, it is possible to get and set the Alias field of Packages, Elements, and Connectors, but not for Attributes. It looks like this was an oversight, because Attributes can clearly contain an Alias, and the aliases can be imported/exported using XMI.

Has anyone found a newer version of eaapi.jar with this issue fixed, or found a workaround for the problem?

Many thanks

Paulus

  • EA User
  • **
  • Posts: 152
  • Karma: +0/-0
    • View Profile
Re: Issue with Java API eaapi.jar
« Reply #1 on: April 27, 2013, 06:19:13 pm »
I'm using EA 10 which includes a eaapi.jar that dates from 12 april 2010...

-As a workaround- you could write an SQL update statment, directly on the database table, after creating the attribute and updating that to the database.

You can use the EA model search view to create and test your update statement (it provides code completion), then run the SQL statement using the java API Repository.Execute.

best regards,

Paulus

Paulus

  • EA User
  • **
  • Posts: 152
  • Karma: +0/-0
    • View Profile
Re: Issue with Java API eaapi.jar
« Reply #2 on: April 28, 2013, 02:55:31 am »
.... Bruce  according to the EA Spec for Attribute class the ALIAS is stored in the field STYLE...  ::)


There is a Attrbiute.SetStyle() available in eaapi.jar... so you should be able to set tye alias using Attrbiute.SetStyle()  ;)

Bruce Taylor

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Issue with Java API eaapi.jar
« Reply #3 on: April 30, 2013, 01:00:07 am »
Quote
.... Bruce  according to the EA Spec for Attribute class the ALIAS is stored in the field STYLE...  ::)

Ah, so it is - thanks for seeing that. Not at all intuitive, but I've been involved in hacks just as bad in my day...