The UML extension mechanisms enable you to customize and extend the UML semantics, making the language more suitable for specific problem domain. You can create new model element types by creating stereotypes, which derive from existing UML types. You can add and define domain specific properties for both new and existing UML types using tags. The values of tags are known as tagged values.
Visual Paradigm supports profile, stereotype and tagged values. The focus of this tutorial will be on tagged values. You will see how to add and define tags to a UML model element type, readily to be used by the modeler. You will also see how to enter the values during modeling, and how to visualize the tagged values on diagram. We will draw a UML activity diagram for an order processing system to demonstrate the use of default tagged value.
Defining Default Tagged Values
- Create a new project by selecting Project > New from the application toolbar. In the New Project window, enter Order Processing as project name and click Create Blank Project.
- Select Window > Configuration > Configure Default Tagged Values... from the application toolbar. This shows the Configure Default Tagged Values window.
- The left hand side lists out the notations defined primitively by UML, BPMN and other modeling languages supported by Visual Paradigm. You can add your own properties to a supported type of notations by selecting the type and by adding the default tagged values. Let's try with a UML action. At the top left corner of the Configure Default Tagged Values window, enter Action as search text.
- Select Action from the list.
-
Now, you can add your own properties to UML action by adding tags. When you create actions later on you can enter the value of tags created here. Let's say we want to associate each UML action with a Web Form. Add a tag Form-ID that acts as a reference to the corresponding Web Form. Click Add at bottom right and select Text from the popup menu.
Besides text tag, you can add other kinds of tags like the model element tag that allows specifying a reference of model element as value and boolean tag that allows specifying either true or false as value, etc. - Enter Form-ID as tag name.
- Let's say our ID has FRM- as prefix. We can specify it as the default value of tag so that when you create actions you do not need to enter FRM- over and over.
- Click OK to confirm the changes.
Entering Tagged Values
Create an activity with actions. Enter the form ID for each of the created action.
- Create an activity diagram Order Processing.
- Draw a diagram that looks like this:
- Supply the form ID associated with each action. Let's do this one by one. Right-click on the Login action and select Open Specification... from the popup menu.
- Open the Tagged Values page.
- Enter the form ID for the Login action: FRM-01.
- Click OK to confirm.
-
Set the form ID for the remaining actions:
Action Form ID Create Order FRM-02 Enter Payment Details FRM-02 Confirm Order FRM-03
Showing Tagged Values on Diagram
You can optionally show the tagged values on the action shapes in diagram. Right-click on the diagram background and select Presentation Options > Show Tagged Values > Show All from the popup menu. Resize the shape. The diagram should look like this: