Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Standalone ATL execution with UML
[ATL] Standalone ATL execution with UML [message #44112] Mon, 04 June 2007 09:21 Go to next message
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 04:00 Go to previous messageGo to next message
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 04:45 Go to previous messageGo to next message
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 05:20 Go to previous messageGo to next message
Dennis Wagelaar is currently offline 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 #44576 is a reply to message #44454] Tue, 05 June 2007 09:03 Go to previous messageGo to next message
Eclipse User
Originally posted by: paul.gribben.gmail.com

Thanks for that Dennis.

The problem has now changed. I am now getting the message:
Package with uri 'http:///schemas/MYSCHEMA/_W1muUN0UEdutEfdnsVqhQA/53'
not found.

when the ecore system attempts to parse one of the input UML models. This
is a reference to the profile used by the model. The profile references in
the model file seem to be correct.

The transform works fine when I run it in eclipse.
Any ideas?

Cheers
Paul
Re: [ATL] Standalone ATL execution with UML [message #44606 is a reply to message #44576] Tue, 05 June 2007 13:17 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 147
Registered: July 2009
Senior Member
Paul Gribben schreef:
> Thanks for that Dennis.
>
> The problem has now changed. I am now getting the message:
> Package with uri 'http:///schemas/MYSCHEMA/_W1muUN0UEdutEfdnsVqhQA/53'
> not found.
>
> when the ecore system attempts to parse one of the input UML models.
> This is a reference to the profile used by the model. The profile
> references in the model file seem to be correct.
>
> The transform works fine when I run it in eclipse.
> Any ideas?
>
> Cheers
> Paul
>
>

The first XML element in your UML model should contain an
xsi:schemaLocation attribute that points to the location of your
profile. Can you check if that location is still valid outside Eclipse?

Dennis
Re: [ATL] Standalone ATL execution with UML [message #44670 is a reply to message #44606] Wed, 06 June 2007 03:43 Go to previous messageGo to next message
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
Re: [ATL] Standalone ATL execution with UML [message #44852 is a reply to message #44670] Wed, 06 June 2007 10:13 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 147
Registered: July 2009
Senior Member
Paul Gribben schreef:
> 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
>

Then you managed to get ATL transformations on UML2 models - including
profiles - to work outside Eclipse. That's great news! I think you're
the first to manage that ;-).

Dennis
Re: [ATL] Standalone ATL execution with UML [message #44883 is a reply to message #44852] Wed, 06 June 2007 14:28 Go to previous message
Frédéric Jouault is currently offline Frédéric Jouault
Messages: 572
Registered: July 2009
Senior Member
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
Previous Topic:[ATL] New ATL use case: Measuring UML models
Next Topic:[ATL] Using EMF for translation
Goto Forum:
  


Current Time: Mon Apr 21 03:21:39 EDT 2014

Powered by FUDForum. Page generated in 0.04012 seconds