Book a Demo

Author Topic: How to access package "keywords" from au  (Read 8407 times)

cstiller

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
How to access package "keywords" from au
« on: March 09, 2005, 07:36:50 am »
Since this has already cost me wayy too much time, I thought I'd ask here:

I am creating some documentation using the automation interface to EA. We define keywords in the packages (right click on package, package properties). Now I want to access that value form my automation interface.

"package" does not have a property keywords, and I couldn't find any property that contains that value.

I know that each package is also an element. However, "element" does not contain a property keyword either.

I know there is a collection "tagged values". package does not have this. element does. however, the tagged values for the element for the package do not contain the keyword.

TaggedValueEx does not seem to show any different data. It sure does nto show my keywords.


If I look at the properties window in EA, is shows the keyword under "project". This doesn't make any sense to me, but I tried it anyway. package has no "project". Element has no "project".  "GetElementProperties" from project works on elements, but does not contain my keyword.

If I export the package to XMI, the keyword shows as a tagged value.


I'm sufficiently furstrated now. How do I access that value? Given that it is on the main property dialog for packages, I assume it should be fairly easy to read it?

Am I doing something wrong? Am I missing something?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: How to access package "keywords" fro
« Reply #1 on: March 09, 2005, 01:50:54 pm »
Hi there,

I just gave it a go and it put the keyword value in t_object.PDATA5 which means you can access it in the Automation Interface from Package.Element.Miscdata(4)

Hope this helps

Neil
The Sparx Team
[email protected]

cstiller

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: How to access package "keywords" fro
« Reply #2 on: March 10, 2005, 12:55:23 am »
Thanks a lot, this works!

I have to ask though: What did you do to find out about this? I don't see how I was supposed to ever find this, especially given that "miscdata" seems to be a collection of some sorts, but can't be accessed using "count" and "getat". Is there a mapping of the different miscdata "fields" to the fields form the EA UI?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: How to access package "keywords" fro
« Reply #3 on: March 10, 2005, 06:01:43 pm »
Quote
What did you do to find out about this? I don't see how I was supposed to ever find this

If you get stuck you can either open the .EAP file in MS Access and browse around until you find whereabouts in your database the information has been put, or you can ask Sparx support  8).

Quote
especially given that "miscdata" seems to be a collection of some sorts, but can't be accessed using "count" and "getat". Is there a mapping of the different miscdata "fields" to the fields form the EA UI?

No it's not a collection, it's 5 separate fields. In the database they are called 'PDATA1' to 'PDATA5'; in the AutInt they are callled 'Miscdata(0)' to 'Miscdata(4)'. Try a search for "Miscdata" in the EA help file for more info.

HTH,

Neil
The Sparx Team
[email protected]

mikewhit

  • EA User
  • **
  • Posts: 608
  • Karma: +0/-0
  • Accessing ....
    • View Profile
Re: How to access package "keywords" fro
« Reply #4 on: March 11, 2005, 12:38:26 am »
Quote
These database fields are not documented
Hmm, useful !!

thomaskilian

  • Guest
Re: How to access package "keywords" fro
« Reply #5 on: April 11, 2006, 04:54:29 am »
Yes indeed, Mike :(

Now I wonder how to gain access to the Keywords of a class from the automation interface. Maybe I overlooked it, but I couldn't find any hint in the docu. Can anyone help?

Takeshi K

  • EA User
  • **
  • Posts: 632
  • Karma: +43/-1
    • View Profile
    • Sparx Systems Japan
Re: How to access package "keywords" fro
« Reply #6 on: April 11, 2006, 03:03:44 pm »
Maybe it's Element.Tag.  ;)

--
t-kouno
--
t-kouno

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How to access package "keywords" fro
« Reply #7 on: April 11, 2006, 03:23:27 pm »
I remember something about this from before.

It was some time ago, and I think the bottom line was that keywords could not be written via the automation interface. [Of course you could read the database field directly, but that's not what I'm talking about.]

I don't remember whether I found anything about this in the forum, but take a look at the MiscData property of the Element class in the Automation Reference section of the user guide.

You'll note that this property (array) is read-only.

Of course I needed to write this, and at the time EA opened Access files with an exclusive lock, so I switched to a repository and wrote a separate channel to the database. Sparx probably wants to keep this carefully guarded until the next global revision of the schema, so we may have to live with this limitation for some time.

David
No, you can't have it!

thomaskilian

  • Guest
Re: How to access package "keywords" fro
« Reply #8 on: April 13, 2006, 12:32:31 pm »
Quote
Maybe it's Element.Tag.  ;)

--
t-kouno

I'll give it a try and will report the result. Tomorrow is a holiday in Germany :)

Edit: Thanks, Takeshi! The keywords are actually found at the Tag property.  :)
(EAUI :-X)
« Last Edit: April 14, 2006, 05:30:25 am by thomaskilian »