Skip to content

MWE2 based plain Java application

lunkpeter edited this page Dec 22, 2015 · 5 revisions

MWE2-based plain Java application

Model transformation chains can be defined using a specialized description language. This approach has a number of benefits compared to the regular approaches:

*The sequence of model transformation steps can be easily specified and maintained.

  • Nontrivial side-effect relations between transformation steps can be handled.
  • The execution of event-driven transformations can be explicitly controlled.
  • Because of the specialized language, the description code base is short and easily expandable.

Generic modeling workflows can be easily described via using the Xtext Modeling Workflow Engine. It enables the creation of components with various attributes, and it executes them in order. More, exact information about the Xtext MWE 2 can be found here.

Implementing Transformation chains using MWE 2 workflows

The VIATRA transformation framework supports the definition of model transformation steps using MWE2 workflows.

EMDW-MC toolchain

Plain Java App usage and constraints

The plain Java app is a Java console application capable of executing the EMDW-MC workflow on a specified input model. It is contained in an executable .jar file that is available for download in this folder. The application has the following input parameters:

Parameter Mandatory
Source UML model direct location Yes
Output folder location Yes
MWE2 workflow file location Optional

As it can be seen on the table above, the application has three main input parameters. The first two are the exact location of the source UML model and the output directory (The generated code will be copied here). The application allows the insertion of a custom MWE2 workflow file. Its location can be specified via using the third parameter. If the MWE2 workflow is not specified, the application will use the one contained in the executable jar file.

An example for accessing the EMDW-MC MWE2-based Java application:

java -jar com.incquerylabs.emdw.toolchain.mwe2integration.plainjava-1.0.0-SNAPSHOT.jar "D:/user/eatf.uml" "D:/user/target"

The running application: [SHOT]

Pitfalls, usage constraints:

  • always use full location path strings while specifying the input model and output folder. Incorrect location string definition can cause major errors and lead to cryptic error messages. (missing resource factories, etc...)

[errorscrshot]

  • Use forward slashes in location strings

Clone this wiki locally