How to Perform Model-to-Model Transformation?

Effectively perform complex transformations between models with the help of Visual Paradigm's Model Transformation support. This video takes the transformation from ArchiMate Diagarm to UML Use Case Diagram as example in showing how the transformation works.

Hi everyone, this is Jick Yeung from Visual Paradigm. In this video I'm going to demonstrate the model transformation feature by transforming an ArchiMate diagram into a UML use case diagram. Of course you can apply the same technique in transforming other kinds of diagrams. Before we go into the demonstration let's take a quick look at the transformation mechanism.

A transformation consists of two parts, or two steps. The first step is to define the transformation. Note that I'm using the word “Define”, not “Perform”. The definition of transformation determines the mapping between the source and target elements at schema level. The mapping is performed at schema level, not on a particular model elements. For example we define a transformation from an ArchiMate diagram to a use case diagram which involves mapping elements business actor to UML actor.

The second step is to perform the transformation by applying the definition on a diagram. So if you've defined the transformation that transform an ArchiMate diagram into a use case diagram, and with business actor mapped with UML actor, by applying a transformation on an ArchiMate diagram, use cases will be created automatically from the business actors on the ArchiMate diagram. So this is how model transformation works. Let's start the demonstration.

[Demonstration]

This is an ArchiMate diagram. In the diagram there is a business actor, a business role, some business functions assigned by a business actor and role, and two flow connectors connecting between several business functions.

Now, remember the first step is to define the transformation? I'm going to define the transformation with this ArchiMate diagram, because it contains all the elements I needed to perform the actual transformation.

To define a transformation, I right click on the diagram and select Utilities, Baggage Schema, and New Baggage Schema.

Alright, here is a new term – Baggage.

Baggage is an important concept in model transformation. A baggage holds the diagram elements needed in the transformation. You'll know more about the baggage in a minute.

I just give it a name first. In this case I name the baggage Business Function Assignments, and click OK to confirm.

Now you see some checkboxes placed over the shapes. What you need to do is to select the types of elements to be included as the source of transformation. For example if you want to transform a business actor into a UML actor, here you need a select business actor. If you want to transform a business function into a use case, you need to select business function here.

Ultimately I want to create a new use case diagram like this. I want to get the business actor and the role converted into a UML actor, and I want the business functions gets converted into use cases. I also want to convert the assignment connectors into associations, and to converts the flow connectors into Include

So we go back to this diagram. We need to select business actor, business function, assignments, business role, and this assignment.

This assignment is different from the one I selected before because the one I selected before is to connect between business actor and business function. This one connects between business role and business function.

And also the flow connector.

I don't need to select the other checkboxes because I'm defining the mapping, not performing. I just need to select the types of elements required to be included as the source elements in the transformation.

I finished defining a baggage for the ArchiMate diagram. I just close this first.

Because the definition involves transforming an ArchiMate diagram to a use case diagram, so I need to define a baggage for use case diagram. I just create a new dummy use case diagram for this purpose.

Draw an actor with an associated use case, and an included use case.

Define a baggage for this diagram. Name it Use Cases.

This time I select the type of elements to be include as the target of a transformation, so I select actor, use case, association and the include connector.

I go back to the ArchiMate diagram.

I have defined the two baggages. One for the ArchiMate diagram and another one for the use case diagram. The next step is to establish a mapping between these two baggages.

Right click on the ArchiMate diagram and select Utilities, Baggage Schema, Business Function Assignments.

This time I click on this button to define the transformation, which is to define the mapping between the two baggages.

Click this button to create a new transformation. I want to define a transformation that transform an ArchiMate diagram into use case diagram, so I select the targets diagram type, which is use case diagram here.

Here select the baggage I just created for the use case diagram.

I click OK.

Now on the left hand side you see the ArchiMate diagram, and on the right hand side you see the use case diagram. What I have to do now is to map the source elements in the ArchiMate diagram with the target elements in the use case diagram. I want to get the business actor converted into a UML actor. To do this, click on the checkbox next to business actor.

Click again on UML actor.

A mapping is established between these two. I want to get business function converted into UML use cases. Again I click on the checkbox next to business function. Click again on the check box next to use case to establish a mapping.

And don't forget the connectors.

Map assignments to UML association. Map business role to actor. Map the assignments that connects business role and business function to association.

We finally map the flow connector to include connector.

Save the setting. Return to the diagram.

Alright I've finished defining the transformation and now I can perform the transformation. To do this, open the Action Bar on the right of the diagram.

Click on this button. I want to transform the ArchiMate diagram to a new use case diagram, so I click Transform to a New Diagram.

You see a new use case diagram is created. The transformation from ArchiMate diagram to use case diagram is partially automated by executing the predefined transformation rules but of course I still need to touch up the targets model by tidying up the shapes and perhaps to add additional shapes. I do this now.

So this is the final diagram.

Because I've defined the transformation, I can apply it on any other ArchiMate diagrams, like this one.

So I just open the Action Bar.

Click on this button.

Apply the same transformation definition in creating a new use case diagram, like this.

This is how model transformation works. You may apply the same technique on any other diagrams.

This is the end of this video. If you want more information about model transformation please visit our website.

Good bye

Turn every software project into a successful one.

Try Visual Paradigm for Free! Or learn more about our features.

0 0 vote
Article Rating
guest
0 Comments
Inline Feedbacks
View all comments