Author Topic: Duplicate Tagged Values  (Read 5166 times)

basalt

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Duplicate Tagged Values
« on: April 23, 2008, 07:18:16 pm »
Hi all,
Since upgrade to 7.1 there is a strange behavior.
There is an attribute with 2 tagged values called "dbColumn" and "isGuiOnly" and both have correct values and a stereotype called "MyAttribute".
Now I mark the attribute in the diagram and open the "Resource/Uml-Profiles" dialog. I will drag the stereotype "MyAttribute" to the selected attribute to sync the stereotype from my own profile. But now i will get 2 additional tagged values called "dbColumn" and "isGuiOnly". So how can i solve the problem or is this a bug in the new version of EA. Also tested in build "829".

thanks
george
« Last Edit: April 23, 2008, 07:26:31 pm by basalt »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Duplicate Tagged Values
« Reply #1 on: April 23, 2008, 08:25:28 pm »
Open the Set Feature Visibility dialog and turn on the fully-scoped tagged value partition. [Or is it stereotypes, I don't remember.] Does anything show up then?
No, you can't have it!

basalt

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: Duplicate Tagged Values
« Reply #2 on: April 23, 2008, 10:32:11 pm »
Hi Midnight.
Thanks for the reply. I changed the settings by rights click the class object and select "Feature Visibility". I select the checkBox called "Fully Qualified Tags" and tried it again.... The same happened, i got the tagged values twice after sync the stereotype from my profile.

any other ideas?

thx
george

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Duplicate Tagged Values
« Reply #3 on: April 24, 2008, 01:37:08 am »
Sorry George, this remains a mystery.

I suggest you send the project file - compressed of course - to Sparx support. I suspect (without proof) they thought they'd solved duplicate stereotypes in build 829. I was hoping the tags somehow went with the stereotypes. The bug report can be reached via the Registered Users page; the link is near the top. [I don't know whether the unregistered version let's you attach a file.]

Before you send it in though, check to confirm that you aren't seeing a problem that predates any correction in build 829. Perhaps creating your project under an earlier build has added duplicate tags, which are now part of the project. Try recreating the project from scratch - just the part that has problems - under build 829. If that works you have your answer. If not send the bug report.

David
No, you can't have it!

thomas.kilian

  • Guest
Re: Duplicate Tagged Values
« Reply #4 on: April 24, 2008, 02:33:28 am »
There is a global option Allow duplicate tags. This unchecked shows only one tag instance though keeping multiple tag instances. EAUI.

basalt

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: Duplicate Tagged Values
« Reply #5 on: April 24, 2008, 08:23:58 pm »
I found a setting at "Tools->Options->Objects->Show Duplicate Tags". this is unselected as default. I think this setting will ony handle the visibility of tagged values.

thx
george

basalt

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: Duplicate Tagged Values
« Reply #6 on: April 29, 2008, 07:44:25 pm »
Hi all, I sent a bug report to Sparx and here is the answer:

Code: [Select]
The problem that you are seeing is caused by our introduction of fully
qualified (FQ) tagged values. It is the first part of a bigger plan to
sort out the application of tagged values by stereotypes and get rid of
the synchronize command completely. Until we implement the rest of the
plan, however, the synchronization command needs to be improved.

If an element has the following tagged value before synchronization:

      myTag = "value"

After synchronization, you might have the following tagged values:

      myTag = "value"
      myProfile::myStereotype::myTag = ""

But if you have display of FQ tagged values switched off, this will
appear like this:

      myTag = "value"
      myTag = ""

This is what you are seeing. To switch to display FQ tags, click the
Options button in the Tagged Values window and choose "Show Fully
Qualified Tags".

The correct end result to the above synchronization would be:

      myProfile::myStereotype::myTag = "value"

This is not happening, so we are currently working on a fix.

kr
george

Viliam Durina

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Duplicate Tagged Values
« Reply #7 on: May 15, 2008, 05:10:10 pm »
If you use database repository you can repair duplicated tagged values with the following script. The script relies on the fact, that a duplicate tagged value always has higher propertyid than the original one. It simply moves the value to the newer one and deletes the older one, keeping only the profiled tagged value in place. Before running the script synchronize tagged values for all of your stereotypes to produce duplicates.

The script was written for Oracle database.

Code: [Select]
-- ATTRIBUTES #######
update T_ATTRIBUTETAG at
set value=(
  select value
  from T_ATTRIBUTETAG at2
  where at2.elementid=at.elementid and at2.property=at.property
  and at2.propertyid=(
    select min(at3.propertyid)
    from T_ATTRIBUTETAG at3
    where at3.elementid=at2.elementid and at2.property=at3.property
  )
)
where
  at.propertyid=(
    select max(propertyid)
    from T_ATTRIBUTETAG at4
    where at4.elementid=at.elementid and at4.property=at.property
    having count(*)>1
  );
  
delete
from t_attributetag ta
where ta.propertyid=(
  select min(ta2.propertyid)
  from t_attributetag ta2
  where ta2.elementid=ta.elementid and ta2.property=ta.property
  having count(*)>1
);


-- METHODS #######
update T_OPERATIONTAG at
set value=(
  select value
  from T_OPERATIONTAG at2
  where at2.elementid=at.elementid and at2.property=at.property
  and at2.propertyid=(
    select min(at3.propertyid)
    from T_OPERATIONTAG at3
    where at3.elementid=at2.elementid and at2.property=at3.property
  )
)
where
  at.propertyid=(
    select max(propertyid)
    from T_OPERATIONTAG at4
    where at4.elementid=at.elementid and at4.property=at.property
    having count(*)>1
  );
  
delete
from T_OPERATIONTAG ta
where ta.propertyid=(
  select min(ta2.propertyid)
  from T_OPERATIONTAG ta2
  where ta2.elementid=ta.elementid and ta2.property=ta.property
  having count(*)>1
);


-- CONNECTORS #######
update T_CONNECTORTAG at
set value=(
  select value
  from T_CONNECTORTAG at2
  where at2.elementid=at.elementid and at2.property=at.property
  and at2.propertyid=(
    select min(at3.propertyid)
    from T_CONNECTORTAG at3
    where at3.elementid=at2.elementid and at2.property=at3.property
  )
)
where
  at.propertyid=(
    select max(propertyid)
    from T_CONNECTORTAG at4
    where at4.elementid=at.elementid and at4.property=at.property
    having count(*)>1
  );
  
delete
from T_CONNECTORTAG ta
where ta.propertyid=(
  select min(ta2.propertyid)
  from T_CONNECTORTAG ta2
  where ta2.elementid=ta.elementid and ta2.property=ta.property
  having count(*)>1
);


-- CLASSES #######
update T_OBJECTPROPERTIES at
set value=(
  select value
  from T_OBJECTPROPERTIES at2
  where at2.object_id=at.object_id and at2.property=at.property
  and at2.propertyid=(
    select min(at3.propertyid)
    from T_OBJECTPROPERTIES at3
    where at3.object_id=at2.object_id and at2.property=at3.property
  )
)
where
  at.propertyid=(
    select max(propertyid)
    from T_OBJECTPROPERTIES at4
    where at4.object_id=at.object_id and at4.property=at.property
    having count(*)>1
  );
  
delete
from T_OBJECTPROPERTIES ta
where ta.propertyid=(
  select min(ta2.propertyid)
  from T_OBJECTPROPERTIES ta2
  where ta2.object_id=ta.object_id and ta2.property=ta.property
  having count(*)>1
);

commit;

Viliam Durina
« Last Edit: May 15, 2008, 05:12:39 pm by viliam.durina »

basalt

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: Duplicate Tagged Values
« Reply #8 on: July 14, 2008, 07:42:55 pm »
Hi Viliam Durina.
This will be a nice workaround, but I think that Sparx has to provide a builtIn solution for this problem, and so I will wait for the next build of EA to try, but thanks for your solution.

also see: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1214480695/2#2

kind regards
basalt