Book a Demo

Author Topic: Changing types...  (Read 4128 times)

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Changing types...
« on: January 06, 2012, 04:04:17 am »
I need to change the object type of all text annotations in my model that have a name that starts with 'BR-' from a TextAnnotation to a Requirement.

I've written and run the update sql:

update t_object set object_type = 'Requirement', stereotype = 'Functional' where stereotype = 'TextAnnotation' and name like 'BR-%'

Runs fine...however in sparx the objects are still shown as TextAnnotations - until i open and clos their property sheet - they then magically become Requirments...clearly i need to update something else...but i can't figure out what it is - which table ??

Any help much appreciated.

Thanks,

Jon.

ps...can't use advanced->change object type as need to set the stereotype as well to 'Functional'

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Changing types...
« Reply #1 on: January 06, 2012, 08:57:47 am »
Just an offline shot in the dark: check t_diagramobjects. Maybe dragging a changed object will show in the new format directly?

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Changing types...
« Reply #2 on: January 06, 2012, 06:18:13 pm »
And you are sure you reloaded the model before checking?
EA tends to keep a whole lot in its memory cache, so database changed could go unnoticed until you reload or open the properties dialog.

Geert

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Changing types...
« Reply #3 on: January 06, 2012, 09:49:12 pm »
Thanks for the responses. FYI turns out to be our old friend t_xref - looks like description is used to pick the icon to display on browser and in diagrams - updated to use the "Functional" stereotype icon and all OK....

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Changing types...
« Reply #4 on: January 06, 2012, 10:15:53 pm »
What a coincidence. I just have to solve a similar issue where I changed the stereotype of an element via SQL and the diagram still shows the old value. I'll have a look in xref at once...

Thanks, q.

[edit:] Yes, it helped. I have just one question for my convenience. When I try to change t_xref via
Code: [Select]
update t_xref set description = replace(description, 'oldstereo', 'newstereo')I get an error from the MS SQL Server: Argument data type ntext is invalid for argument 1 of replace function. Any hints on that?
« Last Edit: January 06, 2012, 10:51:27 pm by qwerty »

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Changing types...
« Reply #5 on: January 06, 2012, 11:04:52 pm »
Which version of sql server are you using - 2000 doesn't look to support replace of ntext fixed in later versions...

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Changing types...
« Reply #6 on: January 06, 2012, 11:34:05 pm »
Good question. I have to ask my DBA but it's not unlikely that they use a buggy version. For the time being I export, change with notepad++ and execute a direct update. Using the replace would just be more convenient.

q.