Java Reference
In-Depth Information
<?xml version="1.0"?>
<
workflow
>
<!-- Specify model and output locations -->
<
property
name="model" value=
"platform:/resource/org.eclipse.dsl.mindmap/model/Mindmap.xmi"/>
<
property
name="out" value="out" />
<!-- Configure EMF and specify platform location -->
<
bean
class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<
platformUri
value="../" />
</
bean
>
<!-- Configure model reader to populate model slot -->
<
component
class="org.eclipse.emf.mwe.utils.Reader">
<
uri
value="${model}" />
<
modelSlot
value="model" />
</
component
>
<!-- Configure Xpand generator for EMF metamodel invocation -->
<
component
class="org.eclipse.xpand2.Generator" id="generate">
<
metaModel
id="mm" class=
"org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<
expand
value="mindmap2csv::Main FOR model" />
<
outlet
path="${out}"/>
</
component
>
</
workflow
>
The comments throughout make this workflow example fairly straight-
forward. The
bean
element for
org.eclipse.mwe.emf.StandaloneSetup
supports the registration of Ecore models using URIs, generated packages, and
those models in our project source path, such as our mindmap.ecore model.
An
org.eclipse.mwe.emf.Reader
is then configured to fill our
model
slot with our dynamic instance. In the Generator component that follows, this
slot is referenced by name in the
«EXPAND»
element. Note that an
«EXPAND»
ele-
ment in a workflow takes in its
value
attribute an
«EXPAND»
expression, minus
the
«EXPAND»
keyword (as it is provided by the element name). Note also the
assignment of the ID attribute. When we discuss the use of aspects with Xpand
in Section 14.1.16, “Aspects,” you'll see that this is a required attribute.
BEST PRACTICE
To allow for the execution of a workflow that adds extensibility to your
Xpand templates using
«AROUND»
elements, be sure to specify an ID
attribute of the workflow
org.eclipse.xpand2.Generator
compo-
nent.
Search WWH ::
Custom Search