In addition to provisioning one model from another model via ModelPro (templates):
· Eclipse tools provide specific model-to-model conversions. These tools may be natively provided as ant tasks or UI actions. Many of the conversions which are natively accessible only via UI have been wrapped by ModelPro ant tasks.
· Eclipse tools include generic model-to-model transformations, such as ATL. When above tools for specific model-to-model conversions do not satisfy the transformation requirement, the Eclipse model-to-model tools should be reviewed for applicability.
· Some conversions may be more easily expressed using ModelPro XSLT. This is particularly effective when the source and target meta-models are the same or very similar, since the XLST templates need be defined only for the stepwise refinement required.
Eclipse tool-based model conversions are enumerated in the following sections. These are all made available as ant tasks to facilitate use in automated multiple-stage provisioning processes. Where possible, original eclipse ant tasks are used for conversions. In other cases, underlying conversion capabilities available via eclipse UI have been wrapped as ant tasks.
Converts an ecore model to:
· ?.genmodel (generation model) used for subsequent java code generation.
· (optional) Java code for the model, including both interfaces and ecore implementation.
· (optional) java code for “edit” implementation.
· (optional) java code for “editor” implementation.
· (optional) variant of above for SDO target.
General form of task command:
<emf.Ecore2Java
model="${basedir}/wsdl/Calculator.ecore"
genModel="${basedir}/wsdl/Calculator.genmodel"
reconcileGenModel="overwrite"
generateJavaCode="false"
generateModelProject="false"
generateEditProject="false"
generateEditorProject="false"
modelProject="org.modeldriven.modelpro.soapro.example"
modelProjectFragmentPath="src" modelPluginID="org.modeldriven.modelpro.soapro.example"
sdo="true">
<arg line="-package
http://modeldriven.org/modelpro/soapro/example/Calculator
org.modeldriven.modelpro.soapro.example.message Calculator" />
</emf.Ecore2Java>
Where:
·
model : the
filepath to the source model.
·
genModel : the
filepath to the (target) genmodel.
·
reconcileGenModel: how
to reconcile an existing genmodel with new genmodel; may be:
o overwrite : overwrites existing genmodel with new genmodel
o keep :keeps existing genmodel
·
generateJavaCode: whether
or not to generate any java code
·
generateModelProject: whether
or not to generate java code for model project
·
generateEditProject: whether
or not to generate java code for edit project
·
generateEditorProject: whether
or not to generate java code for editor project
·
modelProject: name
of the model project
·
modelProjectFragmentPath: relative
location of the jave source directory
within the model project
·
modelPluginID: plugin
id of the model project
·
sdo: whether
or not to generate code corresponding to SDO specification
The arg line is defined as:
{ <model.ecore> }+ [
<model.genmodel> [ -reload ] ] <OPTION>
Where:
<OPTION> ::= [ <PROJECT-OPTION> ] [ <PATHMAP> ]
{
<PACKAGE> }+ { <REF-PACKAGE>
}* { <REF-GEN-MODEL> }*
[
<TEMPLATE-PATH> ] [ <MODEL-PLUGIN-ID> ] [ <COPYRIGHT> ]
[ <SDO> ]
[ <QUIET> ]
<PROJECT-OPTION> ::= <MODEL-PROJECT> [
<EDIT-PROJECT> ] [ <EDITOR-PROJECT> ]
[ <TESTS-PROJECT> ]
<MODEL-PROJECT> ::= -modelProject <model-directory>
<fragment-path>
<EDIT-PROJECT> ::= -editProject <edit-directory>
<fragment-path>
<EDITOR-PROJECT> ::= -editorProject <editor-directory>
<fragment-path>
<TESTS-PROJECT> ::= -testsProject <tests-directory>
<fragment-path>
<PACKAGE> ::= -package <nsURI> [
<base> <prefix> ]
<REF-GEN-MODEL> ::= -refGenModel <model.genmodel> {
<nsURI> }+
<TEMPLATE-PATH> ::= -templatePath <template-directory>
<MODEL-PLUGIN-ID> ::= -modelPluginID
<plugin-ID>
<COPYRIGHT> ::= -copyright <copyright-string>
<JDK-LEVEL> ::= -jdkLevel <jdk level: 1.4 5.0
6.0>
<VALIDATE-MODEL> ::= -validateModel <true|false>
<SDO> ::= -sdo
<QUIET> ::= -quiet
Converts an ecore model to:
· ?.xsd (xml schema definition)
General form of task command:
<org.modeldriven.ecore2xsd model="${basedir}/wsdl/Calculator.ecore"
genModel="${basedir}/wsdl/Calculator.genmodel" />
where:
·
model (source ecore model)
·
genModel (target xsd model)
Essentially the same as emf.Ecore2Java, except
the source model is an xsd model. The
syntax of the <PACKAGE> construct within the arg line is altered to
become:
<PACKAGE> ::= -packages [<nsURI>]+
Converts an ecore model to:
· ?.uml (uml model)
General form of task command:
<org.modeldriven.ecore2uml model="${basedir}/wsdl/Calculator.ecore"
genModel="${basedir}/wsdl/Calculator.genmodel" />
where:
·
model (source ecore model)
·
genModel (target uml model)
Essentially the same as emf.Ecore2Java, except
the source model is a uml model.
Converts an ecore model to:
· ?.ecore_diagraml (an ecore diagram)
General form of task command:
<org.modeldriven.ecore2ecore_diagram
model="${basedir}/wsdl4/Calculator.ecore" targetModel="${basedir}/wsdl4/Calculator.ecore_diagram"/>
where:
·
model (source ecore model)
·
targetModel (target ecore diagram)
Converts an ecore model to:
· ?.gmftool (a gmf tool model)
General form of task command:
<org.modeldriven.ecore2gmftool
model="${basedir}/wsdl5/Calculator.ecore" targetModel="${basedir}/wsdl5/Calculator.gmftool"/>
where:
·
model (source ecore model)
·
targetModel (target gmf tool model)
Converts an ecore model to:
· ?.gmfgraph (a gmf graph model)
General form of task command:
<org.modeldriven.ecore2gmfgraph
model="${basedir}/wsdl5/Calculator.ecore" targetModel="${basedir}/wsdl5/Calculator.gmfgraph"/>
where:
·
model (source ecore model)
·
targetModel (target gmf graph model)
Converts a combination of an ecore model, gmf graph model, and gmf tool model to:
· ?.gmfmap (a gmf map model)
General form of task command:
<org.modeldriven.ecore2gmfmap
model="${basedir}/wsdl5/Calculator.ecore"
domainMetaElement="CalculationTask"
graphModel="${basedir}/wsdl5/Calculator.gmfgraph"
toolModel="${basedir}/wsdl5/Calculator.gmftool"
targetModel="${basedir}/wsdl5/Calculator.gmfmap"/>
where:
·
model (source ecore model)
·
targetModel (target gmf map model)
·
graphModel (source gmf graph model)
·
toolModel (source gmf tool model)
·
domainMetaElement (Name of the EClass which
represents top node in a containment hierarchy)
Converts a gmf map model and its corresponding genmodel to:
· ?.gmfgen (a gmf generation model)
General form of task command:
<org.modeldriven.gmfmap2gmfgen model="${basedir}/wsdl5/Calculator.gmfmap"
genModel="${basedir}/wsdl5/Calculator.genmodel"
targetModel="${basedir}/wsdl5/Calculator.gmfgen"/>
where:
·
model (source gmf map model)
·
targetModel (target gmf gen model)
·
genModel (source emf gen model for the
original emf model)
Converts a gmf gen model to:
· java interface and implementation source code
General form of task command:
<org.modeldriven.gmfgen2java model="${basedir}/wsdl5/Calculator.gmfgen"/>
where:
·
model (source gmf gen model)
Create an activity diagram model instance from a uml model.
General form of task command:
<org.modeldriven.uml2activityDiagram
model="${basedir}/wsdl/Calculator.uml" targetModel="${basedir}/wsdl/Calculator.umlact"/>
where:
·
model (source uml model)
·
targetModel (target activity diagram
instance model)
Create a component diagram model instance from a uml model.
General form of task command:
<org.modeldriven.uml2componentDiagram
model="${basedir}/wsdl/Calculator.uml" targetModel="${basedir}/wsdl/Calculator.umlcomp"/>
where:
·
model (source uml model)
·
targetModel (target component diagram
instance model)
Create a csd diagram model instance from a uml model.
General form of task command:
<org.modeldriven.uml2csdDiagram
model="${basedir}/wsdl/Calculator.uml" targetModel="${basedir}/wsdl/Calculator.umlcsd"/>
where:
·
model (source uml model)
·
targetModel (target csd diagram instance
model)
Create a deployment diagram model instance from a uml model.
General form of task command:
<org.modeldriven.uml2deployDiagram
model="${basedir}/wsdl/Calculator.uml" targetModel="${basedir}/wsdl/Calculator.umldepl"/>
where:
·
model (source uml model)
·
targetModel (target deployment diagram
instance model)
Create a Use Case diagram model instance from a uml model.
General form of task command:
<org.modeldriven.uml2useCaseDiagram
model="${basedir}/wsdl/Calculator.uml" targetModel="${basedir}/wsdl/Calculator.umlusc"/>
where:
·
model (source uml model)
·
targetModel (target use case diagram
instance model)
Create a Profile diagram model instance from a uml profile model.
General form of task command:
<org.modeldriven.uml2profileDiagram
model="${basedir}/model/Provisioning.profile.uml " targetModel="${basedir}/wsdl/Calculator.umlprofile_diagram"/>
where:
·
model (source uml profile model)
·
targetModel (target profile diagram
instance model)
ATL is a hybrid declarative/imperative language leveraging the OMG OCL (Object Constraint Language).
Artifacts associated with the use of ATL include:
· *.atl. The transformation specification itself.
· *.asm An artifact produced by ATL tooling as a “compiled” representation of the original atl. An asm is constructed from an atl during project build cycle by an “Atl builder”.
· .project The “.project” file includes a specification of the “ATL nature” and the use of the “Atl builder” to be executed during the project build cycle.
· *.launch. A launch configuration which includes binding an *.atl specification to specific source and target models.
· Source models and meta-models. A specific configuration of a fixed number of source models and their associated meta-models.
· Target models and meta-models. A specific configuration of a fixed number of target models and their associated meta-models.
Within a ModelPro provisioning cycle, ATL may be utilized as a means for producing EMF model artifacts which are subsequently processed by additional ModelPro provisioning steps, or by other tools, to produce required target technology artifacts. For example, the information model portion of a UML model may be transformed via ATL into an ecore model, and then further processed to produce SDO java implementation artifacts and an XSD Schema using standard eclipse tools.
Since ATL (and other QVT transformers) are bound to specific configurations of source and target models, there is a requirement to provide a “launch” binding for each permutation of source/target model configuration. ModelPro may be used to generate multiple launch configurations, projects, and downstream bindings of target models to tools. ModelPro templates would typically generate:
· *.atl. (See note below).
· .project The “.project” file combines “ATL nature” and “Atl builder” descriptions with other target technology descriptions.
· *.launch. A launch configuration for each required permutation of source/target model configuration. Source models, source meta-models, and target meta-models may be resident in the workspace, plugins, network locations, or simply one of the original resources being processed by the ModelPro provisioning launch. Target models should normally be within the currently targeted project folder.
· * Artifacts for down-stream tool invocation, such as ant build scripts and/or launches.
Note:ATL files generally do not need the parametric variable substitution facilities provided by templates, but may require model-dependent target artifact locations. Furthermore, construction and debug of atl specifications are facilitated by a model-aware atl editor. One convenient way to achieve both model-dependent target artifact location specification and atl editing is to utilize the VTL #include directive within a template of the form:
For each meta-model specification within an ATL launch, there is a “model handler”. ATL includes model handlers named EMF and UML. ModelPro provides an additional model handler named “ModelPro” which includes some additional capabilities and/or corrections to the native ATL model handlers. Additional capabilities include handling of arbitrary ecore EDataTypes, all resources in a ResourceSet, applied stereotypes.
Some project examples are provided with modelPro which incorporate ATL, see Eclipse menu File/NewàExample…àmodelPro.
Examples in which the concepts outlined in this chapter are employed include:
· SMOF
Most of these examples may be executed as actions upon a selected model:
· From a navigation pane, right click on a model
· Select the pull-down menu item for the appropriate action as exemplified below:

Examples as projects (i.e., source specifications) may be obtained via the Examples.. User Assist capability.
The UML to diagram action simply generates a set of GMF diagram model instance shells for a selected UML model. The diagram models are all produced using trivial templates. When opened, the underlying diagram implementation will auto-align the appropriate model elements and allow for graphical editing of the targeted model elements.
Result of executing the action will be a set of diagram models in a sibling directory named “diagram”. Double-click a diagram model to open a diagram editor:

The SoaML (UML) to BPMN action generates the following types of artifacts:
· BPMN models. The provisioning is based on the ATL Model-to-Model transformation engine.
· Ancillary technology artifacts required to define an eclipse project and its associated launch definitions required for ATL execution. These artifacts are provisioned from templates.
The result of invoking the provisioning action will be a project focused on the BPMN model, having a small number of artifacts, and exemplified in following:

Utilizing eclipse BPMN tools, a graphical BPMN diagram can be created and used to edit the model, as illustrated below:
The SoaML (UML) to SCA/SDO action generates several projects:
· An ecore model plug-in project representing the SDOs. This will include, in addition to java implementation of the SDO/EMF the following models:
o The sdo ecore model and genmodel.
o Schemas (*.xsd) corresponding to the ecore model
o An ecore instance diagram.
o Various GMF graph, map, tool models.
· An edit plug-in project corresponding to the SDO ecore model.
· A graphical diagram plug-in project corresponding to the SDO ecore model and edit plug-in.
· An SCA project for SCA component definitions and java implementations.
The SDO ECORE model is produced via an ATL based model-to-model transform.
· Supporting build artifacts are provisioned via Templates.
· The build artifacts are used to drive the secondary provisioning processes such as java code generation, schema generations, GMF models, etc.
· The secondary level provisioning process uses available eclipse tools, including those described in “model-to-model conversion tasks”. .
The SCA component definitions and associated java implementations are all provisioned from templates.
A sample of the plug-in and other projects provisioned from an example SoaML model (projects with “.sca” suffix are sca projects; project with “.sdo” suffix are ado projects):

In conjunction with eclipse+Apache SCA/SDO support, resulting artifacts are intended to be realized in a SOA environment. The SCA run-time environment handles the infrastructural requirements, such as dynamic generation of WSDL and technology bindings, (presumably) leaving the focus of additional effort to the implementation of business logic.
An example of dedicated provisioning task: transform an OMG UML Specification of “SMOF” into an EMF/Ecore implementation. The result of provisioning are the following types of artifacts:
· An ecore model plug-in project which implements the SMOF. This includes, in addition to java implementation of the SMOF, the following models:
o The SMOF ecore model and genmodel.
o An ecore instance diagram.
o Various GMF graph, map, tool models.
· An edit plug-in project corresponding to the SMOF ecore model.
· An editor plug-in project corresponding to the SMOF ecore model.
The SMOF ECORE model is produced via an ATL based model-to-model transform.
· Supporting build artifacts are provisioned via Templates.
· The build artifacts are used to drive the secondary provisioning processes such as java code generation, edit and editor plug-in creation, GMF models, etc.
· The secondary level provisioning process uses available eclipse tools, including those described in “model-to-model conversion tasks”. .
A sample of the primary SMOF plug-in provisioned from the UML SMOF model:

Resulting artifacts are intended to serve as an augmentation of the Ecore implementation layer and enable the semantic concepts defined by SMOF to be applied to any Ecore-based model. The focus of additional effort related to SMOF includes (manual) implementation of business logic not formally expressed in the UML model.
The WSDL to SoaML (UML) action generates the following types of artifacts:
· UML model. The provisioning is based on the ATL Model-to-Model transformation engine, in this case transforming WSDL + XSD (as models) into UML.
· Ancillary technology artifacts required to define and execute the ATL transformation, plus requisite SoaML profile models. These artifacts are provisioned from templates (primarily as “included” copies of original definitions).
The result of invoking the provisioning action will be a sibling folder (named “model”) to the source WSDL model, having a small number of artifacts, and exemplified in following:

[i]
[i]This material is covered under copyright law. Copyright © 2009, Data Access Technologies,
Inc. for ModelDriven.org as an unpublished work, all rights reserved worldwide.
This material is licensed for your use for free under the
terms of the GNU public license version 2 which is located at this web address:
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
This material is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software foundation; either version 2 of the License, or (at your option) any
later version. This material is
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General
Public License at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt for more details. By downloading, copying or using this material you agree to
this license unless this license has been superseded by a specific agreement
with ModelDriven.org or Data Access Technologies, Inc. If the above license does not meet your needs
you may contact http://www.modeldriven.org for further options.