Right-click the stereotype shape and select Metaclass in the shortcut menuClick a free space on the diagram pane. A new stereotype shape appears and the Select Metaclass dialog opens.
Select the Package metaclass and click OKclick Apply.
Name the stereotype Numbered Package.
Image RemovedImage Added
Stereotype for customizing UML packages.
Info
Make the «Numbered Package» stereotype invisible if you want the stereotype and its properties to be hidden in a diagram.
2. Adding a new attribute for storing numbers
To add a new attribute for storing package numbers to the «Numbered Package» stereotype
Select the shape of the «Numbered Package» stereotype on the Profile diagram pane.
Add a new stereotype attribute of the String type type attribute named No.
Image RemovedImage Added
Property for storing package numbers.
3. Creating a numbering scheme to define a numbering style and number parts
To create a numbering scheme
On the Profile diagram palette, click the Class button.
Click a free space on the diagram pane. A new Class shape appears.
Name the Class Package Numbering Scheme.
Note
The name of the numbering scheme will be displayed in the Element Numbering dialog. We recommend giving it a short and meaningful name.
Apply the «NumberingScheme» stereotype to the Class.
Right-click the Class shape and select Stereotype in the shortcut menu.
Select the «NumberingScheme» stereotype and click Apply.
Click the Numbering Style value cell to open the list of available numbering styles. Select the Multi-level numbering style in this list. Use the Multi-level numbering style (remember: you You must have three numbering levels for numbering to number packages).
Click Closewhen when you are done.
Image RemovedImage Added
Numbering scheme with multilevel numbering style defined.
Anchor
create_number_part
create_number_part
The following table shows number parts that should be used to create the numbering formats described in the preceding tablethe proceeding procedures.
Number part
Number part name
<number>
Level 1
<separator>
Dot 1
<character>
Level 2
<separator>
Dot 2
<number>
Level 3
To create a number part
Select the shape of Open the Specification window of the numbering schemeon the profile diagram pane.
Add a new number part.
.
On the left side menu of the Specification window, select Number Parts and click Create. The Specification of Number Part properties window opens.
Image AddedImage Removed
Creating a new number part.
To specify a number part for the first numbering level
In the Specification of Number Part properties window, set the Name to Dot 1.
Click the Sequence property value specification cell. Select Select Separatorin in the values list.
Click the Initial Value property value cell and type the character the . character (a dot) as its value. The separator between the first and the second numbering level should be a dot.
Click Closewhen when you are done.
To specify a number part for the second numbering level
In the Specification of Number Part properties window, set the Name to Level 2.
Click the Sequence property value specification cell. Select Character in the values list. You must have letters at the second numbering level.
Click the Initial Value property value cell and type the letter letter Aas as its value. The numbering at the second level should start at A.
Click Closewhen when you are done.
Image RemovedImage Added
Numbering scheme with number parts defined for the second numbering level.
The rest of the number parts are created accordingly.
Image RemovedImage Added
Numbering scheme with all number parts defined.
Note
As there are no number parts specified for the fourth (and beyond) numbering levels, packages will be numbered using the number parts of the third numbering level. For example, “1.A.1.1”, “1.B.1.2”, and so forth.
4. Creating a customization element for the stereotype that customizes the desired element
In order to use the scheme for numbering packages, you must define it in the numbering customization for package elements. First, create a customization element.
To create a customization element for the “Numbered Package” stereotype«Numbered Package» stereotype
On the diagram palette, click the Customization button.
Click a free space on the diagram pane. The new customization shape appears.
Name the customization Numbered Package Customization.
Click the Customization Target property. Select the Numbered Package stereotype the «Numbered Package» stereotype in the element Selection dialog and click OK.
Set the Show Properties When Not Applied property to true. All properties of the Numbered Package stereotype the «Numbered Package» stereotype will be visible as properties of the Package metaclass, even if the stereotype is not yet applied.
Click Closewhen when you are done.
Image RemovedImage Added
Customization element for the
“Numbered Package” stereotype
«Numbered Package» stereotype.
5. Add a numbering attribute to the customization element
After creating the customization for the Numbered Package stereotypethe «Numbered Package» stereotype, specify the stereotype attribute for storing element numbers as well as defining a numbering scheme to use. For this, you must create a numbering attribute.
To add a numbering attribute to the customization element of the Numbered Package stereotypethe «Numbered Package» stereotype
Select the shape of the customization.
Add a new Auto Numbering Property named Package Numbering.
Specify a value for the Numbered Property property. Click the property value cell and then click the ... button. In the element Selection dialog, select the No. property of the Numbered Package stereotype the «Numbered Package» stereotype and click OK.
Specify a value for the Numbering Scheme property. Click the value cell and either:
Select the Package Numbering Scheme class in the opened list.
Click the ... button. In the element Selection dialog, select the Package Numbering Scheme class and click OK.
Change the Default Number property value to true. The true value indicates that this numbering attribute will be set as the default when numbering instances of the customized Package metaclass.
Specify the Use Prefix On Owner attribute value. The true value indicates that the element prefix will be used for its numbered owner as well.
Click Closewhen when you are done.
Save and reopen the project to apply the created numbering customization.
Image RemovedImage Added
Numbering attribute in the customization element of the
“Numbered Package” stereotype
«Numbered Package» stereotype.
6. Changing the number display mode
To see the number before the element name, you must change the number display mode.
To change the number display mode on packages
Open the appropriate package diagram.
Create a package to apply the numbering scheme to.
Name the package Organization.Apply
Right-click the Organization package and select Stereotype in the shortcut menu.
Select the «Numbered Package» stereotype and click Apply the Numbered Package stereotype to the Organization package.
Right-click the shape of the package on the diagram pane. Click Symbol Properties.
Set the Show Number Tag Name property value to false. The falseindicates indicates that the element number tag name (the No property of the Numbered Package «Numbered Package» stereotype) will not be displayed on the package shape.
Click the Element Number Display Mode value cell to open the list of available modes. Select the Before the element name mode in this list.
Set the Show Tagged Values property value to false. The false indicates that the tagged values will not be displayed on the package shape.
Click the Show Stereotypes value cell to open the list of available modes. Select the Do Not Display mode in this list if you don't want the «Numbered Package» stereotype to be displayed on the packages.
7. Reopen the project to apply changes
Open the appropriate package diagram and see the packages numbered using the newly created numbering customization.
Image RemovedImage Added
Packages numbered using a numbering customization.