Book a Demo

Author Topic: Bulk editing of Element Properties  (Read 6049 times)

Wiz

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Bulk editing of Element Properties
« on: August 25, 2011, 09:29:48 am »
Hi everyone,

Has anyone had experience in bulk editing a list of element properties? I have a list of about 500 requirements imported from CSV, but I can't seem to get the Alias field populating. I want to put the same value in for all of them, but cannot find a function anywhere to bulk edit or copy-down through all requirements. Doing it manually seems absurd. Is there a method to do this in EA9?

Regards

Stefan Bolleininger

  • EA User
  • **
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: Bulk editing of Element Properties
« Reply #1 on: August 25, 2011, 04:12:08 pm »
Hi!


two ways:

WAY1:
Look at "Project - Model Import/Export - CSV-Import/Export-Specifications"
Create an CSV-export specification with your needs:
type: requirements
Delimiter ;

Element fields: GUID, Name, ALIAS.... and

check to use the function preserve hierachy.

Then export all your requirements to csv ->open it in Excel ->rename all your aliases with your desired naming.

IMPORT it again to EA

WAY2:

Write a script to open and iterate trough all elements with type requirement and give them all your alias :)

Look at "View - Scripting" and take the included script "manage element example" to get more informations - how to script it.

Best regards

Stefan
Enterprise Architect in "safetycritical development" like medical device industry. My free Add-in at my Website

Wiz

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Bulk editing of Element Properties
« Reply #2 on: August 26, 2011, 07:32:42 am »
Thanks a lot! I had a look at the scripting option, but it's been a while since I touched any JScript so I took the second approach you outlined and it worked perfectly!

Regards
Fabian [smiley=vrolijk_26.gif]

Stefan Bolleininger

  • EA User
  • **
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: Bulk editing of Element Properties
« Reply #3 on: August 26, 2011, 03:36:25 pm »
Hi,

would you be willing and would it be allowed to you to share your script?

If you could post it here, it would ease up the question for the next user within the search function.

(Personally for me it is interessted because i never used the JScript ;)

Thank you
Enterprise Architect in "safetycritical development" like medical device industry. My free Add-in at my Website

pha

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Bulk editing of Element Properties
« Reply #4 on: August 27, 2011, 12:20:07 am »
Sethor de Faye,
try this script:

function SQL_Query()
    {
     Repository.Execute("UPDATE t_object SET Alias = 'Alias' WHERE Object_Type = 'Requirement'");
     }

SQL_Query();
« Last Edit: August 27, 2011, 12:21:12 am by 666999 »

Wiz

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Bulk editing of Element Properties
« Reply #5 on: August 29, 2011, 07:00:56 am »
Sorry Sethor, my mistake. I used the export/import process you discussed, not the scripting!

Cheers.

Just out of interest Pha, wouldn't your script update all requirements in the repository, or can you run that on just a package to update the contents?

pha

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Bulk editing of Element Properties
« Reply #6 on: August 29, 2011, 07:17:05 am »
Wiz, for me it is the fastest way to update any field of requirements. If I need to make it for requirements which in a package I would use GetTreeSelectedPackage() and iterated its contents or GetTreeSelectedElements() for multi select.