Author Topic: How to change the type of an element?  (Read 3853 times)

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
How to change the type of an element?
« on: August 11, 2011, 07:27:26 pm »
Hi All,

Is there an easy way (other than sql) to change all instances of the use of a given "Stereotype" to another?

Some of our users have used the wrong stereotype in the model.

Thanks,

Jon Ridgway.

Rouven

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
    • View Profile
Re: How to change the type of an element?
« Reply #1 on: August 17, 2011, 02:52:46 am »
I suppose that if you do not appreciate the SQL approach, the automation script wouldn't be what you are looking for either?

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1309
  • Karma: +120/-10
  • Its the results that count
    • View Profile
Re: How to change the type of an element?
« Reply #2 on: August 17, 2011, 11:18:13 am »
Here are some options for you to consider
A) Manually go through all the elements and change the stereotype. This is probably okay for small numbers but becomes tedious and error prone for large numbers.

B)Export GUID, Name, Stereotype to a CSV File. Use MS Excel or text editor to do a search and replace then import the modified CSV File.  

C) Transfer to an EAP file if its not in that form already. Open in MS Access and open the t_object table,  do a search and replace on the stereotype column. Then transfer back to original format. You can do these transfers via menus Tools>Data Management Project Transfer. This will work for repositories that don't exceed MS Access Database Size Limit.

D) Write a JScript/VBScript using the "Manage Stereotypes Example" as a basis. You can access the scripts via shortcut keys Alt+6.

E) Write some SQL and execute it on the database to search and replace. Noted this is an option already considered.

Hope that gives you some alternatives to think about. Your choice is probably dependent up on skill set you have. The simplest using CSV import/export may be the best option.

Note that objects can have multiple stereotypes so if your not carefully you might end up with the objects having two, the old one and the new one.


Happy to help
:)