Book a Demo

Author Topic: Element types (automation)  (Read 5309 times)

thomaskilian

  • Guest
Element types (automation)
« on: December 10, 2006, 02:31:23 pm »
Hi there,
would it be possible to receive another number than Object Type 4 for Note elements? When I want to produce my docu I don't want the Notes to be included. But currently I get a 4 (ordinary element) returned as OT. So for the time being I have to check for the name to be NE /Note[0-9]*/ >:(

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Element types (automation)
« Reply #1 on: December 10, 2006, 03:17:52 pm »
Seconded.

Very good idea. Don't know why it's slipped under the radar for so long.
No, you can't have it!

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Element types (automation)
« Reply #2 on: December 10, 2006, 05:48:53 pm »
A Note element in the automation interface is distinguished in the same way you can distinguish a Class from a Use Case.  If you check the Element.Type property, it should report "Note".

HTH.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Element types (automation)
« Reply #3 on: December 10, 2006, 06:28:43 pm »
What's the enumeration for then Aaron? And, why is it not fully documented after all this time?
No, you can't have it!

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Element types (automation)
« Reply #4 on: December 10, 2006, 07:50:16 pm »
The ObjectType enumeration is used when you have obtained the object via the dispatch interface.
http://www.sparxsystems.com.au/EAUserGuide/objecttypeenum.htm

A better example of this may be when using Repository.GetContextItem(Object).  Using this, the object retrieved could be an Element, Connector, Package, Diagram, etc.  The ObjectType enum allows you to identify the type of object you have.  After the object has been successfuly cast to EA.Element, the ObjectType property is of little value as you know it is always going to return otElement.

The ObjectType and Type properties are documented on the following reference page:
http://www.sparxsystems.com.au/EAUserGuide/element2.htm

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Element types (automation)
« Reply #5 on: December 10, 2006, 09:02:50 pm »
Quote
The ObjectType enumeration is used when you have obtained the object via the dispatch interface.
http://www.sparxsystems.com.au/EAUserGuide/objecttypeenum.htm

A better example of this may be when using Repository.GetContextItem(Object).  Using this, the object retrieved could be an Element, Connector, Package, Diagram, etc.  The ObjectType enum allows you to identify the type of object you have.  After the object has been successfuly cast to EA.Element, the ObjectType property is of little value as you know it is always going to return otElement.

The ObjectType and Type properties are documented on the following reference page:
http://www.sparxsystems.com.au/EAUserGuide/element2.htm

I'm well aware of the ObjectType and Type properties. However, the enumeration is another matter. What I meant about that documentation is that the page in question reads:
Object ob = Repository.GetElementByID(13);

if ( ob.ObjectType == otElement )

;

else if( ob.ObjectType == otAuthor )

...

However, no list of the actual values - of the enumeration - is provided. Perhaps this could be fleshed out in a future documentation version.
No, you can't have it!

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Element types (automation)
« Reply #6 on: December 10, 2006, 09:40:01 pm »
Ah, yes.  I understand your meaning.  I'll pass that along and it should be amended soon with a list of the possible enum values.

thomaskilian

  • Guest
Re: Element types (automation)
« Reply #7 on: December 10, 2006, 11:54:25 pm »
Thanks David, for continuing the discussion and Aaron, for forwarding it to development :)