Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: David Rains (bioform) 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
-
Look into Repository.Terms
q.
-
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.
-
From the help:
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:
-
Just curious but why make a method public if it is not being supported?
Thanks
-
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
-
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.
-
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