[Acceleo] UML profile not accessible [message #1445248] |
Wed, 15 October 2014 07:18  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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!
>
|
|
|
Powered by
FUDForum. Page generated in 0.03136 seconds