com.sodius.mdw.core.atl
Class ATLRunner

java.lang.Object
  extended by com.sodius.mdw.internal.core.atl.AbstractATLRunner
      extended by com.sodius.mdw.core.atl.ATLRunner

public class ATLRunner
extends com.sodius.mdw.internal.core.atl.AbstractATLRunner

Enables launching of an ATL transformation from MDWorkbench.

Here is an example of how ATLRunner can be used from MQL Code:

 // initializes required ATL parameters
 var atlModulePath = "com/samples/UML2Relational.asm"; // module path
 var inModels = {"source" = umlModel}; // input model     
 var outModels = {"target" = relationalModel}; // output model
 
 // launches the evaluation of ATL module
 ATLRunner.run(atlModulePath, inModels, outModels);
 

Since:
MDWorkbench 3.0.0

Constructor Summary
ATLRunner(String asmModulePath, Map inModels, Map outModels)
          Creates a new instance of an ATL runner.
ATLRunner(URL asmModuleURL, Map inModels, Map outModels)
          Creates a new instance of an ATL runner.
 
Method Summary
 void addLibrary(String libraryId, String path)
          Registers an ATL library.
 void addLibrary(String libraryId, URL url)
          Registers an ATL library.
 void run(com.sodius.mdw.core.util.log.Logger logger, com.sodius.mdw.core.util.progress.ProgressMonitor monitor)
          Launches the evaluation of the ATL module.
static void run(String asmModulePath, Map inModels, Map outModels)
          Launches an evaluation of an ATL module from MDWorkbench.
static void run(String asmModulePath, Map inModels, Map outModels, Map asmLibraryPaths)
          Launches an evaluation of an ATL module from MDWorkbench.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ATLRunner

public ATLRunner(String asmModulePath,
                 Map inModels,
                 Map outModels)
Creates a new instance of an ATL runner.

The module path is a '/'-separated path, resolved to an URL using the method getResource(name) on the thread context class loader.

The models maps are used to identify the input and output models to be used in the ATL module. The key is a String which identifies the corresponding module parameter. The value is an instance of com.sodius.mdw.model.Model.

Parameters:
asmModulePath - the path of the asm module to be launched.
inModels - the map of the input MDWorkbench model instances.
outModels - the map of the output MDWorkbench model instances.

ATLRunner

public ATLRunner(URL asmModuleURL,
                 Map inModels,
                 Map outModels)
Creates a new instance of an ATL runner.

The models maps are used to identify the input and output models to be used in the ATL module. The key is a String which identifies the corresponding module parameter. The value is an instance of com.sodius.mdw.model.Model.

Parameters:
asmModuleURL - the URL of the asm module to be launched.
inModels - the map of the input MDWorkbench model instances.
outModels - the map of the output MDWorkbench model instances.
Method Detail

addLibrary

public void addLibrary(String libraryId,
                       String path)
Registers an ATL library.

Parameters:
libraryId - identifier of the corresponding library parameter
path - a '/'-separated path, resolved to an URL using the method getResource(name) on the thread context class loader.

addLibrary

public void addLibrary(String libraryId,
                       URL url)
Registers an ATL library.

Overrides:
addLibrary in class com.sodius.mdw.internal.core.atl.AbstractATLRunner
Parameters:
libraryId - identifier of the corresponding library parameter
url - the URL of the library.

run

public void run(com.sodius.mdw.core.util.log.Logger logger,
                com.sodius.mdw.core.util.progress.ProgressMonitor monitor)
         throws com.sodius.mdw.core.CoreException
Launches the evaluation of the ATL module.

Overrides:
run in class com.sodius.mdw.internal.core.atl.AbstractATLRunner
Parameters:
logger - the logger used to report errors and warnings, as well as debugging information (can be null)
monitor - the progress monitor used to report progress information (can be null)
Throws:
com.sodius.mdw.core.CoreException - if this evaluation fails

run

public static void run(String asmModulePath,
                       Map inModels,
                       Map outModels)
                throws com.sodius.mdw.core.CoreException
Launches an evaluation of an ATL module from MDWorkbench.

The module path is a '/'-separated path, resolved to an URL using the method getResource(name) on the thread context class loader.

The models maps are used to identify the input and output models to be used in the ATL module. The key is a String which identifies the corresponding module parameter. The value is an instance of com.sodius.mdw.model.Model.

Parameters:
asmModulePath - the path of the asm module to be launched.
inModels - the map of the input MDWorkbench model instances.
outModels - the map of the output MDWorkbench model instances.
Throws:
com.sodius.mdw.core.CoreException - if this evaluation fails

run

public static void run(String asmModulePath,
                       Map inModels,
                       Map outModels,
                       Map asmLibraryPaths)
                throws com.sodius.mdw.core.CoreException
Launches an evaluation of an ATL module from MDWorkbench.

The module path is a '/'-separated path, resolved to an URL using the method getResource(name) on the thread context class loader.

The models maps are used to identify the input and output models to be used in the ATL module. The key is a String which identifies the corresponding module parameter. The value is an instance of com.sodius.mdw.model.Model.

The keys or the map libraries must be String values that identifies the corresponding library parameters. The values must either be URL or String paths.

Parameters:
asmModulePath - the path of the asm module to be launched.
inModels - the map of the input MDWorkbench model instances.
outModels - the map of the output MDWorkbench model instances.
asmLibraryPaths - the map of asm library paths (either String or URL values)
Throws:
com.sodius.mdw.core.CoreException - if this evaluation fails