Author Topic: How to "Make Composite"  (Read 5922 times)

André Olivera

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
How to "Make Composite"
« on: April 22, 2011, 02:51:41 am »
Hi!

Does someone know a way to do an "Make Composite" action in one element?

I found a property of Element ("CompositeDiagram") but it is to get the composite diagram if the element is composite.

I want to know how to turn the element composite, and create this diagram.

Thanks!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13378
  • Karma: +563/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to "Make Composite"
« Reply #1 on: April 22, 2011, 03:49:50 am »
André,

There's a whole lot of posts about how to make an element composite on this forum. A search for "composite" should already reveal most posts.
I remember it includes some messing about in the database as this function was not exposed by the API.
IIRC they added that in v9.

Geert

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: How to "Make Composite"
« Reply #2 on: April 27, 2011, 09:02:09 am »
An IsComposite attribute has been added to the EA.Element class in Enterprise Architect 9.  To set an element as composite, simply set IsComposite = True.

For more information on the EA 9 beta, please see:
http://www.sparxsystems.com/products/betas.html

HTH.

André Olivera

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: How to "Make Composite"
« Reply #3 on: April 28, 2011, 06:40:47 pm »
Thanks Geert and Aaron..

Geert:

I found two topics interestings for me in the search:
With this: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1301601786

I understand that I can put a diagram inside the element and after click in the button "create composite" and it will work.

And this: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1302080632

is more similar with what I want to do, but I didnt test yet if works. According the topic I have to create a diagram with the type "CompositeStructure" inside the element.


Aaron:

I think that this solution (create a diagram inside the element) wont turn the element composite. For me it is not a big problem I think. I think that with this attribute it will work fine.

For now I cannot change my version of EA. But I will try make this after.

Thanks a lot!

André.

André Olivera

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: How to "Make Composite"
« Reply #4 on: April 28, 2011, 07:55:24 pm »
I tested..

I created a diagram with type "CompositeStructure".

The element didnt change to composite then Im not able to go to the diagram with double-click.

I turn the element into comsposite (Advanced -> Make Composite) then the created diagram is accessed by double-click.

Im almost sure that in version 9, if I change this property by code I can access with double-click.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13378
  • Karma: +563/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to "Make Composite"
« Reply #5 on: April 28, 2011, 08:45:52 pm »
The topic I was referring to was this one:
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1217982429/0
this explains how to make an element composite using the API in EA 8.
I haven't tested the functionality in v9 yet.

Geert

André Olivera

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: How to "Make Composite"
« Reply #6 on: April 28, 2011, 10:27:00 pm »
Great!

According the topic I can change some fields in the database (.EAP) to turn the element composite.

I will try to use the method "Repository.SQLQuery (string SQL)" to do this.

I dont know why my search didnt return this topic. Now I am having a lot of problems with the search in the forum.

Thanks a lot!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13378
  • Karma: +563/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to "Make Composite"
« Reply #7 on: April 28, 2011, 10:37:36 pm »
André,

Repository.SQLQuery won't work if you are trying to update something.
You'll have to use Repository.Execute(SQLString). (undocumented backdoor operation  :o)

Geert

André Olivera

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: How to "Make Composite"
« Reply #8 on: April 29, 2011, 07:46:43 am »
hehe great..

I read this in the other topic but I thought that they were talking about this function (SQLQuer())..

really crazy this function without anyone documentation.. but is ok!

thank you!