Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Using *.profile.uml files
[ATL] Using *.profile.uml files [message #552738] Fri, 13 August 2010 10:41 Go to next message
Aur is currently offline AurFriend
Messages: 29
Registered: August 2010
Junior Member
Hi,

I'm working on a transformation using ATL from a UML model with a profile application to a UML model with another profile.
-- @nsURI UML=http://www.eclipse.org/uml2/2.1.0/UML

-- @path E_Profile=/TestbenchToModel/umlProfiles/e/e.profile.uml
-- @path TB_Profile=/TestbenchToModel/umlProfiles/testbench/testbench.profile.uml

module tbToE;
create OUT : UML from IN: UML, PRO_E: E_Profile, PRO_TB: TB_Profile; 


When I run this transformation I've got a error

Error loading platform:/resource/TestbenchToModel/umlProfiles/e/e.profile. uml: null

So I'd like to know if it is possible to use *.profile.uml files with ATL, because in all examples found on websites *.ecore files are always used.

Thanks
Re: [ATL] Using *.profile.uml files [message #553049 is a reply to message #552738] Mon, 16 August 2010 09:16 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
There, you're using the profiles as meta-models. So your .profile.uml files have to contain the ecore definition of the profiles which is probably not the case here. Explain a bit more what you're trying to do with the profiles so we can help.
Re: [ATL] Using *.profile.uml files [message #553073 is a reply to message #552738] Mon, 16 August 2010 10:34 Go to previous messageGo to next message
Aur is currently offline AurFriend
Messages: 29
Registered: August 2010
Junior Member
No Message Body

[Updated on: Mon, 23 August 2010 10:29]

Report message to a moderator

Re: [ATL] Using *.profile.uml files [message #553074 is a reply to message #552738] Mon, 16 August 2010 10:36 Go to previous messageGo to next message
Aur is currently offline AurFriend
Messages: 29
Registered: August 2010
Junior Member
In fact I'd like to transform a model on which a profile is applied to another model with a different profile application.

For example the source model could contain :

<<driver>> <Class> MyDriver
<<monitor>> <Class> InputMonitor
<<monitor>> <Class> OutputMonitor

(stereotypes driver and monitor are defined in testbench profile)

And I'd like to transform to

<<module>> <Package> DriverModule
<<module>> <Package> InputMonitorModule
<<module>> <Package> OutputMonitorModule

(stereotype module is defined in e profile)

I hope that help to understand what I'm trying to do.
Re: [ATL] Using *.profile.uml files [message #553078 is a reply to message #552738] Mon, 16 August 2010 11:11 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
If your profiles are valid, you could load IN as conforming to TB_Profile and OUT as conformed to E_Profile (both references UML2 and are, in fact, UML2 extensions so this should work)
Re: [ATL] Using *.profile.uml files [message #554223 is a reply to message #552738] Fri, 20 August 2010 15:09 Go to previous messageGo to next message
Aur is currently offline AurFriend
Messages: 29
Registered: August 2010
Junior Member
I manage to load my profiles and I can test if a stereotype is applied on an element. For example :
helper context TB_Profile!Class def: hasStereotype(stereotype : String) : Boolean =
	self.getAppliedStereotypes() -> collect(st | st.name) -> includes(stereotype);


But when I try to apply a stereotype with this helper:
helper def : getStereotype(name : String) : UML!Stereotype =
	OUT!Stereotype.allInstances()->select(s | s.name = name).first();


I have got the following exception :
VMException: org.eclipse.m2m.atl.core.emf.EMFModel cannot be cast to org.eclipse.m2m.atl.core.IReferenceModel


I thought it was because the OUT file is in write only mode so I try to give the profile in input but that doesn't work.
helper def : getStereotype(name : String) : UML!Stereotype =	
	Pro_E!Stereotype.allInstances()->select(s | s.name = name).first();


java.lang.IllegalArgumentException: org.eclipse.uml2.uml.internal.impl.StereotypeImpl@e9ab37 (name: Module, visibility: <unset>) (isLeaf: false, isAbstract: false) (isActive: false)


That seems do be due to a wrong stereotype definition, but when I check my stereotype the visibility is set to public. So I don't understand why the visibility property is <unset>
Re: [ATL] Using *.profile.uml files [message #554471 is a reply to message #552738] Mon, 23 August 2010 10:29 Go to previous messageGo to next message
Aur is currently offline AurFriend
Messages: 29
Registered: August 2010
Junior Member
This problem was due to the fact that I applied a profile on the model but generated classes were not include in this model ... so I wasn't able to use stereotypes.

Setting the package property allows me to apply stereotypes.

Thanks for your time and consideration Sylvain

[Updated on: Mon, 23 August 2010 10:31]

Report message to a moderator

Re: [ATL] Using *.profile.uml files [message #635634 is a reply to message #554471] Wed, 27 October 2010 14:49 Go to previous messageGo to next message
Pejman  is currently offline Pejman Friend
Messages: 18
Registered: June 2010
Junior Member
Hi,

I have the same problem. Basically I don't know how to transform a class A with the stereotype <<sta>> to the class B with the stereotype <<stb>>. I tried to look in to documents but I found your post. I appreciate if you can help me on this.

Regards,
Pejman
Re: [ATL] Using *.profile.uml files [message #649864 is a reply to message #635634] Thu, 20 January 2011 18:54 Go to previous message
Ola Missing name is currently offline Ola Missing nameFriend
Messages: 9
Registered: January 2011
Junior Member
Hello,

Could you please let me know what is the right method to check what the applied stereotype on a Class using ATL scrpit?

I have used this method and it is not working.

helper context uml!Class def: isOrder() : Boolean = (not self.getAppliedStereotype('ProfileName::StereotypeName').ocl IsUndefined());

I appreciate any help!

Thanks, Ola
Previous Topic:Couldn't find operation "!=(Void)" for stereotype's property
Next Topic:ATL- SCA empty output file
Goto Forum:
  


Current Time: Wed Jun 19 16:41:56 GMT 2019

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

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

Back to the top