Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Can I apply helpers just on classes used as main class?
[ATL] Can I apply helpers just on classes used as main class? [message #547686] Mon, 19 July 2010 11:10 Go to next message
Roger80  is currently offline Roger80 Friend
Messages: 79
Registered: May 2010
Member
Hello

I created a helper which has his context related to class ControlFlow.
 helper context EPK!ControlFlow def: isConditionExpression() 


Now I wanted to assign this helper to the rule:

-- Rule 9c / 11b
rule Event {
from
	e : EPK!Event (not e.isConditionExpression())
to 
...


Is this not working (context of helper: ControlFlow / from in rule EPK!Event)? How can I then check this?

thanks for your help. Cheers Roger
Re: [ATL] Can I apply helpers just on classes used as main class? [message #547692 is a reply to message #547686] Mon, 19 July 2010 11:23 Go to previous messageGo to next message
Vincent MAHE is currently offline Vincent MAHEFriend
Messages: 129
Registered: July 2009
Senior Member
Le 19/07/2010 13:10, Roger80 a écrit :
> Hello
> I created a helper which has his context related to class ControlFlow.
> helper context EPK!ControlFlow def: isConditionExpression()
> Now I wanted to assign this helper to the rule:
>
>
> -- Rule 9c / 11b
> rule Event {
> from
> e : EPK!Event (not e.isConditionExpression())
> to ..
>
>
> Is this not working (context of helper: ControlFlow / from in rule
> EPK!Event)? How can I then check this?
>
> thanks for your help. Cheers Roger

ATL and EMF respect inheritance principles so if you want to apply your
rule to multiple types which inherit from a main class, you have to put
the main type as context of this rule !!!
--
Cordialement

Vincent MAHÉ

Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00
Re: [ATL] Can I apply helpers just on classes used as main class? [message #547706 is a reply to message #547686] Mon, 19 July 2010 12:12 Go to previous messageGo to next message
Roger80  is currently offline Roger80 Friend
Messages: 79
Registered: May 2010
Member
Ok, but then my helper is not working anymore...i need this helper for both rules, once for the Event rule and once for the Control flow rule...do I have to make then two rules?
Re: [ATL] Can I apply helpers just on classes used as main class? [message #547708 is a reply to message #547686] Mon, 19 July 2010 12:15 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Use an OclAny context if there is no common EClass in the inheritance trees of the two classes.
icon14.gif  Re: [ATL] Can I apply helpers just on classes used as main class? [message #547768 is a reply to message #547686] Mon, 19 July 2010 15:00 Go to previous message
Roger80  is currently offline Roger80 Friend
Messages: 79
Registered: May 2010
Member
Thanks, through your answer I was able to solve it.
Previous Topic:java code
Next Topic:[QVTo] Return from mapping
Goto Forum:
  


Current Time: Sat Apr 17 21:21:46 GMT 2021

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