Author Topic: Applying updates of a UML Profile  (Read 5429 times)

adepreter

  • EA User
  • **
  • Posts: 187
  • Karma: +10/-9
    • View Profile
Applying updates of a UML Profile
« on: December 19, 2011, 07:44:44 pm »
Hello,

When we update a UML profile, is there any way to avoid the existing tag values to be lost?

Even when we simply add a tag value in our profile, the existing tag values (in our huge model) get lost when we re-apply the profile.

Thanks

Alain

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Applying updates of a UML Profile
« Reply #1 on: December 19, 2011, 11:08:35 pm »
Not sure whether this behaviour is a bug....

But to rescue your tags you can dump the table t_objectproperties and restore the contents later. That should do it.

q.

adepreter

  • EA User
  • **
  • Posts: 187
  • Karma: +10/-9
    • View Profile
Re: Applying updates of a UML Profile
« Reply #2 on: December 20, 2011, 10:38:55 pm »
Let's describe the problem with a concrete example:

1) Create a profile "MyProfile" that includes
  -  Stereotype "Logical Application Component", that includes
     -  Tag "Lifecycle", that is of
        - Enumerated type: "Undefined, Envision, Development"
         and where the default value is "Envision"

2) In a model "My Model",
- Import the profile "My Profile"
- Apply the stereotype to a component called "My Application"
- Set the "Lifecycle" tag to the value "Production"

3) In the profile "My Profile",
- Update the enumerated type by adding the value "Retired"
  Now the Enumerated type looks like this:
      Enumerated type: "Envision, Development, Production, Retired"

4) Import/Reapply the profile "My Profile" in the model "My Model"

Problem:
- "My Application" does not have the "Retired" value (Indeed, I can see this also in the table t_objectproperties)
- If, as an alternative, I reapply the stereotype to "My Application" then all tag values are set to the default value "Envision" (al my values are lost)

So, to summarize, are there any Sparx features, tools, scripts, snippets... that can be used to manage the lifecycle of UML profiles AND of the models that apply these profiles?

Thanks

Alain

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Applying updates of a UML Profile
« Reply #3 on: December 21, 2011, 04:32:04 am »
When you say "Import the profile", what exactly do you mean? Do you use the import into the resource?

q.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Applying updates of a UML Profile
« Reply #4 on: December 21, 2011, 08:44:04 am »
In the Resources view, right-click the stereotype and "Synch Tagged Values and Constraints". That will update the tag definitions for each stereotype instance without resetting the tagged values to their defaults.
The Sparx Team
[email protected]

adepreter

  • EA User
  • **
  • Posts: 187
  • Karma: +10/-9
    • View Profile
Re: Applying updates of a UML Profile
« Reply #5 on: December 21, 2011, 08:25:49 pm »
Thank you. That works! :)

ToddO

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Applying updates of a UML Profile
« Reply #6 on: January 11, 2012, 02:07:22 am »
Quote
In the Resources view, right-click the stereotype and "Synch Tagged Values and Constraints". That will update the tag definitions for each stereotype instance without resetting the tagged values to their defaults.

Is there any way to do this through the API? Stereotypes don't have any relevant method.

Also I cannot find a way to apply all the tagged values of a stereotype to an element that has the stereotype applied.

EDIT:

Well, managed to find it, the repository has a SynchProfile operation, passing the profile and stereotype names as strings. The documentation is not very easy to navigate, lots of broken links.
« Last Edit: January 11, 2012, 03:03:57 am by ToddO »