ATL modules can be called from MQL rulesets using the class ATLRunner
(once having enabled ATL capability).
We recommend that you install the MDWorbench ATL sample Using ATL in MDWorkbench: UML to Relational
package com.mycompany.example;
import com.sodius.mdw.core.atl.ATLRunner;
// expects a loaded UML 2.1 model as input
public ruleset UML2Relational(in umlModel : uml21, out relationalModel : relational) {
public rule main() {
// initializes ATL parameters
var asmPath = "com/sodius/mdw/samples/atl/uml2relational/UML2Relational.asm"; // ATL module path, relative to the working directory
var inModels = {"source"=umlModel}; // UML Model as input model
var outModels = {"target"=relationalModel}; // Relational Model as output model
// Evaluates the ATL module
AtlRunner.run(asmPath, inModels, outModels);
// Generates code from the Relational output model
$GenerateSQL(relationalModel);
}
}