|
Re: Problem with XPand2 and UML Profiles [message #513490 is a reply to message #513466] |
Wed, 10 February 2010 06:50 |
|
This is a multi-part message in MIME format.
--------------080508050009050805040507
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Markus,
in your workflow please try using only the profile mm - this refres
already to UML2 MM and ecore MM
....
<component class="org.eclipse.xpand2.Generator">
<metaModel idRef="sdkApiProfil"/>
<fileEncoding value="Cp1252"/>
<expand value="template::Template::Main FOR model"/>
<genPath value="${src-gen}"/>
</component>
....
ekke
Am 10.02.10 11:26, schrieb Markus:
> Hey guys,
>
> I want to Transform a model into text. I have modelled my model with
> MagicDraw 15.x and exported it as a EMF 2.x file. The MagicDraw uml
> model is based on an UML Profile, named "SdkApiProfile".
>
> My workflow-file looks like:
>
> <?xml version="1.0"?>
> <workflow>
> <property name="src-gen" value="src-gen" />
>
> <bean class="org.eclipse.xtend.typesystem.uml2.Setup"
> standardUML2Setup="true" />
>
> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
> <platformUri value="."/>
> </bean>
>
> <bean id="mmUML"
> class="org.eclipse.xtend.typesystem.uml2.UML2MetaModel">
> </bean>
>
> <bean id="sdkApiProfil"
> class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel ">
> <profile
> value=" platform:/resource/src/metamodel/uml/SdkApiProfile.profile.u ml "/>
> </bean>
>
> <component class="org.eclipse.emf.mwe.utils.Reader">
> <uri value="platform:/resource/src/model.uml"/> <modelSlot
> value="model"/>
> </component>
>
> <component class="org.eclipse.xpand2.Generator">
> <metaModel idRef="sdkApiProfil"/>
> <metaModel idRef="mmUML"/>
> <metaModel
> class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
> <fileEncoding value="Cp1252"/>
>
> <expand value="template::Template::Main FOR model"/>
> <genPath value="${src-gen}"/>
> </component>
>
> </workflow>
>
>
>
> My Xpand-Template is very simple
>
>
>
>
> «DEFINE Main FOR SdkApiProfile::DomainModel»
> «FILE "test.xmap"-»
> «REM»do some stuff...«ENDREM»
> «EXPAND PackageIteration FOREACH
> ownedElement.typeSelect(uml::Package).select(e|e.name=="root ")-»
> «ENDFILE-»
> «ENDDEFINE»
>
>
> «DEFINE PackageIteration FOR uml::Package»
> «EXPAND PackageIteration FOREACH
> this.ownedElement.typeSelect(uml::Package)-»
> «EXPAND Typedef FOREACH this.ownedType-»
> «ENDDEFINE»
>
> «DEFINE Typedef FOR SdkApiProfile::Data»
>
> «ENDDEFINE»
>
> «DEFINE Typedef FOR uml::Enumeration»
>
> «ENDDEFINE»
>
>
> the problem is, that in Main-Template, the generator expects an
> uml::Model, but it is also a SdkApiProfil::DomainModel. And I do not
> know how to tell Xpand (or MWE) that the imported model.uml has
> stereotypes, which are located in SdkApiProfile.profile.uml. I think
> it is already done in workflow-file, as you see above.
>
> Can you help me to fix the problem?
>
> kind regards
> Markus
--
ekke (ekkehard gentz)
independent software-architect
senior erp-consultant
eclipse | osgi | equinox | mdsd | oaw | emf | uml
max-josefs-platz 30, D-83022 rosenheim, germany
mailto:ekke@ekkes-corner.org
homepage (de): http://gentz-software.de
blog (en): http://ekkes-corner.org
twitter: @ekkescorner
skype: ekkes-corner
Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID: DE189929490
--------------080508050009050805040507
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Markus, <br>
<br>
in your workflow please try using only the profile mm - this refres
already to UML2 MM and ecore MM<br>
<br>
....<br>
<component class="org.eclipse.xpand2.Generator">
<br>
<metaModel idRef="sdkApiProfil"/>
<br>
<fileEncoding value="Cp1252"/>
<br>
<br>
<expand value="template::Template::Main FOR model"/>
<br>
<genPath value="${src-gen}"/>
<br>
</component>
<br>
....<br>
<br>
ekke<br>
Am 10.02.10 11:26, schrieb Markus:
<blockquote cite="mid:hku1kj$po1$1@build.eclipse.org" type="cite">Hey
guys,
<br>
<br>
I want to Transform a model into text. I have modelled my model with
MagicDraw 15.x and exported it as a EMF 2.x file. The MagicDraw uml
model is based on an UML Profile, named "SdkApiProfile".
<br>
<br>
My workflow-file looks like:
<br>
<br>
<?xml version="1.0"?>
<br>
<workflow>
<br>
<property name="src-gen" value="src-gen" />
<br>
<br>
<bean class="org.eclipse.xtend.typesystem.uml2.Setup"
standardUML2Setup="true" />
<br>
<br>
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<br>
<platformUri value="."/>
<br>
</bean>
<br>
<br>
<bean id="mmUML"
class="org.eclipse.xtend.typesystem.uml2.UML2MetaModel">
<br>
</bean>
<br>
<br>
<bean id="sdkApiProfil"
class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel ">
<br>
<profile
value=" platform:/resource/src/metamodel/uml/SdkApiProfile.profile.u ml "/>
<br>
</bean>
<br>
<br>
<component class="org.eclipse.emf.mwe.utils.Reader">
<br>
<uri value="platform:/resource/src/model.uml"/>
<modelSlot value="model"/>
<br>
</component>
<br>
<br>
<component class="org.eclipse.xpand2.Generator">
<br>
<metaModel idRef="sdkApiProfil"/>
<br>
<metaModel idRef="mmUML"/>
<br>
<metaModel
class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
<br>
<fileEncoding value="Cp1252"/>
<br>
<br>
<expand value="template::Template::Main FOR model"/>
<br>
<genPath value="${src-gen}"/>
<br>
</component>
<br>
<br>
</workflow>
<br>
<br>
<br>
<br>
My Xpand-Template is very simple
<br>
<br>
<br>
<br>
<br>
«DEFINE Main FOR SdkApiProfile::DomainModel»
<br>
«FILE "test.xmap"-»
<br>
«REM»do some stuff...«ENDREM»
<br>
«EXPAND PackageIteration FOREACH
ownedElement.typeSelect(uml::Package).select(e|e.name=="root ")-»
<br>
«ENDFILE-»
<br>
«ENDDEFINE»
<br>
<br>
<br>
«DEFINE PackageIteration FOR uml::Package»
<br>
«EXPAND PackageIteration FOREACH
this.ownedElement.typeSelect(uml::Package)-»
<br>
«EXPAND Typedef FOREACH this.ownedType-»
<br>
«ENDDEFINE»
<br>
<br>
«DEFINE Typedef FOR SdkApiProfile::Data»
<br>
<br>
«ENDDEFINE»
<br>
<br>
«DEFINE Typedef FOR uml::Enumeration»
<br>
<br>
«ENDDEFINE» <br>
<br>
<br>
the problem is, that in Main-Template, the generator expects an
uml::Model, but it is also a SdkApiProfil::DomainModel. And I do not
know how to tell Xpand (or MWE) that the imported model.uml has
stereotypes, which are located in SdkApiProfile.profile.uml. I think it
is already done in workflow-file, as you see above.
<br>
<br>
Can you help me to fix the problem?
<br>
<br>
kind regards
<br>
Markus
<br>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<p style="margin-bottom: 0cm;"> <font ,="" color="#808080"
face="Verdana, sans-serif"> <font size="4">ekke (ekkehard gentz)<br>
</font> <font size="3"> independent software-architect<br>
senior erp-consultant<br>
</font> <font size="2">eclipse | osgi | equinox | mdsd | oaw | emf |
uml<br>
max-josefs-platz 30, D-83022 rosenheim, germany<br>
<a class="moz-txt-link-freetext" href="mailto:ekke@ekkes-corner.org">mailto:ekke@ekkes-corner.org</a><br>
homepage (de): <a class="moz-txt-link-freetext" href="http://gentz-software.de">http://gentz-software.de</a><br>
blog (en): <a class="moz-txt-link-freetext" href="http://ekkes-corner.org">http://ekkes-corner.org</a><br>
twitter: @ekkescorner<br>
skype: ekkes-corner<br>
</font> <font size="1"> Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID:
DE189929490<br>
</font> </font> </p>
</div>
</body>
</html>
--------------080508050009050805040507--
ekke
independent software architect
blog: http://ekkes-corner.org
twitter: @ekkescorner
|
|
|
|
Powered by
FUDForum. Page generated in 0.04335 seconds