Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Paolo F Cantoni on August 20, 2005, 07:39:45 am
-
The Help system says (in part):
Package A Package object corresponds to a package element in the EA Project Browser. It is accessed either through the Repository Models collection (a Model is a special form of Package) or through the Package Packages collection. Note that a Package has an Element object as an attribute - this corresponds to an EA Package element in the t_object table and is used to associate additional information (such as scenarios and constraints) with the logical package. To set additional information for a package, reference the Element object directly.
Now by Model, I think the Help system is meaning the Project Root node on the Browser. Does that sound right?
The Model package doesn't appear to have a .Element attribute.
Can anyone else confirm that?
This would seem to be consistent with the fact that you can't open the Package Properties dialog for a Project Root, but you can for a View.
I have several repositories with multiple project roots, I think I should be able to add standard Element properties for my project roots. What do others think?
Cheerz,
Paolo
-
I think that the Root node should be a simple package. Its relative tree position identifies itself as a root. Maybe it could be helpfull to use the Advanced Property isRoot. Funny thing, that you can't change this Property since it's greyed out (for which reason?).
I guess that the limitation has been introduced some time ago, since I know that former versions of EA allowed elements at root level (pre 4.0?).
-
I think that the Root node should be a simple package. Its relative tree position identifies itself as a root. Maybe it could be helpful to use the Advanced Property isRoot. Funny thing, that you can't change this Property since it's greyed out (for which reason?).
I guess that the limitation has been introduced some time ago, since I know that former versions of EA allowed elements at root level (pre 4.0?).
Unfortunately, Thomas, IsRoot is not available on the Automation Interface, neither for the EA.Package nor EA.Element classes.
I can't get a clear indication how to check if a package is a Project Root, View or normal Package via the interface.
I've got something working at present, but I'm pretty sure it's by accident rather than by design... :(
Paolo
-
... IsRoot is not available ...
That's why it's greyed out in the properties. Question to Sparx: Any reason for that?
-
I thought a model (as in "isModel") was a stereotyped package that had nothing to do with the root package. Think about a repository that has several "complete things" in it. Each of these could/would be contained in a separate <<model>>package, maybe using separate root nodes, maybe not. IOW, a repository root and a UML "model" need not be the same thing. (I cannot get this para right - hope its understandable)
The advanced property isRoot is to do with inheritance, not project positioning. As in "isRoot" does not/can not inherit from anything vv an "isLeaf" element cannot be a parent.
Why is the root package not a normal package? Dunno. Also, I cant see why not.
bruce