app.project
.Noteall Javascript code examples can be executed in console (select Debug > Show DevTools and then click Console tab).
project.name
or project.ownedElements[0]
. Printing the element itself in console like console.log(project)
is helpful to get all information about the element.type
.UMLClass
type? To retrieve elements easily, StarUML provides a very simple select expression. Followings are several examples of select expression.N
(equivalent to value selector [name=N]
).Class1
: All elements named by "Class1".Class1::Attribute1
: All elements named by "Attribute1" only in the child elements of the element named by "Class1".P
.Package1::
: All child elements of the element named by "Package1".Package1::@UMLClass
: All elements of type "UMLClass" only in the child elements of the element named by "Package1".T
.@UMLInterface
: All elements of type "UMLInterface".@UMLClassifier
: All elements of type "UMLClassifier" (includes all descendant types: e.g. UMLClass, UMLInterface, UMLEnumeration, ...).Package1::@UMLClass
: All elements of type "UMLClass" only in the child elements of the element named by "Package1".F
.Class1.attributes
: All attribute elements contained in attributes
field of the "Class1" element(s).Package1.ownedElements
: All elements contained in ownedElements
field of the "Package1" element(s).@UMLClass.operations
: All operation elements contained in operations
field for all elements of type "UMLClass".F
has value V
.Class1.operations[isAbstract=false]
: All non-abstract (isAbstract=false
) operations of "Class1" element(s).Class1.attributes[isDerived=true]
: All derived (isDerived=true
) attributes of "Class1" element(s).