Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Content layer
id1099680388
Content column
id1099680390
Perform this task in the Quick Start perspective.


1. Creating a stereotype to customize a desired element

To create a stereotype that customizes UML Packages


  1. Create a Profile element.

  2. In the Profile element, create a Profile

    diagram

    Diagram.

  3. On

    In the Profile

    diagram palette, click the Stereotype button.

    Diagram, create a Stereotype element.

  4. Name the stereotype Numbered Package.

  5. 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.
  6. Select the Package metaclass and click OKclick Apply.
  7. Name the stereotype Numbered Package.

Stereotype for customizing UML packagesImage RemovedImage Added

Stereotype for customizing UML packages.
Content block
id1099680389

To create a numbering customization for an element

Table of Contents
maxLevel3
minLevel3
stylenone

Assume you need to number packages as shown:

Task for numbering packagesImage RemovedImage Added

Task for numbering packages.

There should be three numbering levels. The following table describes the rules for calculating package numbers in each level:

Numbering levelNumbering formatExamples
1st<number>“1”, “2”, “3”
2nd<number><separator><character>“1.A”, “1.B”, “2.A”, “2.B”
3rd<number><separator><character><separator><number>

“1.A.1”, “1.A.2”, “1.A.3”,
“2.B.1”, “2.B.2”

So we need to create a numbering scheme and use it in the numbering customization for for Package elements elements

Note
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


  1. Select the shape of the «Numbered Package» stereotype on the Profile diagram pane.
  2. Add a new stereotype attribute of the String type type attribute named No.

Property for storing package numbersImage 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


  1. On the Profile diagram palette, click the Class button.
  2. Click a free space on the diagram pane. A new Class shape appears.
  3. 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.

  4. Apply the «NumberingScheme» stereotype to the Class.
  5. Right-click the Class shape and select Stereotype in the shortcut menu. 
  6. Select the «NumberingScheme» stereotype and click Apply.

Image AddedScheme for numbering UML packagesImage Removed

Scheme for numbering UML packages.


To define a numbering style


  1. Open the Specification window of the newly created numbering scheme.
  2. 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).
  3. Click Close when  when you are done.

Numbering scheme with multilevel numbering style definedImage 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 partNumber part name
<number>Level 1
<separator>Dot 1
<character>Level 2
<separator>Dot 2
<number>Level 3


To create a number part


  1. Select the shape of Open the Specification window of the numbering scheme on the profile diagram pane.
  2. Add a new number part.
  3. .
  4. On the left side menu of the Specification window, select Number Parts and click Create. The Specification of Number Part properties window opens.

Image AddedCreating new number partImage Removed

Creating a new number part.


To specify a number part for the first numbering level


  1. Create a new number part named Level 1.Open the Specification window of the number part
  2. In the Specification of Number Part properties window, set the Name to Level 1.
  3. Click the Sequence property value specification cell and select Numeric in the values list. You must have numbers at on the first numbering level.
  4. Click the Initial Value property value cell and type the number 1 as its value. Numbering at the first level should start at at 1.
  5. Click Close when  when you are done.

Numbering scheme with number part defined for first numbering levelImage RemovedImage Added

Numbering scheme with number part defined for first numbering level.

To specify a number part for the first separator


  1. Create a new number part named Dot 1.Open the Specification window of the number part
  2. In the Specification of Number Part properties window, set the Name to Dot 1.
  3. Click the Sequence property value specification cell. Select Select Separator in  in the values list.
  4. 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.
  5. Click Close when  when you are done.


To specify a number part for the second numbering level


  1. Create a new number part named Level 2.Open the Specification window of the number part
  2. In the Specification of Number Part properties window, set the Name to Level 2.
  3. Click the Sequence property value specification cell. Select Character in the values list. You must have letters at the second numbering level.
  4. Click the Initial Value property value cell and type the letter letter A as  as its value. The numbering at the second level should start at A.

  5. Click Close when  when you are done.

Numbering scheme with number parts defined for second numbering levelImage RemovedImage Added

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 definedImage 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


  1. On the diagram palette, click the Customization button.
  2. Click a free space on the diagram pane. The new customization shape appears.
  3. Name the customization Numbered Package Customization.
  4. Open the Customization Specification window of the Customization.
  5. Click the Customization Target property. Select the Numbered Package stereotype the «Numbered Package» stereotype in the element Selection dialog and click OK.
  6. 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.

  7. Click Close when  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


  1. Select the shape of the customization.
  2. Add a new Auto Numbering Property named Package Numbering.
  3. Open the Specification window of the created attribute.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. Click Close when  when you are done.
  9. 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


  1. Open the appropriate package diagram.
  2. Create a package to apply the numbering scheme to.
  3. Name the package Organization.Apply
  4. Right-click the Organization package and select Stereotype in the shortcut menu.
  5. Select the «Numbered Package» stereotype and click Apply the Numbered Package stereotype to the Organization package.
  6. Right-click the shape of the package on the diagram pane. Click Symbol Properties.
  7. Set the Show Number Tag Name property value to false. The false indicates  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.
  8. 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.
  9. Set the Show Tagged Values property value to false. The false indicates that the tagged values will not be displayed on the package shape.
  10. 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 numbering customizationImage RemovedImage Added

Packages numbered using a numbering customization.
Content block
id1099680386

Related pages