Book a Demo

Author Topic: accessing tagged values in connectors  (Read 5296 times)

trickster60

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
accessing tagged values in connectors
« on: May 01, 2012, 03:24:35 pm »
Help please!!!

I am having all sorts of grief accessing via my add-in my user defined tagged values within a connector.

I have defined a tagged value in my profile for a connector in the usual way and in EA itself everything works fine. However when I am trying to access the tagged value in the EA_OnNotifyContextItemModified event I keep getting an error that basically says the item in the collection cannot be cast to EA.TaggedValue. My code looks like this:

foreach(EA.TaggedValue tag in connector.TaggedValues)
{
.....
}

In debug I see there are items in connector.TaggedValues but as soon as an assignment is attempted by any means to 'tag' the error occurs.

I've had no problems doing similar things with tagged values within Elements but buggered if I can get it to work for connectors.

Any bright ideas??????

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: accessing tagged values in connectors
« Reply #1 on: May 01, 2012, 03:45:44 pm »
All TaggedValues are equal but some are more equal than others...

Connector Tagged Values are not EA.TaggedValue but EA.ConnectorTag.

For Attributes they are EA.AttributeTag

HTH,
Paolo
« Last Edit: May 01, 2012, 04:02:59 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

trickster60

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: accessing tagged values in connectors
« Reply #2 on: May 01, 2012, 03:57:10 pm »
Doh of course

Geez a bit of consistency wouldn't go astray like perhaps for elements they might be of type EA.ElementTag, but oh no they are EA.TaggedValue!

Thanks heaps.

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: accessing tagged values in connectors
« Reply #3 on: May 01, 2012, 08:15:42 pm »
i dont see any reason to differentiate between the different tagged values.
the attributes are the same.
or if you rly want to make a difference
they simply could have extended the main class.

TaggedValue <- ElementTag
TaggedValue <- ConnectorTag
TaggedValue <- AttributeTag.....

to simple to do?
or am i only stupid?
« Last Edit: May 01, 2012, 08:16:04 pm by stao »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: accessing tagged values in connectors
« Reply #4 on: May 01, 2012, 10:10:16 pm »
No. It's EAUI. Even more strange if you discover that there's a table t_taggedvalue which does contain nothing. The tags are actually stored in t_objectproperties. The others are in t_connectortag, t_attributetag and t_operationtag. I guess Geoffrey had one or two beer to much when he made the database design. Not blaming him for that. But for not correcting that later.

q.

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: accessing tagged values in connectors
« Reply #5 on: May 01, 2012, 10:40:32 pm »
searching the database for tables which MAYBE contain the information we need.. thats what fun is.

i had my problems with the database while developing a sql Repository representation of the common Repository

http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1322259105