Book a Demo

Author Topic: create tagged value with specific FQName  (Read 9240 times)

Pawel Jasinski

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
create tagged value with specific FQName
« on: October 04, 2011, 12:21:48 am »
hi,

I am trying to create tagged value with a given FQName. Is there a way to accomplish it without tinkering directly with t_xref content?

Has anybody figured out what exactly has to be inserted?

Cheers,
Pawel

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: create tagged value with specific FQName
« Reply #1 on: October 05, 2011, 06:35:51 am »
Unfortunately no. But if you figure it out I'd appreciate to have a little insight. Likely it's a bumpy road ahead of you.

q.
« Last Edit: October 05, 2011, 06:39:37 am by qwerty »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: create tagged value with specific FQName
« Reply #2 on: October 05, 2011, 06:54:57 pm »
You'll have to use Element.TaggedValues.AddNew() or is that not what you are asking?

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: create tagged value with specific FQName
« Reply #3 on: October 05, 2011, 08:00:31 pm »
I guess no. Creating a Tag from an MDG is not done that way. There are some strange things happening behind the scenes.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: create tagged value with specific FQName
« Reply #4 on: October 05, 2011, 08:13:16 pm »
Ah, I didn't read 'MDG" in the question..

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: create tagged value with specific FQName
« Reply #5 on: October 05, 2011, 08:40:06 pm »
It's hidden behind FQ. AFAIK only MDGs are connected with FQ tags.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: create tagged value with specific FQName
« Reply #6 on: October 05, 2011, 08:44:52 pm »
Ah, OK. My bad for not knowing anything about MDG

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: create tagged value with specific FQName
« Reply #7 on: October 05, 2011, 09:09:30 pm »
Lucky you :-)

Makes me a bit wonder. You're joking, aren't you?

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: create tagged value with specific FQName
« Reply #8 on: October 05, 2011, 09:42:28 pm »
No I'm not.
If you look at my contributions you'll note that none of them are regarding MDG technologies.
It's an item on my todo list to familiarize myself with the MDG stuff.

Geert

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: create tagged value with specific FQName
« Reply #9 on: October 06, 2011, 09:01:37 am »
The FQ path of a tagged value is encoded in its GUID, and you can't change a GUID once it's been set. Therefore, it's all about how you create the tagged value: either create a stereotyped element so the tagged values are created automatically; or add a stereotype to an element and then synchronize it to add the tagged values. (In both cases you'll notice it's EA creating the tagged value, not you...)
« Last Edit: October 06, 2011, 10:33:03 am by KP »
The Sparx Team
[email protected]

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: create tagged value with specific FQName
« Reply #10 on: October 06, 2011, 06:20:03 pm »
Quote
The FQ path of a tagged value is encoded in its GUID

Are you fricking kidding? :o
OMG, you should send that to http://thedailywtf.com/ I think that would make the frontpage

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: create tagged value with specific FQName
« Reply #11 on: October 06, 2011, 06:40:08 pm »
Phew. Hard stuff indeed. That happens when you code for years without redesign or refactoring and you run out of trap doors.

q.

Pawel Jasinski

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: create tagged value with specific FQName
« Reply #12 on: October 17, 2011, 02:50:26 am »
hi

Thanks for all the info. Somehow I am not getting any email notifications when replies are posted :-(

Anyway, what I have discovered hard way is exactly what KP says.
Here is the snipped from the db session which shows what happens when stereotype (with the right tagged values) is applied to existing element:

delete from t_objectproperties where Object_ID=12 and ea_guid like '{[highlight]D4F0310E-E861-2fe8[/highlight]-%' and Property='aNamespace'

Insert into t_objectproperties(`Object_ID`, `Property`, `Value`, `Notes`, `ea_guid`) Values(12,'aNamespace',NULL,NULL,'{[highlight]D4F0310E-E861-2fe8-B98D[/highlight]-E17A6212FB46}')

First all 'old' values from the compartment are nuked. Then the default one is inserted.
For a given tagged value and compartment the highlighted part of guid is always the same.

KP, is there a way to tell us how is the GUID generated?
Or perhaps some magic call into EA dll?

I have an idea for a workaround. For a given Model, I would have a dummy package with manually inserted elements. I can read the magic GUIDs out of the DB and (re)use when inserting new tagged values.
Anybody see a problem with this?

I also noticed something alarming. When I delete a tagged value out of compartment, I see no way to re-insert it using GUI? Until now I found only "apply <stereotype>", but this nukes all other values.
I also tried Compartment::Name. It gets into the right compartment but the name is inconsistent with the default name.

Cheers,
Pawel

Pawel Jasinski

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: create tagged value with specific FQName
« Reply #13 on: October 17, 2011, 03:59:34 am »
> Somehow I am not getting any email notifications when replies are posted

It was a spam filter :-(