Author Topic: Adding elements  (Read 5659 times)

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Adding elements
« on: March 02, 2008, 06:15:08 pm »
Hi to all,
My add-in needs to create elements, and since I can't upload EAs dialog for it, I need to replicate it. the problem is that I can't find a way to filer the sterotype by the selected object type.
Although there is a string in the stereotype claiming what does it apply to, it dosn't seem to fit any type name (even trimming the "ot").
Can it be that there is a bug and the types in "AppliesTo" do not mach the ObjectType strings?
Recursion definition:
If you don’t understand the definition read "Recursion definition".

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: Adding elements
« Reply #1 on: March 02, 2008, 06:25:46 pm »
Now I see the problem.
ObjectType<>Element type (though elemnt types ARE kept in t_objectTypes!!).
How can i get the list of element types in the repository?
« Last Edit: March 02, 2008, 06:30:14 pm by MartinT »
Recursion definition:
If you don’t understand the definition read "Recursion definition".

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Adding elements
« Reply #2 on: March 03, 2008, 01:12:42 am »
Hi Martin,

Look at the list provided in EA Help (the SDK part) [EDIT: as well as the 'type' tables].

One thing that I trip over is that there is no object type (in the enumeration) for, say, a Use Case. That is because the API sees it as simply an element. The enumeration basically shows us the list of collections that we can work with. The Type (usually) attribute of an entity gives us more specific information.

Some elements do appear in the enumeration though. AFAIK these cases point to situations where some element (or whatever) has a collection of specific 'things' and the enumeration includes this possibility. An example would be events.

This is going to cause you some grief when you hit connectors, but you'll be able to work through it.

David
« Last Edit: March 03, 2008, 01:44:47 am by Midnight »
No, you can't have it!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Adding elements
« Reply #3 on: March 03, 2008, 01:36:16 am »
Just don't trust the help all the time. I remember occasions where the documentation was not really complete. I think that was with the diagram types. To be sure you can always have a look in the xxxtypes table.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Adding elements
« Reply #4 on: March 03, 2008, 01:45:28 am »
Very true Geert,

Thanks for pointing out my omission. Correction made.   :-[

David
No, you can't have it!

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: Adding elements
« Reply #5 on: March 03, 2008, 01:55:36 am »
I just ectracted it from t_objecttypes.
though I realy think it should be part of the repository API, just as stereotypes collection.
Recursion definition:
If you don’t understand the definition read "Recursion definition".