Book a Demo

Author Topic: Automatic moving of elements  (Read 3983 times)

stanislav

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Automatic moving of elements
« on: December 31, 2011, 12:08:53 am »
Hi,
I need to prepare some kind of automate categorizations.
For example I have Package1, Package2 and Package3. Package1 and Package2 serve only as a repository of elements. In Package3 I create diagrams.
So what I would like to achieve is , when I create element in diagram in Package3, the element is automatically moved(it appears in the new package in the project browser) in Package1 or Package2 (depending on its type), but the link to the Diagram in Package3 remains.

It is possible to write script for this?

Thank you in advance


abruckner

  • EA User
  • **
  • Posts: 22
  • Karma: +0/-0
    • View Profile
Re: Automatic moving of elements
« Reply #1 on: January 02, 2012, 09:11:44 pm »
Yes, think so.
In automation I would subscribe to EA's PostNewElement event, then change the PackageID of the newly created element to the Package-ID you want.
Finally set the ParentID to 0 (zero), as it will be no child of the diagram any more.

Maybe you will have to do a refresh on the treeview. But this shouldn't be the problem.

stanislav

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Automatic moving of elements
« Reply #2 on: January 02, 2012, 09:36:04 pm »
Thank you for you answer, if I understood it correctly, the solution is possible by using add-ins, not standard EA scripts...right?
Can you please point me to the documentation for this event? I can't find it .

Thanks

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller

stanislav

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Automatic moving of elements
« Reply #4 on: January 03, 2012, 04:34:17 am »
Thank you  :)