Skip to main content



      Home
Home » Archived » GMT (Generative Modeling Technologies) » [MOFScript] eAnnotations-question
[MOFScript] eAnnotations-question [message #378057] Sun, 27 May 2007 17:07 Go to next message
Eclipse UserFriend
Originally posted by: chhirsch.rumms.uni-mannheim.de

Hi everybody,

i am trying to access the following eAnnotations - entry of a UML2 Model
using MOFScript.

<transition xmi:id="_HBYoxP5OEdut2qo8JgL_7Q" name="OVERVIEW"
target="_HBO3i_5OEdut2qo8JgL_7Q" source="_HBO3gv5OEdut2qo8JgL_7Q">
<eAnnotations xmi:id="_HBYoxf5OEdut2qo8JgL_7Q" source="abstract">
<details xmi:id="_HBYoxv5OEdut2qo8JgL_7Q" key="type"
value="Transition"/>
<details xmi:id="_HBYox_5OEdut2qo8JgL_7Q" key="stereotype"
value="State Transition"/>
<details xmi:id="_HBYoyP5OEdut2qo8JgL_7Q" key="bendpoints"
value="1"/>
</eAnnotations>
</transition>

I tried the following transformation:

texttransformation ExampleTransformation (in
uml:"http://www.eclipse.org/uml2/2.0.0/UML") {
uml.Transition::main () {
self.eAnnotations->forEach(annot:uml.EAnnotation){
//do something
}
}
}

This results in the following error message:

Error: MTTParseError: Type not found: 'EAnnotation' in metamodel 'uml',
line: 0, column: 0

Is there any way in MOFScript to access the eAnnotations content?
Any help is appreciated.

Greetings,
Christian
Re: [MOFScript] eAnnotations-question [message #378061 is a reply to message #378057] Tue, 29 May 2007 08:55 Go to previous messageGo to next message
Eclipse UserFriend
Hello Christian,

I think the problem is that you are using EAnnotation from uml.
You should try the following,

texttransformation ExampleTransformation (in
uml:"http://www.eclipse.org/uml2/2.0.0/UML") {
uml.Transition::main () {
self.eAnnotations->forEach(annot: ecore.EAnnotation){
//do something
}
}
}

The ecore metamodel is available through the prefix ecore.

Regards,
G
Re: [MOFScript] eAnnotations-question [message #378131 is a reply to message #378057] Wed, 13 June 2007 15:27 Go to previous message
Eclipse UserFriend
Originally posted by: carrasco.ModelDrivenDevelopment.co.uk

Christian,

We found similar obstacle.
We believe this happens, because the .ecore metamodel
is not taken into consideration by MOFscript,
when just indicating as input a .uml model..

Therfore, MOFscript does not consider that the UML elements,
are also ecore elements, and therefore have eAnnotations.

By explicitely including the ecore metamodel as an input parameter,
MOFscript will "find" the eAnnotations.

The hassle is that when you run the transformation,
MOFscript launcher will ask you for an input model
(to serve as the ec: parameter),
but you can simply provide the every same .uml input model,
it doesn
Re: [MOFScript] eAnnotations-question [message #599763 is a reply to message #378057] Tue, 29 May 2007 08:55 Go to previous message
Eclipse UserFriend
Hello Christian,

I think the problem is that you are using EAnnotation from uml.
You should try the following,

texttransformation ExampleTransformation (in
uml:"http://www.eclipse.org/uml2/2.0.0/UML") {
uml.Transition::main () {
self.eAnnotations->forEach(annot: ecore.EAnnotation){
//do something
}
}
}

The ecore metamodel is available through the prefix ecore.

Regards,
G
Re: [MOFScript] eAnnotations-question [message #601839 is a reply to message #378057] Wed, 13 June 2007 15:27 Go to previous message
Eclipse UserFriend
Originally posted by: carrasco.ModelDrivenDevelopment.co.uk

Christian,

We found similar obstacle.
We believe this happens, because the .ecore metamodel
is not taken into consideration by MOFscript,
when just indicating as input a .uml model..

Therfore, MOFscript does not consider that the UML elements,
are also ecore elements, and therefore have eAnnotations.

By explicitely including the ecore metamodel as an input parameter,
MOFscript will "find" the eAnnotations.

The hassle is that when you run the transformation,
MOFscript launcher will ask you for an input model
(to serve as the ec: parameter),
but you can simply provide the every same .uml input model,
it doesn
Previous Topic:Re: Cannot get MOFScript Editor or Pref Pages to Appear
Next Topic:[TCS] Best practices
Goto Forum:
  


Current Time: Mon Jun 30 19:21:29 EDT 2025

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

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

Back to the top