[ATL] Standalone ATL execution with UML [message #44112] |
Mon, 04 June 2007 13:21 |
Eclipse User |
|
|
|
Originally posted by: paul.gribben.gmail.com
Hi,
I wasn't sure whether to post this to the UML or ATL group, so I picked
the latter. I've been trying to put together a java launcher for ATL
transformations that use eclipse UML2 model files. I am currently getting
a problem when the transform attempts to resolve the 'hasStereotype'
operation:
message: ERROR: could not find operation hasStereotype on Void having
supertypes: [OclAny]
I'm guessing that I need to register some extension or plugin element in
the standalone environment context, but can't figure out what to do. So
far I've registered the UML2 package doing this:
org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getEFactoryInstanc e();
I also did the following (but am unsure if I needed to):
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "uml",
factory);
Perhaps someone's already written a java launcher that I can use. Anyway
any help would be greatly appreciated.
Thanks
Paul
|
|
|
Re: [ATL] Standalone ATL execution with UML [message #44305 is a reply to message #44112] |
Tue, 05 June 2007 08:00 |
Eclipse User |
|
|
|
Originally posted by: freddy.allilaire.univ-nantes.fr
Hi Paul,
This seems more ATL related.
(Maybe a silly question) Do you have a helper called hasStereotype in
your ATL transformation?
Regards,
Freddy.
Paul Gribben a écrit :
> Hi,
>
> I wasn't sure whether to post this to the UML or ATL group, so I picked
> the latter. I've been trying to put together a java launcher for ATL
> transformations that use eclipse UML2 model files. I am currently
> getting a problem when the transform attempts to resolve the
> 'hasStereotype' operation:
>
> message: ERROR: could not find operation hasStereotype on Void having
> supertypes: [OclAny]
>
> I'm guessing that I need to register some extension or plugin element in
> the standalone environment context, but can't figure out what to do. So
> far I've registered the UML2 package doing this:
>
> org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getEFactoryInstanc e();
>
> I also did the following (but am unsure if I needed to):
>
> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "uml",
> factory);
>
> Perhaps someone's already written a java launcher that I can use. Anyway
> any help would be greatly appreciated.
>
> Thanks
> Paul
>
--
Freddy Allilaire - ATLAS Group (INRIA & LINA)
http://www.sciences.univ-nantes.fr/lina/atl/contrib/allilair e
|
|
|
Re: [ATL] Standalone ATL execution with UML [message #44393 is a reply to message #44305] |
Tue, 05 June 2007 08:45 |
Eclipse User |
|
|
|
Originally posted by: paul.gribben.gmail.com
Hi Freddy,
Not a silly question as it turns out. Yes - this is the problem. My ATL
transform combines AMW with UML, and the getInstanceById() method is
resolving a uml element incorrectly it seems, so the return type is not a
uml element type, and this is the cause of the problem. I need to dig
further to see why this works in eclipse but not standalone.
Thanks for replying.
Paul
|
|
|
Re: [ATL] Standalone ATL execution with UML [message #44454 is a reply to message #44112] |
Tue, 05 June 2007 09:20 |
Dennis Wagelaar Messages: 147 Registered: July 2009 |
Senior Member |
|
|
Paul Gribben schreef:
> Hi,
>
> I wasn't sure whether to post this to the UML or ATL group, so I picked
> the latter. I've been trying to put together a java launcher for ATL
> transformations that use eclipse UML2 model files. I am currently
> getting a problem when the transform attempts to resolve the
> 'hasStereotype' operation:
>
> message: ERROR: could not find operation hasStereotype on Void having
> supertypes: [OclAny]
>
> I'm guessing that I need to register some extension or plugin element in
> the standalone environment context, but can't figure out what to do. So
> far I've registered the UML2 package doing this:
>
> org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getEFactoryInstanc e();
>
> I also did the following (but am unsure if I needed to):
>
> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "uml",
> factory);
>
> Perhaps someone's already written a java launcher that I can use. Anyway
> any help would be greatly appreciated.
>
> Thanks
> Paul
>
There's a UML2 FAQ on the Eclipse website that addresses this question:
http://wiki.eclipse.org/index.php/MDT-UML2-FAQ
It uses a slightly different variant of the UML2 init code you've used.
Since you cannot access the ATL's resourceSet variable directly, you may
try to do the init on the global package registry and
extension-to-factory-map:
EPackage.Registry.INSTANCE.put(UMLPackage.eNS_URI,
UMLPackage.eINSTANCE);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).
put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
Normally, these two lines of code should work already, unless you've
referenced any of the included UML libraries from the UML plugin.
Dennis
|
|
|
|
|
Re: [ATL] Standalone ATL execution with UML [message #44670 is a reply to message #44606] |
Wed, 06 June 2007 07:43 |
Eclipse User |
|
|
|
Originally posted by: paul.gribben.gmail.com
Dennis,
You pointed me in the right direction. The schemaLocation is defined using
a pathmap reference. I had to delve into the ATL source code but
eventually discovered how to set the pathmaps in the ATL ResourceSet. The
trick was getting hold of ATL's ResourceSet as follows:
ASMEMFModel.getResourceSet()
And then setting my pathmaps using that.
Thanks
Paul
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03655 seconds