Java Reference
In-Depth Information
Of course, the expressiveness of the GMF mapping model is insufficient to cap-
ture the complete mapping, leaving the Toolsmith to implement the rest in Java.
The result would be a diagram capable of directly editing a BPEL model.
Another approach would be to create a domain model of BPMN in Eclipse
Modeling Framework (EMF), for example, and map the notation directly to this
model. In the case of BPMN2, this would be the BPDM metamodel. Instances of
the BPMN model would be used in an M2M transformation to produce a BPEL
model instance, with the transformation definition embodying the mapping from
BPMN to BPEL provided in the specification. By creating an instance of the
BPEL model that was derived from the XML Schema, EMF would serialize it as
a valid BPEL document. Otherwise, as is the case for generating Java, an M2M
transformation would result in an instance of a Java model that would have ded-
icated Model-to-Text Transformation (M2T) templates used to generate the
compilation units as files.
Still another option would be to use this BPMN instance as input to model-
to-text templates. In this case, the logic required to map from BPMN to BPEL
would exist within the template languageā€”in the case of Xpand, mostly using its
Xtend language.
Many techniques must be considered when dealing with model transforma-
tion, both model-to-model and model-to-text. Chaining models through a
sequence of transformations is a likely scenario, as is the case in which multiple
input and/or output models are involved. Intermediate models might be required
to overcome certain complexities or adapt one model for use in another prede-
fined transformation. In fact, OML provides the capability to define a meta-
model that can be used on-the-fly within the context of a transformation.
As mentioned, each of these approaches has its pros and cons. The Toolsmith
must determine the appropriate technique based on stated requirements, flexi-
bility, personal preference, maintainability, and other considerations.
6.2 Model Refactoring
Model transformation can be used for model refactoring, specifically through the
use of in-place transformations. Using a transformation defined on a model that
targets the same instance as the input model, it is possible to create complex
refactorings.
The following is a simple example of model refactoring using QVT OML. A
requirements model is passed in and out, as indicated by inout on both the
transformation declaration and the mappings. In this case, requirement groups
and their contained requirements have some of their attributes reset. Each ID
attribute is reset to a sequential number, and each requirement type is set to non-
functional.
 
Search WWH ::




Custom Search