Model Transformation: UML to Relational
Overview
This sample transforms a UML model into a Relational model,
and then generates SQL table creation scripts.
Launch configuration
|
Ruleset |
com.sodius.mdw.samples.relational.TransformAndGenerate |
Rule |
main |
Arguments |
a UML input model (e.g. models/product13.xmi )
|
|
Here is an example of a UML transformation launch:

Features demonstrated
Feature |
Example |
Location |
Reference |
Calling an external rule |
@UML2Relational(source, target).main() |
TransformAndGenerate.mqr |
rule call |
Calling a text template from a rule |
$GenerateSQL(target) |
TransformAndGenerate.mqr |
template call |
Creating an instance |
target.create("Table") |
UML2Relational.mqr |
Model APIs |
Using subrules |
rule createTable::createColumnAttribute() |
UML2Relational.mqr |
rule |
Using transient links |
dataType#coref.add(type) |
UML2Relational.mqr |
transient links |
Specifying a default value |
sqlType = column.type.name ? "VARCHAR(255)" |
GenerateSQL.tgt |
default value |