Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] UML profile not accessible
[Acceleo] UML profile not accessible [message #1445248] Wed, 15 October 2014 07:18 Go to next message
Andrej P. is currently offline Andrej P.Friend
Messages: 1
Registered: October 2014
Junior Member
Hello,

I created a simple Acceleo example. It creates a text file out of a UML model. The model and the profile the model is derived from are designed with Papyrus. The profile contains a stereotype that extends the Class. Unfortunately accessing the meta class in the model is not possible, because the metaclass Class could not be resolved (in Metaclass [name /] ([self /], name always returns an empty value). The following code:

[comment  @main/]

[file ('output.txt', false)]

[for (eAllContents(uml::Class))]
[name /]

  [for (getStereotypeApplications())]
	[self/]
  [/for]

  [let stereotype : Stereotype = getStereotype('MyStereotype')]
  Stereotype [name /]

    [for (stereotype.getAllExtendedMetaclasses())]
  Metaclass [name /] ([self /])
    [/for]
  [/let]
[/for]


produces following output:


MyPapyrusClass1

	org.eclipse.emf.ecore.impl.DynamicEObjectImpl@8d39c4 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@3b4ac8 (name: MyStereotype) (instanceClassName: null) (abstract: false, interface: false))

  Stereotype MyPapyrusClass1

  Metaclass  (org.eclipse.uml2.uml.internal.impl.ClassImpl@f12539 (eProxyURI: http://www.eclipse.org/uml2/2.0.0/metamodels#//Class))


Has anyone an idea how to solve the issue? Attached the complete example. Thanks in advance!
Re: [Acceleo] UML profile not accessible [message #1445649 is a reply to message #1445248] Wed, 15 October 2014 18:54 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5527
Registered: July 2009
Senior Member
Hi

I generally find accessing stereotypes hard and need to use a debugger
to get it right.

IIRC you generally need PackageName::StereotypeName and need to get the
cases exactly right.

If you scan this and the UML or QVTo or ATL newsgroups you may get a
better answer.

Regards

Ed Willink


On 15/10/2014 12:30, Andrej P. wrote:
> Hello,
>
> I created a simple Acceleo example. It creates a text file out of a UML model. The model and the profile the model is derived from are designed with Papyrus. The profile contains a stereotype that extends the Class. Unfortunately accessing the meta class in the model is not possible, because the metaclass Class could not be resolved (in Metaclass [name /] ([self /], name always returns an empty value). The following code:
>
>
> [comment @main/]
>
> [file ('output.txt', false)]
>
> [for (eAllContents(uml::Class))]
> [name /]
>
> [for (getStereotypeApplications())]
> [self/]
> [/for]
>
> [let stereotype : Stereotype = getStereotype('MyStereotype')]
> Stereotype [name /]
>
> [for (stereotype.getAllExtendedMetaclasses())]
> Metaclass [name /] ([self /])
> [/for]
> [/let]
> [/for]
>
>
> produces following output:
>
>
>
> MyPapyrusClass1
>
> org.eclipse.emf.ecore.impl.DynamicEObjectImpl@8d39c4 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@3b4ac8 (name: MyStereotype) (instanceClassName: null) (abstract: false, interface: false))
>
> Stereotype MyPapyrusClass1
>
> Metaclass (org.eclipse.uml2.uml.internal.impl.ClassImpl@f12539 (eProxyURI: http://www.eclipse.org/uml2/2.0.0/metamodels#//Class))
>
>
> Has anyone an idea how to solve the issue? Attached the complete example. Thanks in advance!
>
Previous Topic:[Acceleo] Generation of code and creation of sub-unit problems
Next Topic:[Acceleo] Any tutorials on generating java domain classes?
Goto Forum:
  


Current Time: Thu Dec 14 08:21:48 GMT 2017

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

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