Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: kaimeder on March 06, 2009, 08:03:17 pm

Title: .NET AddIn isComposite missing?
Post by: kaimeder on March 06, 2009, 08:03:17 pm
Hello,

using the newest .NET AddInn-dll, there is no IsComposite Property to check whether an object is Composite (Activity-composition of other Activities).
Is this unavailable? How can I check for composite-structures?

Thanks,
Kai
Title: Re: .NET AddIn isComposite missing?
Post by: Frank Horn on March 06, 2009, 08:18:13 pm
It's the Element.Subtype property which is = 8 for composite elements. In case of activities there are some more values (for loop, conditional a.s.o.), see also

http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1233666876/7#7
Title: Re: .NET AddIn isComposite missing?
Post by: kaimeder on March 06, 2009, 08:49:15 pm
Thanks alot!
Do you also know how to get a Composite's Target/Content/Composed Element?

Thanks,
Kai
Title: Re: .NET AddIn isComposite missing?
Post by: Frank Horn on March 06, 2009, 09:56:04 pm
I've never tried it, but EA.Element has collections like Connectors, Elements or EberddedElements which should contain the stuff within it (or below it, from a project browser point of view).
Title: Re: .NET AddIn isComposite missing?
Post by: kaimeder on March 06, 2009, 11:06:15 pm
the problem is though that such a hyperlinked/composite activity has in fact Elements.Count=0 etc... like in the project-browser, these elements have no sub-objects at all.
any hint how to get the hyperlink-target?
Thanks!
Kai
Title: Re: .NET AddIn isComposite missing?
Post by: Frank Horn on March 06, 2009, 11:23:04 pm
What is a hyperlinked activity? Or what do you mean by hyperlink-target? How do you create such a thing?
Title: Re: .NET AddIn isComposite missing?
Post by: «Midnight» on March 07, 2009, 12:45:18 am
Quote
It's the Element.Subtype property which is = 8 for composite elements. In case of activities there are some more values (for loop, conditional a.s.o.), see also

http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1233666876/7#7
Part of the problem - Frank alludes to this regarding Activities, but I am referring to the general case - is that the documentation for the SubType attribute is incomplete, and vague where it exists.

Regarding the value for Composite setting (=8) does mention it works for a composite Activity, then goes on to say it also works for for other elements "such as Use Cases." This is not really helpful when you want to figure out exactly what EA will accept, and what will happen in each case.

The documentation goes on to say that "there are many more Types [sic] than indicated in the above examples." Once again, not helpful.

Yes, I've reported this as a documentation bug. Thus far this one has not been dealt with (to the extent necessary). I think part of the problem is that the only 'real' information is in the source code, and predates recent efforts to update the EA docs.

Sigh...
Title: Re: .NET AddIn isComposite missing?
Post by: kaimeder on March 08, 2009, 02:50:28 am
If you take a Diagram, drag-n-drop, hyperlink, you've got an composite activity.
I need to get the activity's target (the original diagram) where it hyperlinks to!

@Midnight: yes, the documentation ist quite *useless* on certain topics.

Thanks,
Kai
Title: Re: .NET AddIn isComposite missing?
Post by: kaimeder on March 13, 2009, 10:16:54 pm
Hey Sparx, anyone,

any idea how to use the Automation-Interface to get Metainformation about Hyperlinked Diagram-Objects?

thanks in advance,
Kai
Title: Re: .NET AddIn isComposite missing?
Post by: Frank Horn on March 13, 2009, 10:48:58 pm
Quote
If you take a Diagram, drag-n-drop, hyperlink, you've got an composite activity.

I don't get a composite activity this way, but just a hyperlink on the diagram.
Title: Re: .NET AddIn isComposite missing?
Post by: kaimeder on March 13, 2009, 10:56:07 pm
OK, if you got a hyperlinked diagram-object.
Do you know any way to get the target-diagram where the object is linking to?
Thanks,
Kai
Title: Re: .NET AddIn isComposite missing?
Post by: Frank Horn on March 13, 2009, 11:35:43 pm
The hyperlink on the diagram should be represented in the API by an item within the Diagram.DiagramObjects collection. And this item should be of type EA.DiagramObject and have a DiagramID property carrying the ID of the target diagram.
Title: Re: .NET AddIn isComposite missing?
Post by: kaimeder on March 13, 2009, 11:46:40 pm
However the problem is DiagramObjects.Count == 0.
Should this work or is it actually working with the .NET Automation?

Thanks alot Frank!
Kai
Title: Re: .NET AddIn isComposite missing?
Post by: Frank Horn on March 14, 2009, 12:58:47 am
If you have a diagram containing a hyperlink, and you're sure that you're accessing this very diagram in your code, and DiagramObjects.Count == 0, then I'd say it's a bug which you should report via the official bug report link.
Title: Re: .NET AddIn isComposite missing?
Post by: kaimeder on March 14, 2009, 01:00:22 am
K, gotta report it...
thanks alot!