Author Topic: Synchronize tagged values on operation  (Read 470 times)

bilon

  • EA User
  • **
  • Posts: 68
  • Karma: +0/-0
    • View Profile
Synchronize tagged values on operation
« on: July 18, 2019, 10:52:32 pm »
I'm adding new stereotype to a operation and I need to propagate all the operations tagged values to this operation. There's a method SynchTaggedValues but it exists just for elements. So, what to do with the operation?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9547
  • Karma: +275/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Synchronize tagged values on operation
« Reply #1 on: July 18, 2019, 11:49:12 pm »
if you do it correctly the tagged values should appear automatically after setting the stereotype.
Make sure to use StereotypeEx and the fully qualified stereotype name.

Geert

bilon

  • EA User
  • **
  • Posts: 68
  • Karma: +0/-0
    • View Profile
Re: Synchronize tagged values on operation
« Reply #2 on: July 19, 2019, 01:09:41 am »
I'm used to use plain names, because EA UI does it this way. Anyway, even with fully qualified names, it doesn't work. Here is my code:
Code: [Select]
Set methBP = tab.Methods.AddNew("BASE", Empty)
methBP.Stereotype = "aaBIF metadata::Phase_Basic"
methBP.StereotypeEx = methBP.Stereotype
methBP.Update
tab.Methods.Refresh

What is strange, that when looking at the operation properties afterwards, both stereotypes are plain. It looks like this (name|stereotype|stereotypeEx):
BASE|Phase_Basic|Phase_Basic

Here is the image of my MDG profile:

https://photos.app.goo.gl/bxCRgp4sXKkuUw2u7

« Last Edit: July 19, 2019, 06:24:47 pm by bilon »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9547
  • Karma: +275/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Synchronize tagged values on operation
« Reply #3 on: July 19, 2019, 01:22:27 am »
Don't use .stereotype, but ony StereotypeEx
Then you'll have to make sure you are using the correct fully qualified name. Check t_xref to be sure.
An image of the toolbox does not help in any way as neither the name of the UML profile as the name of the stereotypes are shown there.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 10634
  • Karma: +234/-196
  • I'm no guru at all
    • View Profile
Re: Synchronize tagged values on operation
« Reply #4 on: July 19, 2019, 01:35:07 am »
Code: [Select]
methBP.Stereotype = "aaBIF metadata::Phase_Basic"
methBP.StereotypeEx = methBP.Stereotype
Makes EA cut the stereo to its base name which you then feed in to Ex. Would be the same as
Code: [Select]
methBP.Stereotype = "aaBIF metadata::Phase_Basic"
methBP.StereotypeEx = "Phase_Basic"

q.

bilon

  • EA User
  • **
  • Posts: 68
  • Karma: +0/-0
    • View Profile
Re: Synchronize tagged values on operation
« Reply #5 on: July 19, 2019, 06:35:41 pm »
I use both Stereotype and StereotypeEx, because EA UI does it this whay. When using StereotypeEx only, what shall I do with Stereotype? Leave it empty?

Anyway, using this
Code: [Select]
methBP.Stereotype = "aaBIF metadata::Phase_Basic"
methBP.StereotypeEx = "aaBIF metadata::Phase_Basic"
has same effect as using this
Code: [Select]
methBP.Stereotype = "aaBIF metadata::Phase_Basic"ode
methBP.StereotypeEx = methBP.Stereotype
both properties are without qualifier. So, how shall I code it?

By the way, both profile and stereotype are visible in the picture. I have emphasized it.

What is it t_xref?

qwerty

  • EA Guru
  • *****
  • Posts: 10634
  • Karma: +234/-196
  • I'm no guru at all
    • View Profile
Re: Synchronize tagged values on operation
« Reply #6 on: July 19, 2019, 06:42:17 pm »
t_xref is the table that also holds stereotype information. Have you also tried to JUST use stereotypeEx?

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9547
  • Karma: +275/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Synchronize tagged values on operation
« Reply #7 on: July 19, 2019, 06:42:39 pm »
Yes, use only .StereotypeEx, don't use .Stereotype at all.
EA will fill in the .Stereotype field for you based on what you set in StereotypeEx

What is shown in your picture is the toolbox panel name, and the toolbox item name.
They can be the same as the profile and stereotype, but don't have to be.

t_xref is the table where the fully qualified stereotype details are stored.

Geert

bilon

  • EA User
  • **
  • Posts: 68
  • Karma: +0/-0
    • View Profile
Re: Synchronize tagged values on operation
« Reply #8 on: July 19, 2019, 07:39:56 pm »
Ok, I found this in the t_xref (in many rows)
@STEREO;Name=Phase_Basic;FQName=aaBIF metadata::Phase_Basic;@ENDSTEREO;
so my fully qualified name was ok.

My code looks like this
Code: [Select]
Set methBP = tab.Methods.AddNew("BASE", Empty)
methBP.StereotypeEx = "aaBIF metadata::Phase_Basic"
methBP.Update
tab.Methods.Refresh
but the result is still same - both stereotypes without qualifier and no taggad values on the method.

???

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9547
  • Karma: +275/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Synchronize tagged values on operation
« Reply #9 on: July 19, 2019, 07:48:24 pm »
Ok, I found this in the t_xref (in many rows)
@STEREO;Name=Phase_Basic;FQName=aaBIF metadata::Phase_Basic;@ENDSTEREO;
so my fully qualified name was ok.

My code looks like this
Code: [Select]
Set methBP = tab.Methods.AddNew("BASE", Empty)
methBP.StereotypeEx = "aaBIF metadata::Phase_Basic"
methBP.Update
tab.Methods.Refresh
but the result is still same - both stereotypes without qualifier and no taggad values on the method.

???
The stereotype fields never show the fully qualified name, so that's OK.
The tagged values should have automatically been added.
I've never really used this on operation, so there might be a bug preventing the tagged values to be added directly.

In that case there's a workaround to call Synchronize stereotype, but that will dot it for all items with that stereotype.
Since v14 or v15 you use Repository.SynchProfile (string Profile, string Stereotype)

Geert

bilon

  • EA User
  • **
  • Posts: 68
  • Karma: +0/-0
    • View Profile
Re: Synchronize tagged values on operation
« Reply #10 on: July 19, 2019, 07:54:23 pm »
Hm, I'm using v12 :-(
Anyway, synchronizing all the objects isn't very handy for my needs.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9547
  • Karma: +275/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Synchronize tagged values on operation
« Reply #11 on: July 19, 2019, 08:03:11 pm »
In v12 you can use the Repository.CustomCommand to do the same:

See this script for an example: https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/blob/master/Framework/Tools/UML%20Profile/Synchronize%20Steretoypes.vbs

Geert

bilon

  • EA User
  • **
  • Posts: 68
  • Karma: +0/-0
    • View Profile
Re: Synchronize tagged values on operation
« Reply #12 on: July 19, 2019, 08:20:50 pm »
I've tried and it works. Ok, this is just workaround for me, but thank you.