Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Applying UML profile
[ATL] Applying UML profile [message #660304] Thu, 17 March 2011 18:04 Go to next message
Sally  is currently offline Sally Friend
Messages: 16
Registered: March 2011
Junior Member
Hi all,

I'm trying to apply a UML profile and stereotype to a UML sequence diag. giving my profile (Pro) as input model. But it raises this error:

org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found: OUT!CustomerInterface.getStereotype(java.lang.String)
at __applyLifeline#19(transApplied2.atl[40:22-40:49])

The ATL file:
module transApplied2;
create OUT : UML from IN : UML, Pro : UML;

helper def : getStereotype(name : String) : UML!Stereotype =
UML!Stereotype.allInstancesFrom('Pro')->select(p | p.name = name)->first();

rule Model {
from
s : UML!Model
to
t : UML!Model ( name <- s.name)
do {
t.applyProfile(UML!Profile.allInstancesFrom('Pro')->select(p | p.name = 'seqProTest1')->first()); }
}

rule Lifeline {
from
s : UML!Lifeline
to
t : UML!Lifeline (name <- s.name)
do {
t.applyStereotype(t.getStereotype('optional'));
--t.applyStereotype(t.getApplicableStereotype('seqProTest1:: optional')); }
}

Does anyone know why it couldn't find the operation getStereotype.

Thanks in advance,

Sally
Re: [ATL] Applying UML profile [message #660305 is a reply to message #660304] Thu, 17 March 2011 18:16 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
The helper getStereotype is defined without context so to call it you have to use "thisModule" :
thisModule.getStereotype(str)
Re: [ATL] Applying UML profile [message #660340 is a reply to message #660305] Fri, 18 March 2011 01:24 Go to previous messageGo to next message
Sally  is currently offline Sally Friend
Messages: 16
Registered: March 2011
Junior Member
Thanks Sylvain. I still get the same error that "operation not found"
Re: [ATL] Applying UML profile [message #661402 is a reply to message #660340] Thu, 24 March 2011 14:35 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
Your passing a UML!Stereotype into getStereotype(name : String) when the helper expects the stereotype name. This means ATL won't find a helper matching your signature.
Regards,
Ronan
Re: [ATL] Applying UML profile [message #663429 is a reply to message #660304] Tue, 05 April 2011 02:43 Go to previous message
Sally  is currently offline Sally Friend
Messages: 16
Registered: March 2011
Junior Member
Hi,
I modified to
t.applyStereotype(thisModule.getStereotype('optional'));
where optional is the stereotype name

I get this error
Operation not found: OUT!CustomerInterface.applyStereotype(org.eclipse.m2m.atl.en gine.emfvm.lib.OclUndefined)

The profile is correctly applied to the model, the problem with the operation applyStereotype.

I appreciate any hint.

Sally
Previous Topic:[ATL] String.split() method does not run
Next Topic:[QVTo] Logging DateTime
Goto Forum:
  


Current Time: Tue Mar 19 02:25:10 GMT 2024

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

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

Back to the top