Author Topic: EA Glossary (Add/Delete) via automation  (Read 5874 times)

David Rains (bioform)

  • EA User
  • **
  • Posts: 84
  • Karma: +0/-0
    • View Profile
EA Glossary (Add/Delete) via automation
« on: May 07, 2012, 04:00:50 am »
Working with the Glossary (Term)... I need to understand the CRUD operations for using the glossary.

I understand  Term is the entry object, but is there a collection that represents the entire glossary? I assumed it would work like working with an element collection e.g., element's connectors (collection) the getat etc,

Do I need to do this via SQL?

Thanks,
David

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: EA Glossary (Add/Delete) via automation
« Reply #1 on: May 07, 2012, 06:15:33 am »
Look into Repository.Terms

q.

David Rains (bioform)

  • EA User
  • **
  • Posts: 84
  • Karma: +0/-0
    • View Profile
Re: EA Glossary (Add/Delete) via automation
« Reply #2 on: May 07, 2012, 07:11:00 am »
Yep that's what I needed! doh...

Thanks,

BTW the .GetAtName method does not work... grr is this a known bug?
I am forced to cycle through the term entries.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: EA Glossary (Add/Delete) via automation
« Reply #3 on: May 07, 2012, 09:46:36 am »
From the help:
Quote
GetByName (string Name)

Gets an item in the current collection by Name.

If the collection does not contain any items, the method returns a null value. If the collection contains items, but it was unable to find an object with the specified name, the method raises an exception.

Only supported for the following collections: Model, Package, Element, Diagram, and element TaggedValue.

Parameters:
  • Name: String


David Rains (bioform)

  • EA User
  • **
  • Posts: 84
  • Karma: +0/-0
    • View Profile
Re: EA Glossary (Add/Delete) via automation
« Reply #4 on: May 08, 2012, 03:29:06 am »
Just curious but why make a method public if it is not being supported?

Thanks

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: EA Glossary (Add/Delete) via automation
« Reply #5 on: May 08, 2012, 04:49:14 am »
Quote
Just curious but why make a method public if it is not being supported?

Thanks
What exactly is the error you're facing? As far I can see, Simon refers to a method called 'GetByName()' and you're mentioning 'GetAtName()'. Or was this just a typo?

WBR
Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: EA Glossary (Add/Delete) via automation
« Reply #6 on: May 08, 2012, 08:33:51 am »
Yes, the function is GetByName, and it's on a datatype that is used for multiple different collections and not supported for all of them.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA Glossary (Add/Delete) via automation
« Reply #7 on: May 08, 2012, 03:51:54 pm »
David,

I would avoid the usage of the operation GetByName() altogether.
In fact I try to avoid the usage of the EA.Collection as much as possible. The first thing I do is put the individual elements into a "real" collection (such as a List<EA.Element>) and then use that collection further in my code.
One of the reasons is because it is not a strong typed collection, another is that it (sometimes) queries the database even when simply enumerating, and yet another reason is that you can't use the fancy .Net find() operations and things like that on them.

Geert