Author Topic: Mass Change Objects  (Read 921 times)

55Teeth

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Mass Change Objects
« on: February 06, 2007, 03:24:11 pm »
Is there a way to mass change a set of stereotypes for multiple objects? For example, we've got 100 functional requirements ID'd, but after analysis, only 50 are functional, the rest are non-functional.

How can I change them all at once?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Mass Change Objects
« Reply #1 on: February 06, 2007, 04:39:52 pm »
I don't think you can. However, you might be able to do this by tweaking the database - an EAP file or DBMS repository, depending on how you store your models - directly.

Spend some time with the Search View. With a model open, type control-alt-R then click the Search option at the top left. This will give you an idea of whether you can select the stereotypes you need to change in bulk, and what they should be changed to. Then you can try tweaking the database after making a backup copy, of course.
No, you can't have it!

Dave_Bullet

  • EA User
  • **
  • Posts: 291
  • Karma: +0/-0
    • View Profile
Re: Mass Change Objects
« Reply #2 on: February 06, 2007, 06:05:18 pm »
With only 50 - it might take you longer via a database script.... but knowing how to change the database helps - especially when the numbers get large.

Assuming all 100 requirements are intermingled in the same package....
1. Create another package to hold the non-functional requirements... call the package something unique across your model, ie. "NFR_030"
2. Select and move the ones to change to NFRs into the new NFR_030 package
3. Run the following update (replacing 'Whatever' with the type of NFR you want to apply to the 50 requirements within the NFR_030 package)
update t_object set stereotype = 'Whatever'
where package_id = (select package_id from t_package where name = 'NFR_030')
and object_type = 'Requirement'

Of course - backup your database first.  If using MS Sql Server - run a "begin tran" before the above and check the rowcount after the update.  Then select the rows to confirm the correct ones have been updated, then if happy issue a "commit"

David.
"I know I'm close to a good design, but it's like the balloon animals, squeeze in one spot and the problem moves down the line"

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2495
  • Karma: +32/-2
    • View Profile
Re: Mass Change Objects
« Reply #3 on: February 06, 2007, 06:14:12 pm »
A lower-tech solution might be to export to XMI, perform a find-and-replace in a text editor, and import back in again. Not suitable in every situation, but worth keeping in your mental armoury.
The Sparx Team
support@sparxsystems.com

thomaskilian

  • Guest
Re: Mass Change Objects
« Reply #4 on: February 07, 2007, 10:18:51 am »
If you are familiar with add-ins I'd recommend to put the ones in question in a package and run an add-in over them.