Use the Additional Content property to specify custom content for a desired element in addition to the standard one defined by the UML ownership. The custom content of an element is a collection of elements related to this element by some user-defined rule, such as some type of relationship.
To customize the content of a DSL element
The custom content of the element will then be visible in the following places:
Case Study
Let’s say we need UML Packages to display not only their owned elements, but also the elements related to the Packages by the Element Import relationship. In order to obtain this, we must specify the rule for gathering the custom content of the Package. Then we will analyze the contents of the customized Package in the Containment tree.
To specify the rule for gathering the custom content of the Package
|
When you are done, the shape of the PackageCustomization element should look like the one depicted in the following figure.
6. Reopen the project.
To see how the Additional Content property affects the contents of the Package
Now take a look at the Containment tree. The package P contains both owned classes A and B as well as the class C, which is not owned, but related to the package P by the Import Element relationship.