Book a Demo

Author Topic: Duplicating Element in The Same Package  (Read 3963 times)

Gokcen Guner

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Duplicating Element in The Same Package
« on: October 25, 2013, 02:04:44 am »
Hello,
I need to copy-paste some elements in the same package. These elements are usecases. When using GUI, this operation creates a usecase named with the original one plus " - Copy". Can I use automation interface to achieve same thing?
Thanks in advance.

Yves C

  • EA User
  • **
  • Posts: 33
  • Karma: +1/-1
  • I love YaBB 1G - SP1!
    • View Profile
Re: Duplicating Element in The Same Package
« Reply #1 on: October 25, 2013, 02:47:44 am »
You can use copy/paste diagram to do this :
1. Create a diagram containing all the elemenst you want to clone
2. Select the package and launch paste diagram
3. Select the option "Deep" or "Smart" depending on your intention.
4. That's it.

Beware : the objects are cloned. It means that all their properties including their relationships are cloned.
Yves

Gokcen Guner

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: Duplicating Element in The Same Package
« Reply #2 on: October 25, 2013, 03:32:05 am »
Quote
You can use copy/paste diagram to do this :
1. Create a diagram containing all the elemenst you want to clone
2. Select the package and launch paste diagram
3. Select the option "Deep" or "Smart" depending on your intention.
4. That's it.

Beware : the objects are cloned. It means that all their properties including their relationships are cloned.

Thanks Yves but I need to do this using automation not GUI.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Duplicating Element in The Same Package
« Reply #3 on: October 25, 2013, 05:43:35 am »
You could use the Repository.Clone method if you move the element(s) to clone into a temp package. (Should I say that it would be nice if the API would be a bit more OO and offer clone and delete methods for all objects?)

q.

Gokcen Guner

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: Duplicating Element in The Same Package
« Reply #4 on: October 25, 2013, 06:16:45 am »
Quote
You could use the Repository.Clone method if you move the element(s) to clone into a temp package. (Should I say that it would be nice if the API would be a bit more OO and offer clone and delete methods for all objects?)

q.
Hi qwerty,
I couldn't find Repository.Clone method in EA Help contents. There is only one clone method in Package class.
I also agree what you wrote in parenthesis :)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Duplicating Element in The Same Package
« Reply #5 on: October 25, 2013, 07:20:59 am »
Sorry. It's package.clone (of course). You'd need to call that for the temp package where you moved in the elements to clone.

q.
« Last Edit: October 25, 2013, 07:21:48 am by qwerty »

Gokcen Guner

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: Duplicating Element in The Same Package
« Reply #6 on: October 26, 2013, 10:04:15 pm »
Quote
Sorry. It's package.clone (of course). You'd need to call that for the temp package where you moved in the elements to clone.

q.
Thank you qwerty. I'll check it out.