Java Reference
In-Depth Information
borrows from OCL, it is similar except where
without
is used instead of
symmetricDifference()
, and where
typeSelect()
is used instead of
select()->collect()
.
In the context of our
mindmap2csv
Xpand template, you can see the use of
our
rootTopics()
extension here. In this case, only the root
Topic
elements of
our
Map
will be written out in CSV format.
«
DEFINE
csvFile
FOR
Map»
«
EXPAND
csvFile(title)
FOREACH this
.rootTopics()-»
«
ENDDEFINE
»
Chapter 7, “Developing Model-to-Text Transformations,” has additional
examples of Xtend and Xpand usage.
14.1.16 Workflow Engine
Although it is possible to invoke Xpand templates using Java and even Ant, the
“native” method is to use the Model Workflow Engine (MWE) component of
EMF Technology (EMFT). The workflow engine uses configuration files, which
are Ant-like XML files executed using the Eclipse launcher. Note that this section
concentrates on using the workflow engine in the context of Xpand templates
only. Although additional capabilities exist, such as constraint checking and
Xtend-based model transformation, they fall outside the scope of this topic.
Properties
Workflow configuration files support Ant-like properties. The following exam-
ple would set a
model
property that could be used as
${model}
elsewhere in the
workflow. The use of full URIs, such as
platform:/resource/
... shown here,
is recommended practice.
<
property
name="model"
value="platform:/resource/org.eclipse.dsl.mindmap/model/Map.xmi"/>
Note that properties passed into a workflow invocation via Java or Ant over-
ride those defined in the workflow itself. This is a convenient means by which to
develop and later deploy a workflow when the environment of execution
changes.
Search WWH ::
Custom Search