Book a Demo

Author Topic: Addin for Composite Element  (Read 6053 times)

rahul

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Addin for Composite Element
« on: January 09, 2011, 10:30:28 am »
Hello,

I want to create an addin which will perform the following action.
When I drag and drop a Composite Element from Project Browser,and selecting "As instance of element",The Addin should make the element  "composite" and also copy the elements which are in it.

Can someone help in how to start it!!

Thanks in Advance,
Lokesh

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Addin for Composite Element
« Reply #1 on: January 10, 2011, 09:28:29 pm »
Some questions:
- What do you mean by "make it composite"? In EA that means that it will open a diagram when doubleclicked.
- What do you mean by "copy the elements in it" do yo want to make instances of each of the elements owned by the "Composite Element" and put those on the diagram, or just copy them in the projectbrowser or...

I would start to look at the available events from EA (onXxx) and see if any of those will work for you.

Geert

Steven

  • Guest
Re: Addin for Composite Element
« Reply #2 on: January 10, 2011, 11:58:54 pm »
I would say that it is really hard to understand what exactly you want to happen. Specify a more clearly set goal on what you want to achieve so we can start helping you.

rahul

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Addin for Composite Element
« Reply #3 on: January 13, 2011, 03:51:37 am »
Hello,

Here is my brief description of my question:
I have a Composite Element in a diagram page which have a  sequence diagram in it.
Now when I drag and drop this Composite Element into different  diagram page,and I select 'As Instance of Element',then the addin should make the Element as Composite( EA -> right click on an element --> Advanced --> Make Composite.) and should copy the Sequence Diagram which it contains in the previous diagram page.

TIA

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Addin for Composite Element
« Reply #4 on: January 13, 2011, 05:45:05 am »
As Geert suggested: start reading about EA_OnPostNewElement which is fired the moment you drag the element onto the diagram.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Addin for Composite Element
« Reply #5 on: January 13, 2011, 06:08:04 pm »
Lokesh,

Are you sure you want to copy the sequence diagram?
What happens when you modify the original? Are you going to update all copies of the diagram?

If what you are after is that the sequence diagram opens when you doubleclick on the instance, then you can do that with one and the same diagram.
Just link this single diagram as the composite diagram of all your instances.
Search this forum for "composite diagram", and you should find some detailed explanations on how to make an element composite and link it to a diagram. (or wait for v9 where (IIRC) it will be an exposed functionality of the API)

Geert