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

bilon

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Synchronize tagged values on operation
« Reply #15 on: August 28, 2020, 06:21:08 pm »
Yes, I've just created new operation and added stereotype to it. Without synchronization I can't see any tagged values.

Libor

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13381
  • Karma: +563/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Synchronize tagged values on operation
« Reply #16 on: August 28, 2020, 07:10:44 pm »
Yes, I've just created new operation and added stereotype to it. Without synchronization I can't see any tagged values.

Libor
Then I guess you must have done something wrong.
Setting the stereotype correctly should automatically create the tagged values.

Synchronize is only needed to reflect changes in the stereotype when you have added or change tagged values on the stereotype.

Geert

bilon

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Synchronize tagged values on operation
« Reply #17 on: September 01, 2020, 12:53:18 am »
Ok, here's the test case.

I have an element (it's selected in the project browser) without any operation. After running following script (adding a new operation and setting it's stereotype) I can see new operation, but no tagged values on it. But when uncommenting the last row of the script (synchronization of the stereotype), I can see all the tagged valued.

Code: [Select]
Dim elm As EA.Element
Dim meth As EA.Method
Set elm = Repository.GetTreeSelectedElements(0)
Set meth = elm.Methods.AddNew("OPER1", "")
meth.StereotypeEx = "aaBIF metadata::Phase_Basic"
meth.Update
elm.Methods.Refresh
'Repository.CustomCommand "Repository", "SynchProfile", "Profile=aaBIF metadata;Stereotype=Phase_Basic;"

And now tell me what I'm doing wrong.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Synchronize tagged values on operation
« Reply #18 on: September 01, 2020, 01:55:06 am »
Not sure (EAUI). Try to add another update before setting the stereotype. I remember some weird behavior there.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13381
  • Karma: +563/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Synchronize tagged values on operation
« Reply #19 on: September 01, 2020, 04:01:50 pm »
Also worth a try:

Code: [Select]
Dim elm As EA.Element
Dim meth As EA.Method
Set elm = Repository.GetTreeSelectedElements(0)
Set meth = elm.Methods.AddNew("OPER1", "aaBIF metadata::Phase_Basic")
meth.Update

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Synchronize tagged values on operation
« Reply #20 on: September 02, 2020, 06:10:15 am »
I just tried it and had no issue setting the stereotype.

q.

bilon

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Synchronize tagged values on operation
« Reply #21 on: September 05, 2020, 02:10:03 am »
@Geert, qwerty
None of your workarounds works  :-(

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Synchronize tagged values on operation
« Reply #22 on: September 05, 2020, 05:50:55 am »
Does the element show "any" stereotype after your script did run?

Probably you should run a consistency check once on your DB.

q.

bilon

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Synchronize tagged values on operation
« Reply #23 on: September 11, 2020, 07:33:17 pm »
I have run consistency check and reset ids, but it's still the same.
After running the script, new operation looks like this:

meth.Name=OPER1, meth.Stereotype=Phase_Basic, meth.StereotypeEx=Phase_Basic   

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13381
  • Karma: +563/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Synchronize tagged values on operation
« Reply #24 on: September 11, 2020, 08:14:21 pm »
What does t_xref.description say about it?

I'm guessing the stereotype is somehow not correctly set to the fully qualified stereotype.
Possibly a synchronize fixes this problem.
This should be apparent in t_xref.

A possible cause could be a spelling error in the fully qualified stereotype name (e.g. uppercase instead of lowercase)
I've seen cases like that where one part works (case insensitive) but other parts don't (case sensitive)

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Synchronize tagged values on operation
« Reply #25 on: September 11, 2020, 08:58:27 pm »
A possible cause could be a spelling error in the fully qualified stereotype name (e.g. uppercase instead of lowercase)
I've seen cases like that where one part works (case insensitive) but other parts don't (case sensitive)
If I'm not completely wrong EA ignores the case of stereotype in all cases (pun intended!).

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13381
  • Karma: +563/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Synchronize tagged values on operation
« Reply #26 on: September 11, 2020, 09:23:16 pm »
A possible cause could be a spelling error in the fully qualified stereotype name (e.g. uppercase instead of lowercase)
I've seen cases like that where one part works (case insensitive) but other parts don't (case sensitive)
If I'm not completely wrong EA ignores the case of stereotype in all cases (pun intended!).

q.
It depends. It ignores the case in the quicklink, but not in the syntax validation when adding a connector fromt the toolbox.

I just spent a good 45 minutes trying to find out why I could create a stereotyped relation with the quicklinker, but not from the toolbox. :-\

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Synchronize tagged values on operation
« Reply #27 on: September 11, 2020, 11:09:41 pm »
Then it's "Sparx-completely" :-/

q.

bilon

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Synchronize tagged values on operation
« Reply #28 on: September 11, 2020, 11:18:22 pm »
What I haven't mentioned, I'm using version 12. Let my friend to try in version 13 and - it works! Is there any change between versions 12 and 13, which could be the reason of the  difference?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13381
  • Karma: +563/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Synchronize tagged values on operation
« Reply #29 on: September 12, 2020, 12:00:05 am »
What I haven't mentioned, I'm using version 12. Let my friend to try in version 13 and - it works! Is there any change between versions 12 and 13, which could be the reason of the  difference?
Quite possible yes. Between v12 and the current v15.2 there has been a lot of improvements with regards to the handling of stereotypes.

Geert