When do You Convert a Model Element Type?
UML supports a rich set of notation. You can always find the best notation for thorough expression. When the type of an element is no longer appropriate or is not the best type to express an idea, you will want to replace it with a better notation. Here are some of the situations when type conversion is needed.
Design Evolvement
Take BPMN as an example. Task and sub-process are two notations introduced by BPMN. They both model activities to do within a business process. If you need to model an order processing system with BPMN, you may initially use a BPMN task to model the Ship Order activity. As the design evolves, let's just say that shipping order turns out to be much more complex than you thought and involves several sub-activities like arranging shipment, delivering goods, collecting payment, etc. To depict that, you need to convert the atomic task to a sub-process, not only for representing its complex nature but also for making it possible to drill down the process and model its details.
Correcting Mistakes
Things are never perfect and so are our work. Sometimes your knowledge in modeling language falls short. You may mistakenly apply a wrong type of model element in your design. For example, you could have incorrectly treated UML activity as UML action. When you realize it is a mistake, you want to correct it.
Describe More Precisely What You Want to Express
Some notations are sub-types of a more general one. For example, send-signal-action is a kind of UML action that creates a signal from its input and transmits it to the next object. While using UML action in a broad manner is not exactly wrong, using send-signal-action would reflect the truth more precisely.
Convert Action to Send-Signal-Action
In this tutorial, we will try to convert several general UML actions in an activity to send signal actions. Take a look at the diagram below. An order is created initially. Then, a shipment request is sent to the warehouse. After that, an invoice is created and sent to the customer. As signals are sent by the Fill Order Request and Notify Customer actions, we will convert them to send-signal-action.
Create a UML activity diagram. Draw the diagram below and get ready for the tutorial.
- Select Window > Application Options... from the application toolbar.
- The convert-type function is an advanced feature that can only be accessed when running in Advanced UI mode. Select General from the list on the left hand side.
- Under the Environment page, check Advanced UI mode.
- Click OK.
- Save your project and restart Visual Paradigm.
- Right-click on the Fill Order Request action and select Related Elements > Change Type... from the popup menu.
- In the Change Model Element Type dialog box, enter Send Signal Action for the type to convert to.
- Click Next.
- Due to the difference in the element type, some properties, relationships and tagged values may no longer be compatible after the conversion and are forced to be discarded. In the Change Model Element Type window, you will find the properties, relationships and tagged values that will be kept and discarded after the conversion. The data that will be discarded is put on the left hand side while the resolvable data is on the right.
- Click OK at bottom right. Note that the undo history will be cleared after the conversion, meaning that you cannot perform any undo action after it. This is the updated diagram:
- Convert Notify Customer from UML action to send-signal-action. Finally, the diagram should look like this: