On this page


The Generic Numbering Mechanism consists of the Numbering Customization and Numbering Scheme, shown in the figure below.

Generic Numbering Mechanism structure

The structure of the Generic Numbering Mechanism.

Create numbering schemes (formats) and apply them to DSL elements in the modeling tool or plugin (SysML, Cameo Business Modeler, or UAF plugin).

You can create one or more numbering schemes for the same DSL element. You can also apply the same numbering scheme to several DSL elements. In this case, instances of different DSL elements will be numbered in sequence. For example, if you use the same numbering customization for both actors and use cases, all actors and use cases in a use case diagram will be numbered in sequence. Another example of numbering different DSL elements in sequence is shown in the figure below. The start events, end events, tasks, and gateways in the BPMN Process diagram are numbered using the same numbering scheme.

Numbering instances of different BPMN elements in sequence

Numbering instances of different BPMN elements in a sequence

Find the instructions to customize the generic numbering mechanism to create your own numbering scheme in Creating your first numbering customization. Create your own numbering customization defining specific numbering properties using expressions.


Basic concepts

ConceptDescription

Numbering scheme

Defines a numbering style as well as number parts used to compose a DSL element number. A numbering schema can have one or more number parts. A numbering scheme is represented as a class with the «NumberingScheme» stereotype applied.

Number part

Represents a rule for calculating an individual part of the whole element number, as the element number is composed of one or more individual number parts. It can be a number, character, separator, or other. Number part is represented as a numbering scheme property with the «NumberPart» stereotype applied.

Numbering property

Indicates a DSL element property to store the element number  and defines a numbering scheme used for the DSL element numbering. The numbering property is represented as a customization element property with the «AutoNumber» stereotype applied.




Basic steps for creating numbering customization

To create a numbering customization for an element:

  1. Create a profile diagram.
  2. Create a stereotype to customize a desired element.
  3. Add a new attribute to the stereotype.

    This attribute will store the element number.

  4. Create a numbering scheme to define a numbering style and number parts.

  5. Create a customization element for the previously created stereotype.

  6. Add a numbering attribute to the customization element. Reopen the project to apply changes.


Specifying custom numbering properties

To define your own specific numbering customization, you need to define an expression. For general numbering it is a binary script. The following script example illustrates the multi-level numbering:

binary;Binary;com.nomagic.magicdraw.autoid.LinkedDUCBinary;


Where com.nomagic.magicdraw.autoid.LinkedDUCBinary is your binary class that implements INumberingAction.

For more information, see Custom elements numbering.