Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [xpand] ignores applied stereotypes
[xpand] ignores applied stereotypes [message #500256] Wed, 25 November 2009 14:11 Go to next message
Andre Albert is currently offline Andre AlbertFriend
Messages: 25
Registered: July 2009
Junior Member
i started updgrading from oaw4.2 to the current eclipse.xpand based on.

I am using an uml2 3.0.0 based model.

unfortunately, all my template do not work correctly since the do not properly recognize applied stereotypes. Either

«DEFINE root FOR MyProfile::MyStereotype»
or
(MyProfile::MyStereotype).isInstance(elem)

wont work as expected.

Reading in the model with its applied profiles / stereotypes did not throw any exceptions.

the workflow looks like

<workflow>

<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<platformUri value="../ground-core-model/" />
<registerGeneratedEPackage value="org.eclipse.uml2.uml.UMLPackage"/>
<registerEcoreFile value="../ground-core-model/Profiles/${projectProfileFile}"/ >
</bean>

<component class="org.eclipse.emf.mwe.utils.Reader">
<uri value="${modelFile}" />
<modelSlot value="${modelSlot}" />
</component>

<component id="generator" class="org.eclipse.xpand2.Generator" srcPath="${baseDir}">
<metaModel idRef="uml2"/>

<metaModel id="entityProfile" class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel ">
<profile value="../ground-core-model/Profiles/${entityProfileFile}"/ >
</metaModel>

<expand value="templates::Root::Root FOR ${modelSlot}"/>

<outlet path="${srcGenPath}">
<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" configFile="oaw/formatter.xml" />

</outlet>

</component>
</workflow>

does someone have a little hint for me?

Thanks
Andre
Re: [xpand] ignores applied stereotypes [message #500269 is a reply to message #500256] Wed, 25 November 2009 14:26 Go to previous messageGo to next message
ekkehard gentz is currently offline ekkehard gentzFriend
Messages: 118
Registered: July 2009
Location: rosenheim, Germany, bavar...
Senior Member

This is a multi-part message in MIME format.
--------------070602070209080504010306
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

I have not the time to look at this in detail yet, because just
preparing democamp in frankfurt tomorrow...

but perhaps it helps: I have summarized my experiences migrating from
oaw to xpand/xtend/mwe here:
http://ekkescorner.wordpress.com/blog-series/modeling-oaw/

ekke

Andre Albert schrieb:
> i started updgrading from oaw4.2 to the current eclipse.xpand based on.
>
> I am using an uml2 3.0.0 based model.
>
> unfortunately, all my template do not work correctly since the do not
> properly recognize applied stereotypes. Either
>
> «DEFINE root FOR MyProfile::MyStereotype»
> or (MyProfile::MyStereotype).isInstance(elem)
>
> wont work as expected.
>
> Reading in the model with its applied profiles / stereotypes did not
> throw any exceptions.
>
> the workflow looks like
>
> <workflow>
>
> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
> <platformUri value="../ground-core-model/" />
> <registerGeneratedEPackage
> value="org.eclipse.uml2.uml.UMLPackage"/>
> <registerEcoreFile
> value="../ground-core-model/Profiles/${projectProfileFile}"/ >
> </bean>
>
> <component class="org.eclipse.emf.mwe.utils.Reader">
> <uri value="${modelFile}" />
> <modelSlot value="${modelSlot}" />
> </component>
>
> <component id="generator" class="org.eclipse.xpand2.Generator"
> srcPath="${baseDir}">
> <metaModel idRef="uml2"/>
>
> <metaModel id="entityProfile"
> class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel ">
> <profile
> value="../ground-core-model/Profiles/${entityProfileFile}"/ >
> </metaModel>
>
> <expand value="templates::Root::Root FOR ${modelSlot}"/>
>
> <outlet path="${srcGenPath}">
> <postprocessor
> class="org.eclipse.xpand2.output.JavaBeautifier"
> configFile="oaw/formatter.xml" />
>
> </outlet>
>
> </component>
> </workflow>
>
> does someone have a little hint for me?
>
> Thanks
> Andre


--

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


--------------070602070209080504010306
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">
I have not the time to look at this in detail yet, because just
preparing democamp in frankfurt tomorrow...<br>
<br>
but perhaps it helps: I have summarized my experiences migrating from
oaw to xpand/xtend/mwe here:<br>
<a class="moz-txt-link-freetext" href="http://ekkescorner.wordpress.com/blog-series/modeling-oaw/">http://ekkescorner.wordpress.com/blog-series/modeling-oaw/</a><br>
<br>
ekke<br>
<br>
Andre Albert schrieb:
<blockquote cite="mid:hejdur$6dj$1@build.eclipse.org" type="cite">i
started updgrading from oaw4.2 to the current eclipse.xpand based on.
<br>
<br>
I am using an uml2 3.0.0 based model.
<br>
<br>
unfortunately, all my template do not work correctly since the do not
properly recognize applied stereotypes. Either
<br>
<br>
«DEFINE root FOR MyProfile::MyStereotype»
<br>
or (MyProfile::MyStereotype).isInstance(elem)
<br>
<br>
wont work as expected.
<br>
<br>
Reading in the model with its applied profiles / stereotypes did not
throw any exceptions.
<br>
<br>
the workflow looks like
<br>
<br>
&lt;workflow&gt;
<br>
<br>
   &lt;bean class="org.eclipse.emf.mwe.utils.StandaloneSetup"&gt;
<br>
        &lt;platformUri value="../ground-core-model/" /&gt;
<br>
        &lt;registerGeneratedEPackage
value="org.eclipse.uml2.uml.UMLPackage"/&gt;
<br>
        &lt;registerEcoreFile
value="../ground-core-model/Profiles/${projectProfileFile}"/ &gt;
<br>
    &lt;/bean&gt;
<br>
<br>
   &lt;component class="org.eclipse.emf.mwe.utils.Reader"&gt;
<br>
       &lt;uri value="${modelFile}" /&gt;
<br>
       &lt;modelSlot value="${modelSlot}" /&gt;
<br>
   &lt;/component&gt;
<br>
<br>
   &lt;component id="generator" class="org.eclipse.xpand2.Generator"
srcPath="${baseDir}"&gt;
<br>
        &lt;metaModel idRef="uml2"/&gt;
<br>
<br>
        &lt;metaModel id="entityProfile"
class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel "&gt;
<br>
            &lt;profile
value="../ground-core-model/Profiles/${entityProfileFile}"/ &gt;
<br>
        &lt;/metaModel&gt;
<br>
<br>
        &lt;expand value="templates::Root::Root FOR ${modelSlot}"/&gt;
<br>
<br>
          &lt;outlet path="${srcGenPath}"&gt;
<br>
            &lt;postprocessor
class="org.eclipse.xpand2.output.JavaBeautifier"
configFile="oaw/formatter.xml" /&gt;
<br>
<br>
        &lt;/outlet&gt;
<br>
<br>
    &lt;/component&gt;
<br>
&lt;/workflow&gt;
<br>
<br>
does someone have a little hint for me?
<br>
<br>
Thanks
<br>
Andre
<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>

--------------070602070209080504010306--


ekke
independent software architect

blog: http://ekkes-corner.org
twitter: @ekkescorner
Re: [xpand] ignores applied stereotypes [message #500282 is a reply to message #500256] Wed, 25 November 2009 14:59 Go to previous messageGo to next message
Andre Albert is currently offline Andre AlbertFriend
Messages: 25
Registered: July 2009
Junior Member
thanks for the link

it look interesting for my scenario..
currently starting to reading it
Re: [xpand] ignores applied stereotypes [message #500347 is a reply to message #500256] Wed, 25 November 2009 17:35 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Hi Andre!

Use only the ProfileMetaModel, not the UML2 metamodel. The UML2 metamodel is implicitly used by the ProfileMetaModel now.

~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: [xpand] ignores applied stereotypes [message #500505 is a reply to message #500256] Thu, 26 November 2009 13:11 Go to previous messageGo to next message
Andre Albert is currently offline Andre AlbertFriend
Messages: 25
Registered: July 2009
Junior Member
Thanks for the answers.

I retested my workflow again and recognized that the handling of stereotype seems to be different to oaw4. A short example template:

«DEFINE Root FOR MyProfile::MyStereotype»
[EXPAND1 Statements here]
«ENDDEFINE»

«DEFINE Root FOR uml::Component»
«IF !(MyProfile::MyStereotype::Project).isInstance(this)»
[EXPAND2 Statements here]
«ENDIF»
[EXPAND3 Statements here]
«ENDDEFINE»

running this template:
EXPAND2 and EXPAND3 become evaluated.

Is it right that the previous statement «DEFINE Root FOR MyProfile::MyStereotype»
as not valid anymore?
I would rather prefer the first on since it is more descriptive instead of some IF switches.

Greetings
Re: [xpand] ignores applied stereotypes [message #500509 is a reply to message #500256] Thu, 26 November 2009 13:26 Go to previous messageGo to next message
Andre Albert is currently offline Andre AlbertFriend
Messages: 25
Registered: July 2009
Junior Member
I am sorry, there was a typing error. There was an ! before the IF evaluation.
So in general my basic problem is still existent.

My eclipse UML Model Editor (the tree) shows all the applied stereotypes, but xpand seems to not recognize them
Re: [xpand] ignores applied stereotypes [message #500531 is a reply to message #500256] Thu, 26 November 2009 14:35 Go to previous messageGo to next message
Andre Albert is currently offline Andre AlbertFriend
Messages: 25
Registered: July 2009
Junior Member
Does this have something to do with the uml2 2.0.0 to uml2 3.0.0 switch.

If I model and define a profile, the source attribute of eAnnotations defining the profile has a reference to "http://www.eclipse.org/uml2/2.0.0/UML"
this also applies to the eAnnotations of the element inside the profile definition

After manually modify them to "http://www.eclipse.org/uml2/3.0.0/UML"
it is not possible to apply this profile anymore.

Does someone have a running workflow for uml2 3.0.0 based models with applied profiles? Please paste it here so that i can look if i missed something to configure
Re: [xpand] ignores applied stereotypes [message #501421 is a reply to message #500256] Wed, 02 December 2009 09:50 Go to previous messageGo to next message
Andre Albert is currently offline Andre AlbertFriend
Messages: 25
Registered: July 2009
Junior Member
Hello,

does the not-resolving of profile stereotypes have something to do with my standalone environment.

Do platform:/resource statements work when not running within a plugin?

I do start my workflows with an ant task which references the required eclipse jar libraries directly. There is no OSGi involved.

Using oaw4.2 this works fine... but after the switch to eclipse.xpand
i do have these profile/stereotype problems

Now i switched back to my previous oaw4.2 environment to be able to work further.. But i realy would to upgrade to the latest eclipse integrated version.

greetings,
andre
Re: [xpand] ignores applied stereotypes [message #501427 is a reply to message #501421] Wed, 02 December 2009 10:01 Go to previous messageGo to next message
ekkehard gentz is currently offline ekkehard gentzFriend
Messages: 118
Registered: July 2009
Location: rosenheim, Germany, bavar...
Senior Member

This is a multi-part message in MIME format.
--------------070608060700030902060508
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Andre Albert schrieb:
> ...
>
> Using oaw4.2 this works fine... but after the switch to eclipse.xpand
> i do have these profile/stereotype problems
> Now i switched back to my previous oaw4.2 environment to be able to
> work further.. But i realy would to upgrade to the latest eclipse
> integrated version.
>
> greetings,
> andre
andre,

are you using eclipse galileo or helios ?

ekke

--

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


--------------070608060700030902060508
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

<!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">
Andre Albert schrieb:
<blockquote cite="mid:hf5d8t$og7$1@build.eclipse.org" type="cite">...<br>
<br>
Using oaw4.2 this works fine... but after the switch to eclipse.xpand
<br>
i do have these profile/stereotype problems <br>
Now i switched back to my previous oaw4.2 environment to be able to
work further.. But i realy would to upgrade to the latest eclipse
integrated version.
<br>
<br>
greetings,
<br>
andre
<br>
</blockquote>
andre,<br>
<br>
are you using eclipse galileo or helios ?<br>
<br>
ekke<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>

--------------070608060700030902060508--


ekke
independent software architect

blog: http://ekkes-corner.org
twitter: @ekkescorner
Re: [xpand] ignores applied stereotypes [message #501429 is a reply to message #500256] Wed, 02 December 2009 10:09 Go to previous messageGo to next message
Andre Albert is currently offline Andre AlbertFriend
Messages: 25
Registered: July 2009
Junior Member
Hi,
thanks for the quick reply.

I do use eclipse 3.5.1 which is galileo.

i did donwload the "Eclipse Modeling Tools (includes Incubating components) (371 MB)" packaged eclipse which is listed at http://www.eclipse.org/downloads/
Re: [xpand] ignores applied stereotypes [message #501439 is a reply to message #501429] Wed, 02 December 2009 11:00 Go to previous messageGo to next message
ekkehard gentz is currently offline ekkehard gentzFriend
Messages: 118
Registered: July 2009
Location: rosenheim, Germany, bavar...
Senior Member

This is a multi-part message in MIME format.
--------------070206000808010707050504
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Andre Albert schrieb:
> Hi,
> thanks for the quick reply.
>
> I do use eclipse 3.5.1 which is galileo.
>
> i did donwload the "Eclipse Modeling Tools (includes Incubating
> components) (371 MB)" packaged eclipse which is listed at
> http://www.eclipse.org/downloads/
>
I have no problems with galileo and 0.7.2 - yetserday I got problems
using newest helios + emf + uml ... still testing what causes it

--

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


--------------070206000808010707050504
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">
Andre Albert schrieb:
<blockquote cite="mid:hf5edf$ufd$1@build.eclipse.org" type="cite">Hi,
<br>
thanks for the quick reply.
<br>
<br>
I do use eclipse 3.5.1 which is galileo.
<br>
<br>
i  did donwload the "Eclipse Modeling Tools (includes Incubating
components) (371 MB)" packaged eclipse which is listed at
<a class="moz-txt-link-freetext" href="http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a>
<br>
<br>
</blockquote>
I have no problems with galileo and 0.7.2 - yetserday I got problems
using newest helios + emf + uml ... still testing what causes it<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>

--------------070206000808010707050504--


ekke
independent software architect

blog: http://ekkes-corner.org
twitter: @ekkescorner
Re: [xpand] ignores applied stereotypes [message #501807 is a reply to message #500256] Thu, 03 December 2009 21:38 Go to previous messageGo to next message
Andre Albert is currently offline Andre AlbertFriend
Messages: 25
Registered: July 2009
Junior Member
Hello again,

to avoid switching back to oaw4.2, I upload a simple scenario of an uml model (containing only one class) and a profile (only one stereotype).
There is a simple workflow that triggers a simple xpt template with only 3 rules.

I uploaded this simple standalone scenario to free file hoster.
Since working standalone, all required libs are packaged inside the zipped eclipse project. Also a generate.xml Ant script can be found for a quick run.
All the required libs are from the same eclipse version (there should be no internal conflicts)

The link is:

http://www.filedropper.com/xpandsimple

Please, can some working with xpand look over this simple example and look why this stereotype is ignored?

thanks..

greetings, andre

[Updated on: Thu, 03 December 2009 21:42]

Report message to a moderator

Re: [xpand] ignores applied stereotypes [message #502077 is a reply to message #501807] Sat, 05 December 2009 09:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14720
Registered: July 2009
Senior Member
hello Andre,

modifiying the workflow like this sould do the trick in your sample

<component class="org.eclipse.emf.mwe.utils.Reader">
			<uri value="platform:/resource/OAWtest/model/Model.uml" />
			<modelSlot value="model" />
	</component>


for more information have a look at https://bugs.eclipse.org/bugs/show_bug.cgi?id=284464 too.


Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: [xpand] ignores applied stereotypes [message #502079 is a reply to message #500256] Sat, 05 December 2009 09:32 Go to previous message
Andre Albert is currently offline Andre AlbertFriend
Messages: 25
Registered: July 2009
Junior Member
Thank you really much Christian,

you make my day, this solved the problem. I am happy that i can migrate my project now.

Greetings,
Andre
Previous Topic:UML2 MetaModel not applied
Next Topic:UML class descriptions to wsdl annotations
Goto Forum:
  


Current Time: Sat Oct 05 03:01:00 GMT 2024

Powered by FUDForum. Page generated in 0.06042 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top