How do I create a meta model for a model-to-model transformation?

uml
modeling

#1

Hey there.

I’d like to do a model-to-model transformation. The target model would be UML activity diagrams, the source model is a rather obscure model and I’d have to create a meta model first. Both models are quite similar, so I’m sure that there shouldn’t be any huge problems.

However, I was wondering if Visual Paradigm is the right tool for me? Here is what I’d like to do: Provide an input diagram (in the form of a JSON or XML file) and generate an UML activity diagram based on that input. Is that something I can do in VP? If yes, how would I create my meta model for the source model?

Thanks in advance


#2

You may use XML Importer + Transformation to import your data + convert them to be an Activity diagram.
(But we just find a bug when prepare the following sample, and the bug is just fixed, the patch may be available in few days.)

How to do it:

— Preparation —

  1. Prepares an XML to import your data to be VP’s GenericModel and GenericConnector.

  2. Creates a DataTable to define your model type, properties.
    And define the transformation schema of your model types.

  3. Creates a dummy Activity Diagram to define the transformation schema of activity diagram.

  4. Connects your 2 transformation schema.

— Operation —

  1. Imports XML to create your meta-model into VP.
  2. Performs transformation from your DataTable to an ActivityDiagram

How to do it (with image description):

— Preparation —

  1. Prepares an XML to import your data to be VP’s GenericModel and GenericConnector.

  2. Creates a DataTable to define your model type, properties.


    And define the transformation schema of your model types.

    (you can click the top-right X button to close the transform schema editing)

  3. Creates a dummy Activity Diagram to define the transformation schema of activity diagram.


    (you can click the top-right X button to close the transform schema editing)

  4. Connects your 2 transformation schema.

— Operation —

  1. Imports XML to create your meta-model into VP.

  2. Performs transformation from your DataTable to an ActivityDiagram


PS:
Sorry, the above solution is quite complex.
(In fact, I never try to use DataTable to define a ‘relationship’. At least, on this solution, I haven’t try to define the generic connector is connected between which model types. And I am not sure can it be defined in the Data Table…)

On another hand, there is a simply solution that, you prepare an XML to specify the Action, ControlFlow, etc… directly.
In this solution, you don’t need to learn how to use the transformation schema. But you need to learn more details on the XML content of Activity Diagram & its model elements.


#3

Peter this is fascinating! Is there a predefined Metamodel for DoDAF? If UAF from OMG would be nice as well.

Or a little tutorial on how to create my own…


#4

Hi jghass,

Sorry that there is no predefined metamodel for DoDAF or UAF right now.

Best regards,
Jick Yeung


#5

Peter, thank you so much. This is amazing, your effort is much appreciated. I’d have never expected such a detailed answer, this helps me A LOT. Thank you!!


#6

Hello everyone, I have a follow-up question:

The source model uses “sub processes” (those would be “Activity” in an activity diagram) and “activities” (I’ll call them activitiesSRC in order to prevent confusion). Those activitiesSRC are used to clarify what is happening in a sub process, so they are kind of like actions in an activity diagram (I hope you can follow me…).

So what I’ll have to do for the transformation is: IF activitiesSRC are used to define a sub process, transform that sub process into a structured activity node. then, place the activtiesSRC inside the structured activity node as actions. Otherweise, the sub processes will be transformed into actions.

Is it possible to use these kind of If-else statements in VP?

Once again, I’m very thankful for your help, Peter. I tried a few things today in order to figure it out but I wasn’t really successful so far.

best regards


#7

Hi, Yannic, do you mean?

if a ActivitiesSRC.isSubProcess
   generate a StructuredActivityNode + an Action
else
   generate an Action

if yes, you may try the following solution.

But sorry about that, I found a bug when I prepare the follow demo. It is just fixed and you can try it in coming patch. (I may post here if it is released, or it may be ready within these few days.)

How to do it
Same as the above --Preparation-- steps.

  1. Creates a DataTable, to define your model type ActivitiesSRC with isSubProcess & self-relationship properties.
    the self-relationship is used to define a dummy self-relationship in a Sub-Process ActivitiesSRC.

  2. Prepares the XML to import your ActivitiesSRC
    If they are SubProcess, specifies a isSubProcess tagged value in the ActivitiesSRC,
    and specifies a <GenericRefValue> to create a self-relationship
    The following sample contains SubProcess: A, B C, and simple action: D, E, F, G


    Sample attached: project.xml (2.5 KB)

  3. Creates a dummy Activity Diagram to define the transformation schema of Activity Diagram. And define the transformation of ActivitiesSRC in the DataTable.

  4. Connects the schema

— Operation —
Import your XML to create your ActivitiesSRC(s)

and transform them to Activity Diagram.

The BUG I mentioned at the beginning of this post: