Book a Demo

Author Topic: Can I move an Action item in an Activity item?  (Read 3668 times)

Bobbele

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Can I move an Action item in an Activity item?
« on: September 29, 2011, 08:18:56 pm »
Hello,

I defined some Action items in an Activity item. Now I want to move/change/switch the item typ from Action to Activity. Is there a way to do? How I can realize this?

At the moment I define activity diagrams.

Kind regards

Answers in German are also welcome.
« Last Edit: September 29, 2011, 08:23:07 pm by Bobbele »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Can I move an Action item in an Activity item?
« Reply #1 on: September 30, 2011, 06:02:31 pm »
Via the main menu: Element|Advanced|Change Type

Geert

Bobbele

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Can I move an Action item in an Activity item?
« Reply #2 on: September 30, 2011, 08:11:28 pm »
Many thanks. It works fine.

Do you also know, can I copy a complete strukture include all connections between the elements? I found only an option to copy the elements but withous the connections.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Can I move an Action item in an Activity item?
« Reply #3 on: September 30, 2011, 08:49:41 pm »
I don't think so.

Luis J. Lobo

  • EA User
  • **
  • Posts: 252
  • Karma: +0/-0
  • IT Consultant
    • View Profile
Re: Can I move an Action item in an Activity item?
« Reply #4 on: September 30, 2011, 08:56:26 pm »
The only way to clone an element with its relationships is trought scripting.

1. Create a temp Package
2. Move the Element to clone to the temp Package
3. Use Package.Clone method
4. Move the original Element to its original location
5. Move the cloned Element where you like
6. Delete the temp and temp_copy Packages

Bobbele

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Can I move an Action item in an Activity item?
« Reply #5 on: September 30, 2011, 11:03:56 pm »
I would try it over package managing but where I can find (or how I can use) the package.clone method? Is it necessary to program a script or something like that, or I can find this over the main menu?
« Last Edit: September 30, 2011, 11:12:47 pm by Bobbele »

Luis J. Lobo

  • EA User
  • **
  • Posts: 252
  • Karma: +0/-0
  • IT Consultant
    • View Profile
Re: Can I move an Action item in an Activity item?
« Reply #6 on: September 30, 2011, 11:36:21 pm »
You should create a "Project Browser" type scripts group and a VB script inside.

Later, you can invoke it from the context menu over the desired element to clone.

The script is:


Dim ElementToClone
Dim OriginalPackage
Dim TempPackage
Dim i
Dim TheEnd

Set ElementToClone = GetTreeSelectedObject
Set OriginalPackage = GetPackageByID(ElementToClone.PackageID)
Set TempPackage = OriginalPackage.Packages.AddNew("Elemento clonado", "Nothing")
TempPackage.Update
OriginalPackage.Packages.Refresh
OriginalPackage.Update
ElementToClone.PackageID = TempPackage.PackageID
ElementToClone.Update
TempPackage.Elements.Refresh
TempPackage.Update
TempPackage.Clone
ElementToClone.PackageID = OriginalPackage.PackageID
ElementToClone.Update
OriginalPackage.Elements.Refresh
OriginalPackage.Update
i = 0
TheEnd = False
While i < OriginalPackage.Packages.Count And Not TheEnd
      If OriginalPackage.Packages.GetAt(i).PackageID = TempPackage.PackageID Then
            OriginalPackage.Packages.DeleteAt i, False
            TheEnd = True
      End If
      i = i + 1
Wend
OriginalPackage.Packages.Refresh
RefreshModelView (OriginalPackage.PackageID)