Click the Numbering Style value cell to open the list of available numbering styles. Select the Multi-level numbering style in this list. You must have three numbering levels to number packages.
Click Close when you are done.
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 in the proceeding procedures.
In the Specification of Number Part properties window, set the Name to Dot 1.
Click the Sequence property value specification cell. Select Separator in the values list.
Click the Initial Value property value cell and type the . character (a dot) as its value. The separator between the first and the second numbering level should be a dot.
Click Close 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 A as its value. The numbering at the second level should start at A.
Click Close when you are done.
Numbering scheme with number parts defined for the second numbering level.
The rest of the number parts are created accordingly.
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
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 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 will be visible as properties of the Package metaclass, even if the stereotype is not yet applied.
Click Close when you are done.
Customization element for the «Numbered Package» stereotype.
5. Add a numbering attribute to the customization element
After creating the customization for the «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» 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 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 Close when you are done.
Save and reopen the project to apply the created numbering customization.
Numbering attribute in the customization element of the «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.
Right-click the Organization package and select Stereotype in the shortcut menu.
Select the «Numbered Package» stereotype and click Apply.
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 false indicates that the element number tag name (the No property of the «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.
Packages numbered using a numbering customization.