[ATL] Standalone ATL execution with UML [message #44112] |
Mon, 04 June 2007 09: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 #44454 is a reply to message #44112] |
Tue, 05 June 2007 05:20   |
Eclipse User |
|
|
|
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 #44883 is a reply to message #44852] |
Wed, 06 June 2007 14:28  |
Eclipse User |
|
|
|
Hello,
>> 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
>>
>
> Then you managed to get ATL transformations on UML2 models - including
> profiles - to work outside Eclipse. That's great news!
Thanks to you both for sorting this problem out ;-).
> I think you're
> the first to manage that ;-).
Well, I suppose it is mostly because Paul is the first to actually try ;-).
Best regards,
Frédéric Jouault
|
|
|
Powered by
FUDForum. Page generated in 0.08064 seconds