On this page
The Generic Numbering Mechanism consists of the Numbering Customization and Numbering Scheme, shown in the figure below.
The structure of the Generic Numbering Mechanism.
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 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.
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.
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.
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:
- Create a profile diagram.
- Create a stereotype to customize a desired element.
Add a new attribute to the stereotype.
This attribute will store the element number.
Create a customization element for the previously created stereotype.
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:
Where com.nomagic.magicdraw.autoid.LinkedDUCBinary is your binary class that implements INumberingAction.
For more information, see Custom elements numbering.