Author Topic: _tagGroups doesn't update in DB when changed  (Read 3452 times)

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
_tagGroups doesn't update in DB when changed
« on: November 25, 2015, 02:06:05 pm »
Hi,

Bug in EA 12.1.1222 :

Description: Tagged Value Groups ([size=12]_tagGroups[/size][/font][/color]) in the meta model isn't updated properly if changed.
Reproduce: Modify the group names, or add, and later remove a trailing semicolon in the _tagGroups list of group names in the meta model, the correction isn't updated/refreshed also in the corresponding database field.
Effect: This affects the final listing and grouping of the Tagged Values in the UI (in my case the TVs wasn't grouped at all due to a traling semicolon, which obviously is interpreted as part of the group name, and thus it doesn't match the [size=12]_tagGroupings[/size]).
Expected result: The DB field should of course be updated to store only what the meta model specifies so that the UI can render/group the TVs properly.

The field holding the [size=12]_tagGroups[/size][/font][/color] definitions is located in the table t_xref.[Description]

Example of an annoying error I fought with for hours. A typo remained uncorrected in the DB although fixed in the meta model, and caused the model to not render or group the Tagged Values as expected (the red semicolon causing trouble was stuck in the field as shown below):

    [@PROP=@NAME=_tagGroups@ENDNAME;@TYPE=string@ENDTYPE;@VALU=[size=12]CodeGen,Expressions,DB[/size]
[size=12];[/size]@ENDVALU;...]
                                                                                     [size=18]^[/size][/font]
... so I had to manually edit the database field (via MSAccess) to get rid of that annoying semicolon, like so :

   [@PROP=@NAME=_tagGroups@ENDNAME;@TYPE=string@ENDTYPE;@VALU=[size=12]CodeGen,Expressions,DB[/size]@ENDVALU;...]
                                                                                    [size=18]^[/size][/font]
In short: You have a bug there. Updating the stereotype [size=12]metaclass._tagGroups[/size] in the meta model must be updated also in the database. I even tried to remove the _tagGroup from the UI meta model altogether, but no go, the string still remained in full, untouched in the field as depicted above, even if it should have been removed entirely.

// Rolf
« Last Edit: November 25, 2015, 02:11:19 pm by Rolf_Lampa »
-- There's always a solution --

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7718
  • Karma: +101/-18
    • View Profile
Re: _tagGroups doesn't update in DB when changed
« Reply #1 on: November 25, 2015, 02:48:43 pm »
There's no functionality in EA to update the metaclass properties applied to existing stereotype applications in the model. They are also only applied when the element is created with that stereotype instead of being applied later.

The Synchronize Stereotype function clearly states that it only updates tagged values and constraints.

Personally, I'd like these properties to never be written to the database at all, but that's too big of a change for me to push on a whim.
Eve

support@sparxsystems.com

qwerty

  • EA Guru
  • *****
  • Posts: 12778
  • Karma: +363/-295
  • I'm no guru at all
    • View Profile
Re: _tagGroups doesn't update in DB when changed
« Reply #2 on: November 25, 2015, 10:30:20 pm »
Quote
Description: Tagged Value Groups ([size=12]_tagGroups[/size][/font][/color]) in the meta model isn't updated properly if changed.
I already have a chapter about versioning MDGs in my book, but changes to the grouping is an issue I have not included yet. I'll have to add this. Thanks for the pointer.

q.

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: _tagGroups doesn't update in DB when changed
« Reply #3 on: November 26, 2015, 01:55:53 pm »
Quote
Quote
Description: Tagged Value Groups ([size=12]_tagGroups[/size][/font][/color]) in the meta model isn't updated properly if changed.
I already have a chapter about versioning MDGs in my book, but changes to the grouping is an issue I have not included yet. I'll have to add this. Thanks for the pointer.
I'll have another look at your book on this.

It would really be helpful to have a tool capable of "cleaning" up the system on big changes (which is what happens all the time while developing new MDGs). At least the "organization" of all related properties should really benefit from a script that clears the entire system (eg. remove all traces from the database).

Optimal would be to detect manually changes in TVs , as to not touch them, but clear the rest. The need for this is a scary scenario regarding the fact that everything tends to get stuck in a mess when meta info changes. Especially since I'm developing a very complex framework with high probability for the need of future changes. Not being able to preserve existing (manually set) values will end up being a nightmare.

I'll probably have to start designing such a (cleanup) script and let it evolve over time. But if someone already has started such a a thing, please let me know.

In any case, it's Time for EA to normalize everything related to TVs organization, properties, default values etc. The current approach is far from "industrial strength". The Profile Helper is... , well, helpful, but it's not enough to be able to enter perfect data, which still isn't updated perfectly. That's my opinion.

<......>Ex ?
BTW, what is the difference between <PropertyNames> and <PropertyNames>Ex, really? (For example TaggedValues and TaggedValuesEx). I scratch my head about that, but as I'm coding some generic methods dealing with them right now, I really do need to know the difference.

// Rolf
« Last Edit: November 26, 2015, 01:57:29 pm by Rolf_Lampa »
-- There's always a solution --

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2898
  • Karma: +52/-3
    • View Profile
Re: _tagGroups doesn't update in DB when changed
« Reply #4 on: November 26, 2015, 02:53:45 pm »
Quote
<......>Ex ?
BTW, what is the difference between <PropertyNames> and <PropertyNames>Ex, really? (For example TaggedValues and TaggedValuesEx). I scratch my head about that, but as I'm coding some generic methods dealing with them right now, I really do need to know the difference.
TaggedValues is the collection of owned tagged values.
TaggedValuesEx is the collection of owned+inherited tagged values.
« Last Edit: November 26, 2015, 02:54:29 pm by KP »
The Sparx Team
support@sparxsystems.com

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: _tagGroups doesn't update in DB when changed
« Reply #5 on: November 27, 2015, 12:02:07 am »
Quote
TaggedValues is the collection of owned tagged values.
TaggedValuesEx is the collection of owned+inherited tagged values.
Ah... <looking blushed>

// Rolf
-- There's always a solution --